Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 public Customer(Models.Customer item)
 {
     this.Model = item;
 }