public ActionResult Search(int id) { bool res = s.backbill(); if (res == true) { int UserId = int.Parse(Session["userID"].ToString()); var modelX = new BillsWithExten(); var model = _db.Bills.Where(x => x.Id == id && x.User_ID == UserId).FirstOrDefault(); if (model != null) { modelX.billsY = model; modelX.billCOntentX = _db.BillsContent.Where(p => p.Bill_ID == id).ToList(); modelX.prodCategoryX = _db.ProductCategory.ToList(); modelX.productX = _db.Products.ToList(); var proInContent = _db.BillsContent.Select(p => p.Product_ID).ToList(); ViewBag.pro = new SelectList(_db.BillsContent.Select(p => p.Product_ID).ToList(), "Pro_id", "name"); return(View(modelX)); } return(RedirectToAction("HavntAccess", "Employee")); } return(RedirectToAction("HavntAccess", "Employee")); }
// GET: StoreHouse public ActionResult Index() { bool res = s.products(); if (res == true) { var model = new BillsWithExten(); model.prodCategoryX = _db.ProductCategory.ToList(); model.ClientsX = _db.Clients.Where(f => f.Clients_Type_ID == 1).ToList(); ViewBag.product = new SelectList(_db.Products.ToList(), "Pro_id", "name"); ViewBag.productCat = new SelectList(_db.ProductCategory.ToList(), "Cate_ID", "name"); return(View(model)); } return(RedirectToAction("HavntAccess", "Employee")); }
public ActionResult ReturnBill() { bool res = s.backbill(); if (res == true) { var model = new BillsWithExten(); model.productX = _db.Products.ToList(); model.ClientsX = _db.Clients.ToList(); int UserId = int.Parse(Session["userID"].ToString()); model.billsX = _db.Bills.Where(p => p.User_ID == UserId).ToList(); model.billCOntentX = _db.BillsContent.ToList(); return(View(model)); } return(RedirectToAction("HavntAccess", "Employee")); }
public ActionResult BuyBill() { bool res = s.purchasebill(); if (res == true) { var model = new BillsWithExten(); model.prodCategoryX = _db.ProductCategory.ToList(); model.ClientsX = _db.Clients.Where(f => f.Clients_Type_ID == 2).ToList(); model.StorehouseX = _db.Storehouse.ToList(); ViewBag.product = new SelectList(_db.Products.ToList(), "Pro_id", "name"); ViewBag.productCat = new SelectList(_db.ProductCategory.ToList(), "Cate_ID", "name"); Session["BillCategory"] = 5; return(View(model)); } return(RedirectToAction("HavntAccess", "Employee")); }