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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}lock(Data) {Data.Rows.Add(row);}UP up = new UP(user);// Add SUPsforeach (string supName in supNames)up.AddSUP(supName);return up;internal static DataTable Data{get{return table;}}public static UP GetUP(UserId user){DataRow row = Data.Rows.Find(user.IPAddress);if (row == null) return null;return new UP(row);}public static void Initialize(DataSet dataSet, SqlConnectionconnection){SUP.Initialize(dataSet, connection);UPNo<strong>de</strong>.Initialize(dataSet, connection);adapter = DataUtilities.InitializeTable(dataSet,connection, TABLE_NAME);table = dataSet.Tables[TABLE_NAME];// Create relationToNo<strong><strong>de</strong>s</strong> = table.DataSet.Relations.Add("UP_To_UPNo<strong><strong>de</strong>s</strong>",table.Columns[USER_ID],UPNo<strong>de</strong>.Data.Columns[UPNo<strong>de</strong>.UP],false);// Linkage between UP and SUPupSupAdapter = DataUtilities.InitializeTable(dataSet,connection,UP_SUP_TABLE_NAME);upSupTable = dataSet.Tables[UP_SUP_TABLE_NAME];ToSUPs = upSupTable.DataSet.Relations.Add("UP_To_SUPs",table.Columns[USER_ID],upSupTable.Columns[UP_COL],false);}public static void Update(){SUP.Update();UPNo<strong>de</strong>.Update();adapter.Update(Data);}//************ NON-STATIC PART *************private UserId _user;/// /// Wraps already existing data as a SUP object.MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 114

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

Saved successfully!

Ooh no, something went wrong!