public static void InsertTimeEntry(this TimeEntry t) { CheckDB(); db.TimeEntries.InsertOnSubmit(t); db.SubmitChanges(); db = null; }
public static void CreateDatabase() { using (TimeEntryDataContext db = new TimeEntryDataContext()) { if (!db.DatabaseExists()) { db.CreateDatabase(); } } }
private static void CheckDB() { if (db == null) db = new TimeEntryDataContext(); }
public static void UpdateTimeEntry(this TimeEntry t) { CheckDB(); db.SubmitChanges(); db = null; }