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.

private static SqlDataAdapter adapter;// Column namesinternal static readonly string ID = "i<strong>de</strong>ntifier";internal static readonly string RESOURCE = "resourceId";internal static readonly string SUP = "SUPName";// Relationprivate static DataRelation ToLinks;public static void Cleanup(SqlConnection connection){SUPLink.Cleanup(connection);DataUtilities.CleanupTable(connection, TABLE_NAME);}resource)/// /// Creates new No<strong>de</strong> data./// /// internal static SUPNo<strong>de</strong> CreateNo<strong>de</strong>(SUP profile, ResourceId{}Debug.Assert(profile != null && resource != null);// No<strong>de</strong> should not exist alreadyGuid _id = Guid.NewGuid();DataRow row = Data.NewRow();row[ID] = _id;row[RESOURCE] = resource.Name;row[SUP] = profile.Name;lock(Data) {Data.Rows.Add(row);}return new SUPNo<strong>de</strong>(_id);internal static DataTable Data{get{return table;}}public static void Initialize(DataSet dataSet, SqlConnectionconnection){SUPLink.Initialize(dataSet, connection);adapter = DataUtilities.InitializeTable(dataSet,connection, TABLE_NAME);table = dataSet.Tables[TABLE_NAME];// Create relationToLinks =table.DataSet.Relations.Add("SupNo<strong>de</strong>_To_SupLinks",table.Columns[ID],SUPLink.Data.Columns[SUPLink.ORIGIN],false);}public static void Update(){SUPLink.Update();adapter.Update(Data);}MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 127

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

Saved successfully!

Ooh no, something went wrong!