public void UpdateSupplier(SUPPLIER item) { using (PODbEntities1 context = new PODbEntities1()) { context.Entry(item).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void DeleteSupplier(string id) { using (PODbEntities1 context = new PODbEntities1()) { context.SUPPLIERs.Remove( context.SUPPLIERs.Where(e => e.SUPLNO == id).FirstOrDefault()); context.SaveChanges(); } }
public void AddSupplier(SUPPLIER item) { try { using (PODbEntities1 context = new PODbEntities1()) { context.SUPPLIERs.Add(item); context.SaveChanges(); } } catch (Exception e) { throw new Exception(e.Message.ToString()); } }