// GET: Customer/ProductsCustomer public ActionResult Index() { var model = new KhuModels(); model.Product = db.Product.ToList(); model.ProductType = db.ProductType.ToList(); return(View(model)); }
public ActionResult Search(String search) { var model = new KhuModels(); var result = model.Product = db.Product.Where(i => i.ProductName.Contains(search)); model.ProductType = db.ProductType.ToList(); model.search = search; model.searchNumber = result.Count(); return(View(model)); }
// GET: Customer/ProductsCustomer/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product product = db.Product.Find(id); if (product == null) { return(HttpNotFound()); } var model = new KhuModels(); model.Product = db.Product.ToList(); model.ProductType = db.ProductType.ToList(); model.Product1 = product; return(View(model)); }
// GET: Admin/CashBillsAdmin/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CashBill cashBill = db.CashBill.Find(id); if (cashBill == null) { return(HttpNotFound()); } var model = new KhuModels(); model.Product = db.Product.ToList(); model.ProductType = db.ProductType.ToList(); model.Cashbill = cashBill; return(View(model)); }
public ActionResult Category(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductType type = db.ProductType.Find(id); if (type == null) { return(HttpNotFound()); } var model = new KhuModels(); model.Product = db.Product.ToList(); model.ProductType = db.ProductType.ToList(); model.Category = type; return(View(model)); }