コード例 #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;
 }
コード例 #4
0
 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);
 }