Exemplo n.º 1
0
        public bool CustomerDelete(Customer customer)
        {
            return Execute<bool>(dal =>
            {
                Customer customerDelete = dal.Customer.Where(x => x.CustomerID == customer.CustomerID).FirstOrDefault();
                if (customerDelete != null)
                {
                    dal.Customer.DeleteOnSubmit(customerDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
Exemplo n.º 2
0
        public bool CustomerUpdate(Customer customer)
        {
            return Execute<bool>(dal =>
               {
               Customer customerUpdate = dal.Customer.Where(x => x.CustomerID == customer.CustomerID).FirstOrDefault();
               if (customerUpdate != null)
               {
                   customerUpdate.CustomerID = customer.CustomerID;
                   customerUpdate.PersonID = customer.PersonID;
                   customerUpdate.StoreID = customer.StoreID;
                   customerUpdate.TerritoryID = customer.TerritoryID;
                   customerUpdate.AccountNumber = customer.AccountNumber;
                   customerUpdate.rowguid = customer.rowguid;
                   customerUpdate.ModifiedDate = customer.ModifiedDate;

                   dal.SubmitChanges();
                   return true;
               }
               return false;

               });
        }
		private void detach_Customers(Customer entity)
		{
			this.SendPropertyChanging();
			entity.SalesTerritory = null;
		}
 partial void UpdateCustomer(Customer instance);
 partial void DeleteCustomer(Customer instance);
 partial void InsertCustomer(Customer instance);
		private void detach_Customers(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Person = null;
		}
		private void attach_Customers(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Person = this;
		}
Exemplo n.º 9
0
 public void CustomerUpdate(Customer customer)
 {
     adventureWorks_BC.CustomerUpdate(customer);
 }
Exemplo n.º 10
0
 public void CustomerAdd(Customer customer)
 {
     adventureWorks_BC.CustomerAdd(customer);
 }