public IActionResult AddLine(AddSalesTranCreditLineDTO salesLine) { string username = this.HttpContext.Session.GetString(SessionConstant.UserNameSession); if (string.IsNullOrEmpty(username)) { return(RedirectToAction("Login", "Account")); } string errorMessage = ""; this._salesTranService .AddTransaction( salesLine.CustomerId, salesLine.ProductId, salesLine.Quantity, out errorMessage); if (!string.IsNullOrEmpty(errorMessage)) { TempData["Fail"] = errorMessage; return(RedirectToAction("Index", "SalesTransactionCredit", new { customerId = salesLine.CustomerId })); } return(RedirectToAction("Index", "SalesTransactionCredit", new { customerId = salesLine.CustomerId })); }
public SalesTransactionCreditViewModel() { AddSalesTranCreditLineDTO = new AddSalesTranCreditLineDTO(); UpdatedSalesCreditQuantityDTO = new UpdatedSalesCreditQuantityDTO(); DeleteSalesCreditLineDTO = new DeleteSalesCreditLineDTO(); SalesOrderCreditDTO = new SalesOrderCreditDTO(); }