public void DeleteItem(int itemNumber) { using (var context = new TVItemsDataContext(_connectionString)) { context.ExecuteCommand("DELETE FROM TvItems WHERE ItemNumber = {0}", itemNumber); } }
public void ClearChangeLogs() { using (var context = new TVItemsDataContext(_connectionString)) { context.ExecuteCommand("TRUNCATE Table ChangeLogs"); } }
public IEnumerable <TVItem> GetAll() { using (var context = new TVItemsDataContext(_connectionString)) { return(context.TVItems.ToList()); } }
public void ChangeItemChangeLog(ChangeLog changeLog) { using (var context = new TVItemsDataContext(_connectionString)) { context.ChangeLogs.InsertOnSubmit(changeLog); context.SubmitChanges(); } }
public void AddItem(TVItem item) { using (var context = new TVItemsDataContext(_connectionString)) { context.TVItems.InsertOnSubmit(item); context.SubmitChanges(); } }
public void UpdateItem(TVItem item) { using (var context = new TVItemsDataContext(_connectionString)) { context.TVItems.Attach(item); context.Refresh(RefreshMode.KeepCurrentValues, item); context.SubmitChanges(); } }
public void RemoveItemChangeLog(int itemNumber) { using (var context = new TVItemsDataContext(_connectionString)) { var changeLog = new ChangeLog { ItemNumber = itemNumber, ChangeType = "Remove" }; context.ChangeLogs.InsertOnSubmit(changeLog); context.SubmitChanges(); } }