public Customer Select(Guid customerId) { var db = new Models.OrdersEntities(); Models.Customer customer = (from d in db.Customers where d.Id == customerId select d).Single(); db.Dispose(); return(new Customer(customer)); }
private Bus.Customer ModelFromView() { Models.Customer modCustomer = new Models.Customer(); modCustomer.Id = this.CustomerId; modCustomer.FirstName = txtFirstName.Text; modCustomer.LastName = txtLastName.Text; Bus.Customer customer = new Bus.Customer(modCustomer); return(customer); }
public void Update() { var db = new Models.OrdersEntities(); Models.Customer customer = (from d in db.Customers where d.Id == this.Model.Id select d).Single(); customer.FirstName = this.Model.FirstName; customer.LastName = this.Model.LastName; db.SaveChanges(); db.Dispose(); }
public Customer(Models.Customer item) { this.Model = item; }