public static void InsertCustomer(Customer newCustomer)
        {
            SampleDBEntities dataContext = new SampleDBEntities();

            dataContext.Customers.Add(newCustomer);
            dataContext.SaveChanges();
        }
        public static void DeleteCustomer(string customerID)
        {
            SampleDBEntities dataContext = new SampleDBEntities();
            var query = (from customer in dataContext.Customers
                         where customer.CustomerID == customerID
                         select customer).SingleOrDefault();

            dataContext.Customers.Remove(query);
            dataContext.SaveChanges();
        }
        public static void UpdateCustomer(Customer oldCustomer)
        {
            SampleDBEntities dataContext = new SampleDBEntities();
            var query = (from customer in dataContext.Customers
                         where customer.CustomerID == oldCustomer.CustomerID
                         select customer).SingleOrDefault();

            query.CustomerID  = oldCustomer.CustomerID;
            query.ContactName = oldCustomer.ContactName;
            query.City        = oldCustomer.City;
            dataContext.SaveChanges();
        }