public void Update(Customer customer) { Customer dest = WebSiteDB.MyNorthwind.Customers.FirstOrDefault(c => c.CustomerID == customer.CustomerID); if( dest != null ) { dest.CustomerName = customer.CustomerName; dest.Address = customer.Address; dest.ContactName = customer.ContactName; dest.PostalCode = customer.PostalCode; dest.Tel = customer.Tel; } }
public void Update(Customer customer) { customer.EnsureItemIsOK(); BllFactory.GetCustomerBLL().Update(customer); }
public void Insert(Customer customer) { int maxId = WebSiteDB.MyNorthwind.Customers.Max(x => x.CustomerID); customer.CustomerID = maxId + 1; WebSiteDB.MyNorthwind.Customers.Add(customer); }
public void Insert(Customer customer) { customer.EnsureItemIsOK(); BllFactory.GetCustomerBLL().Insert(customer); }