public void Waiter_Update(Waiter item) { using (eResturauntContext context = new eResturauntContext()){ context.Entry <Waiter>(context.Waiters.Attach(item)).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void SpecialEvents_Delete(SpecialEvent item) { using (eResturauntContext context = new eResturauntContext()) { SpecialEvent existing = context.SpecialEvents.Find(item.EventCode); context.SpecialEvents.Remove(existing); context.SaveChanges(); } }
public void SpecialEvents_Update(SpecialEvent item) { using (eResturauntContext context = new eResturauntContext()) { context.Entry <SpecialEvent>(context.SpecialEvents.Attach(item)).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void Waiter_Delete(Waiter item) { using (eResturauntContext context = new eResturauntContext()) { Waiter existing = context.Waiters.Find(item.WaiterID); context.Waiters.Remove(existing); context.SaveChanges(); } }
public void Waiter_Add(Waiter item) { using (eResturauntContext context = new eResturauntContext()) { Waiter added = null; added = context.Waiters.Add(item); context.SaveChanges(); } }
public void SpecialEvents_Add(SpecialEvent item) { using (eResturauntContext context = new eResturauntContext()) { SpecialEvent added = null; added = context.SpecialEvents.Add(item); // commits the add to the database // evaluates the anotations(validations) on your entity //[Required],[StringLength],[Range]... context.SaveChanges(); } }