//Customer Update ------------------------------------------------------------- public Boolean UpdateCustomer(Customer cust, string lub)//Product,LastUpdateBy { DEMO_CUSTOMERS result = (from p in db.DEMO_CUSTOMERS where p.CUSTOMER_ID == cust.CustomerId select p).SingleOrDefault(); result.CUST_FIRST_NAME = cust.FirstName; result.CUST_LAST_NAME = cust.LastName; result.CUST_STREET_ADDRESS1 = cust.Address; result.CUST_CITY = cust.City; result.CUST_STATE = cust.State; result.CUST_POSTAL_CODE = cust.Zip; result.CUST_EMAIL = cust.Email; result.PHONE_NUMBER1 = cust.PhoneNumber; result.URL = cust.Url; result.TAGS = cust.Tags; result.CREDIT_LIMIT = cust.CreditLimit; result.MANUFACTURER_ID = cust.Manufaturer_ID; result.FRONTEND_ID = cust.Frontend_ID; result.LAST_UPDATED_BY = lub; try { db.SaveChanges(); return(true); } catch (DbUpdateException ex) { return(false); } }
public Boolean UpdateCustomerMID(decimal cid, decimal?mid, string lub) //CustomerID, ManufacturerID, LastUpdateBy { DEMO_CUSTOMERS result = (from p in db.DEMO_CUSTOMERS where p.CUSTOMER_ID == cid select p).SingleOrDefault(); result.MANUFACTURER_ID = mid; result.LAST_UPDATED_BY = lub; try { db.SaveChanges(); return(true); } catch (DbUpdateException ex) { return(false); } }
public Boolean UpdateCustomerFID(decimal cid, decimal?fid, string lub) //CustomerID, FrontendID, LastUpdateBy { DEMO_CUSTOMERS result = (from p in db.DEMO_CUSTOMERS where p.CUSTOMER_ID == cid select p).SingleOrDefault(); result.FRONTEND_ID = fid; result.LAST_UPDATED_BY = lub; try { db.SaveChanges(); return(true); } catch (DbUpdateException ex) { return(false); } }
public void AddCustomer(Customer c) { DEMO_CUSTOMERS ct = new DEMO_CUSTOMERS(); ct.CUSTOMER_ID = c.CustomerId; ct.CUST_FIRST_NAME = c.FirstName; ct.CUST_LAST_NAME = c.LastName; ct.CUST_STREET_ADDRESS1 = c.Address; ct.CUST_CITY = c.City; ct.CUST_STATE = c.State; ct.CUST_POSTAL_CODE = c.Zip; ct.CUST_EMAIL = c.Email; ct.PHONE_NUMBER1 = c.PhoneNumber; ct.URL = c.Url; ct.CREDIT_LIMIT = c.CreditLimit; ct.TAGS = c.Tags; ct.FRONTEND_ID = c.Frontend_ID; db.DEMO_CUSTOMERS.Add(ct); db.SaveChanges(); }