public ActionResult SaveBill(Services.BillConsumption.BillConsumptionAddViewModel model) { string ErrorMsg = ""; _Service = new BillConsumptionService(); int RecordID = _Service.Insert(model, ref ErrorMsg); if (ErrorMsg != "") { if (TempData["ErrorMsg"] == null) { TempData["ErrorMsg"] = ErrorMsg; } } else if (RecordID > 0) { Stock.UpdateStockTankComsumption("IN", 0, RecordID, model.CustomerDetail.TankID, model.CustomerDetail.ContractNo, "tblBillConsumption", "ID", false); if (TempData["ErrorMsg"] == null) { TempData["ErrorMsg"] = "Bill Created Added Successfully"; } } TempData["BillID"] = RecordID; return(RedirectToAction("Confirmation")); }
public ActionResult BillTransaction() { _Service = new BillConsumptionService(); var obj = _Service.GetListView(); return(PartialView("_BillTransaction", obj)); }
public ActionResult GetcustomerDetail(string ContractNo) { _Service = new BillConsumptionService(); _CustomerService = new CustomerService(); var ViewModel = new Services.BillConsumption.BillConsumptionAddViewModel { CustomerDetail = _CustomerService.GetCustomerDetail(ContractNo), ReadingDetail = _Service.GetLastReadingDetail(ContractNo), CustomerOutStanding = _Service.GetBillOutstanding(ContractNo), }; // ViewModel.BillHeader.CurrentReadingDate = System.DateTime.Now.Date; return(PartialView("_AddBillDetail", ViewModel)); }
// GET: BillConsumption public ActionResult List() { _Service = new BillConsumptionService(); var obj = _Service.GetListView(); if (TempData["ErrorMsg"] != null) { string msg = Convert.ToString(TempData["ErrorMsg"]); ModelState.AddModelError("ErrorMsg", msg); } return(View(obj)); }