예제 #1
0
 public List<Customer> GetCustomers()
 {
     ZhenLiuOnlineDBContext customers = new ZhenLiuOnlineDBContext();
     var customerList = customers.Customers.ToList();
     return customerList;
 }
예제 #2
0
 public List<Product> GetProducts()
 {
     ZhenLiuOnlineDBContext products = new ZhenLiuOnlineDBContext();
     var productList = products.Products.ToList();
     return productList;
 }
예제 #3
0
 public Customer GetCustomerById(int customerID)
 {
     ZhenLiuOnlineDBContext customers = new ZhenLiuOnlineDBContext();
     Customer customer = customers.Customers.Single(cus => cus.CustomerId == customerID);
     return customer;
 }
 public JsonResult moveToSpecial(List<int> data)
 {
     var db = new ZhenLiuOnlineDBContext();
     var listOfOrders = db.Products.Where(x => data.Contains(x.Id)).ToList().Select(o => new ProductViewModel {
         Id = o.Id,
         Name = o.Name,
         Price = o.Price.ToString(),
         Url = o.Url,
         OnSpecial = true,
         OutOfStock = false
     }).ToList();
     return Json(listOfOrders, JsonRequestBehavior.AllowGet);
 }