public void Insert(Reservation t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Reservations.Add(t); db.SaveChanges(); } }
public void Insert(ProductOrder t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.ProductOrders.Add(t); db.SaveChanges(); } }
public void Insert(AccountPayment t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.AccountPayments.Add(t); db.SaveChanges(); } }
public void Insert(Customer t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Customers.Add(t); db.SaveChanges(); } }
public void Insert(Table t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Tables.Add(t); db.SaveChanges(); } }
public void Insert(Staff t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Staffs.Add(t); db.SaveChanges(); } }
public void Delete(Reservation t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Reservations.Attach(t); db.Entry(t).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void Update(ProductOrder t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.ProductOrders.Attach(t); db.Entry(t).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void Update(Addition t) { using (RestoranDBEntities db = new RestoranDBEntities()) { db.Additions.Attach(t); db.Entry(t).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void Delete(int id) { using (RestoranDBEntities db = new RestoranDBEntities()) { Reservation a = Get(id); db.Reservations.Attach(a); db.Entry(a).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void Delete(int id) { using (RestoranDBEntities db = new RestoranDBEntities()) { Customer c = Get(id); db.Customers.Attach(c); db.Entry(c).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void Delete(int id) { using (RestoranDBEntities db = new RestoranDBEntities()) { Table s = Get(id); db.Tables.Attach(s); db.Entry(s).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void Update(Reservation t) { using (RestoranDBEntities db = new RestoranDBEntities()) { var reserve = Get(t.ReservationID); reserve.PersonCount = t.PersonCount; reserve.ReservationDate = t.ReservationDate; reserve.ReservationNote = t.ReservationNote; reserve.Status = t.Status; reserve.ReservationID = t.ReservationID; reserve.CustomerID = t.CustomerID; db.Reservations.Attach(reserve); db.Entry(reserve).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }