예제 #1
0
 public static void InsertTimeEntry(this TimeEntry t)
 {
     CheckDB();
     db.TimeEntries.InsertOnSubmit(t);
     db.SubmitChanges();
     db = null;
 }
예제 #2
0
 public static void CreateDatabase()
 {
     using (TimeEntryDataContext db = new TimeEntryDataContext())
     {
         if (!db.DatabaseExists())
         {
             db.CreateDatabase();
         }
     }
 }
예제 #3
0
 private static void CheckDB()
 {
     if (db == null)
         db = new TimeEntryDataContext();
 }
예제 #4
0
 public static void UpdateTimeEntry(this TimeEntry t)
 {
     CheckDB();
     db.SubmitChanges();
     db = null;
 }