Beispiel #1
0
        public static Customer Create(Customer newCustomer)
        {
            CustomerDataContext context = new CustomerDataContext();

            context.Customers.InsertOnSubmit(newCustomer);
            context.SubmitChanges();

            Customer cust = context.Customers.Single(c => c.CustomerID == newCustomer.CustomerID);

            return cust;
        }
Beispiel #2
0
        public static void Update(Customer customer, string customerID)
        {
            CustomerDataContext context = new CustomerDataContext();

            Customer cust = context.Customers.Single(c => c.CustomerID == customer.CustomerID);

            cust.CustomerID = customer.CustomerID;
            cust.Address = customer.Address;
            cust.City = customer.City;
            cust.CompanyName = customer.CompanyName;
            cust.ContactName = customer.ContactName;
            cust.ContactTitle = customer.ContactTitle;
            cust.Country = customer.Country;
            cust.Fax = customer.Fax;
            cust.Phone = customer.Phone;
            cust.PostalCode =customer.PostalCode;
            cust.Region = customer.Region;

            context.SubmitChanges();
        }
Beispiel #3
0
 partial void DeleteCustomer(Customer instance);
Beispiel #4
0
 partial void UpdateCustomer(Customer instance);
Beispiel #5
0
 partial void InsertCustomer(Customer instance);