public int InsertOrders(int customerID, int productID, int count)
 {
     using (SCWCFRest.db6d71ab021b7344fe97f9a75f0150b4eaEntities DB = new db6d71ab021b7344fe97f9a75f0150b4eaEntities())
     {
         DB.AddOrder(customerID, productID, count);
     }
     return(1);
 }
 // GET: api/Service/5
 public List <GetProduct_Result> Get(int id)
 {
     using (SCWCFRest.db6d71ab021b7344fe97f9a75f0150b4eaEntities DB = new db6d71ab021b7344fe97f9a75f0150b4eaEntities())
     {
         var        products = DB.GetProduct(id).ToList();
         JsonResult test     = new JsonResult();
         test.Data = products;
         return(products);
     }
 }
        public int InsertCustomer(string customer)
        {
            int customerID = 0;

            using (SCWCFRest.db6d71ab021b7344fe97f9a75f0150b4eaEntities DB = new db6d71ab021b7344fe97f9a75f0150b4eaEntities())
            {
                Customer c = JsonConvert.DeserializeObject <Customer>(customer);
                DB.InsertCustomer(c.CustomerID.ToString(), c.Firstname, c.Middlename, c.Lastname,
                                  c.Address, c.Address2, c.City, c.State, c.Zip);
                customerID = DB.Customers.Max(cust => cust.CustomerID);
            }
            return(customerID);
        }