Example #1
0
        public static void AddCustomer(string customerID, string contactName, string contactTitle, string companyName)
        {
            Customer c = new Customer()
            {
                CustomerID = customerID,
                ContactName = contactName,
                ContactTitle = contactTitle,
                CompanyName = companyName

            };
            db.Customers.AddObject(c);
            db.SaveChanges();
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCustomers(Customer customer)
 {
     base.AddObject("Customers", customer);
 }
 /// <summary>
 /// Create a new Customer object.
 /// </summary>
 /// <param name="customerID">Initial value of the CustomerID property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 public static Customer CreateCustomer(global::System.String customerID, global::System.String companyName)
 {
     Customer customer = new Customer();
     customer.CustomerID = customerID;
     customer.CompanyName = companyName;
     return customer;
 }
Example #4
0
 public static void DeleteCustomer(Customer c)
 {
     db.Customers.DeleteObject(c);
     db.SaveChanges();
 }
Example #5
0
 public static void UpdateCustomerContactName(Customer c, string contactName)
 {
     c.ContactName = contactName;
     db.SaveChanges();
 }