public static void Delete(EditableCustomer customer) { EditableCustomer target = One(c => c.CustomerID == customer.CustomerID); if (target != null) { All().Remove(target); } }
public static void Update(EditableCustomer customer) { EditableCustomer target = One(c => c.CustomerID == customer.CustomerID); if (target != null) { target.Address = customer.Address; target.ContactName = customer.ContactName; target.Country = customer.Country; target.BirthDay = customer.BirthDay; } }
public static void Insert(EditableCustomer customer) { customer.CustomerID = Guid.NewGuid().ToString(); All().Insert(0, customer); }
public GridModel Update(GridState state, EditableCustomer value) { SessionCustomerRepository.Update(value); return SessionCustomerRepository.All().AsQueryable().ToGridModel(state); }
[WebMethod(EnableSession = true)] //Session required by SessionCustomerRepository public GridModel Delete(EditableCustomer value, GridState state) { SessionCustomerRepository.Delete(value); return(SessionCustomerRepository.All().AsQueryable().ToGridModel(state)); }
public GridModel Insert(EditableCustomer value, GridState state) { SessionCustomerRepository.Insert(value); return SessionCustomerRepository.All().AsQueryable().ToGridModel(state); }
public GridModel Insert(GridState state, EditableCustomer value) { SessionCustomerRepository.Insert(value); return(SessionCustomerRepository.All().AsQueryable().ToGridModel(state)); }