10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}}Row[OCCURRENCES] = Occurrences + 1;Row[LAST_USE] = DateTime.Now;}27. Class Architecture.Profiles.SUP – Standard UserProfileusing System;using System.Data;using System.Data.SqlClient;using System.Diagnostics;namespace Architecture.Profiles{/// /// Standard User Profile./// [Serializable]public class SUP : IProfile{// Data tableprivate static readonly string TABLE_NAME = "SUP";private static DataTable table;// SqlDataAdapterprivate static SqlDataAdapter adapter;// Column namesprivate static readonly string SUP_NAME = "SUPName";private static readonly string DESCRIPTION = "<strong><strong>de</strong>s</strong>cription";// Relationprivate static DataRelation ToNo<strong><strong>de</strong>s</strong>;public static void Cleanup(SqlConnection connection){SUPNo<strong>de</strong>.Cleanup(connection);DataUtilities.CleanupTable(connection, TABLE_NAME);}already");/// /// Creates new SUP data./// /// internal static SUP CreateSUP(string name){return CreateSUP(name, "");}internal static SUP CreateSUP(string name, string <strong><strong>de</strong>s</strong>cription){Debug.Assert(name != null);if (Data.Rows.Find(name) != null)throw new Exception("SUP named " + name + " exists}DataRow row = Data.NewRow();row[SUP_NAME] = name;row[DESCRIPTION] = <strong><strong>de</strong>s</strong>cription;lock(Data) {Data.Rows.Add(row);}return new SUP(name);MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!