Ejemplo n.º 1
0
        public IActionResult Index(int customerId)
        {
            // string username = this.HttpContext.Session.GetString(SessionConstant.UserNameSession);
            // if (string.IsNullOrEmpty(username))
            // {
            //     return RedirectToAction("Login", "Account");
            // }
            int salesId         = Convert.ToInt32(this.HttpContext.Session.GetInt32(SessionConstant.SalesId));
            var salesDetailList = this._salesRepository.GetListSalesDetailOf(salesId);

            ViewData["SalesDetails"] = salesDetailList;
            var addCreditDto = new AddCreditDTO {
                CustomerId = customerId
            };

            return(View(addCreditDto));
        }
Ejemplo n.º 2
0
        public IActionResult AddTerm(AddCreditDTO term)
        {
            int     salesId      = Convert.ToInt32(this.HttpContext.Session.GetInt32(SessionConstant.SalesId));
            var     userId       = User.FindFirstValue(ClaimTypes.NameIdentifier);
            decimal grandTotal   = Convert.ToDecimal(term.GrandTotal);
            decimal down         = Convert.ToDecimal(term.DownPayment);
            int     payableFor   = Convert.ToInt32(term.PayableFor);
            decimal interest     = Convert.ToDecimal(term.Interest);
            string  errorMessage = "";

            this._paymentService.PerformPayment(
                term.CustomerId,
                userId,
                salesId,
                term.TermName,
                grandTotal,
                down,
                payableFor,
                interest,
                out errorMessage);
            return(RedirectToAction("PrintReceipt", "Credit"));
        }