public void AddCustomer(DetailsOfCustomer detailsOfCustomer) { DataBaseEntities1 db = new DataBaseEntities1(); db.Customers.Add(detailsOfCustomer.ConvertCustomerToDal()); db.SaveChanges(); }
public void UpdateCustomer(DetailsOfCustomer detailsOfCustomer) { Customers customers = Mapper.ConvertCustomerToDal(detailsOfCustomer); using (var db = new DataBaseEntities1()) { db.Entry <Customers>(db.Set <Customers>().Find(customers.Group_s_code)).CurrentValues.SetValues(customers); db.SaveChanges(); } }
// PUT: api/Customer/5 public void Put([FromBody] DetailsOfCustomer detailsOfCustomer) { ManagmentOfCustomer.UpdateCustomer(detailsOfCustomer); }
// POST: api/Customer public void Post([FromBody] DetailsOfCustomer detailsOfCustomer) { ManagmentOfCustomer.addCustomer(detailsOfCustomer); }
public static void UpdateCustomer(DetailsOfCustomer detailsOfCustomer) { ManagementOfCustomer.management_of_customer.UpdateCustomer(detailsOfCustomer); }
public static void addCustomer(DetailsOfCustomer details_of_customer) { ManagementOfCustomer.management_of_customer.AddCustomer(details_of_customer); }