Пример #1
0
 public void ClearChangeLogs()
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         dataContext.ExecuteCommand("TRUNCATE TABLE ChangeLogs");
     }
 }
Пример #2
0
 public void Delete(int itemNumber)
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         dataContext.ExecuteCommand("DELETE FROM TVItems WHERE ItemNumber = {0}", itemNumber);
     }
 }
Пример #3
0
 public IEnumerable <TVItem> GetAll()
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         return(dataContext.TVItems.ToList());
     }
 }
Пример #4
0
 public void AddChangeLog(ChangeLog changeLog)
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         dataContext.ChangeLogs.InsertOnSubmit(changeLog);
         dataContext.SubmitChanges();
     }
 }
Пример #5
0
 public void AddItem(TVItem item)
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         dataContext.TVItems.InsertOnSubmit(item);
         dataContext.SubmitChanges();
     }
 }
Пример #6
0
 public void Update(TVItem item)
 {
     using (var dataContext = new TVItemsDataContext(_connectionString))
     {
         dataContext.TVItems.Attach(item);
         dataContext.Refresh(RefreshMode.KeepCurrentValues, item);
         dataContext.SubmitChanges();
     }
 }