public ActionResult SaleStock() { ApplicationDbContext _context = new ApplicationDbContext(); SaleStockViewModel model = new SaleStockViewModel(); model.orderStatusList = _context.OrderStatuses.ToList(); return(View(model)); }
public ActionResult FilterSaleStock(string payment, string toDate, string fromDate, int?statusID, int?pageNo) { SaleStockViewModel model = new SaleStockViewModel(); OrderShippingHanlder handler = new OrderShippingHanlder(); model.SearchItem = payment; model.toDate = toDate; model.frmDate = fromDate; model.statusId = statusID.Value > 0 ? statusID.Value : 0; pageNo = pageNo.HasValue ? pageNo.Value > 0 ? pageNo.Value : 1 : 1; var totalRecord = handler.GetAllSaleProductCount(payment, toDate, fromDate, statusID.Value); model.OrderRecord = handler.GetAllSaleProduct(payment, toDate, fromDate, statusID.Value, pageNo.Value); double bill = 0; foreach (var b in model.OrderRecord) { bill += b.totalBill; } ViewBag.totalBill = bill; if (model.OrderRecord != null) { model.Pager = new Pager(totalRecord, pageNo, 10); return(PartialView("_FilterSaleStock", model)); } return(PartialView("_FilterSaleStock", model)); }