コード例 #1
0
        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"));
        }
コード例 #2
0
        public ActionResult BillTransaction()
        {
            _Service = new BillConsumptionService();
            var obj = _Service.GetListView();

            return(PartialView("_BillTransaction", obj));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        // 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));
        }