public WorkDay GetWorkDay(int id) { using (var db = new WorkDbContext()) { var workday = db.WorkDayTable.Find(id); db.Entry(workday).Collection(day => day.WorkLoad).Load(); return(workday); } }
public void EditProduct(Product updatedProduct) { using (var db = new WorkDbContext()) { db.ProductTabel.Attach(updatedProduct); var entry = db.Entry(updatedProduct); entry.State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void EditWorkDay(WorkDay dayEdit) { using (var db = new WorkDbContext()) { db.WorkDayTable.Attach(dayEdit); var entry = db.Entry(dayEdit); entry.State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void UpdateStockTask(StockTask updatedTask) { using (var db = new WorkDbContext()) { db.StockItemTable.Attach(updatedTask); var entry = db.Entry(updatedTask); entry.State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }