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)); }
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")); }