コード例 #1
0
        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 }));
        }
コード例 #2
0
 public SalesTransactionCreditViewModel()
 {
     AddSalesTranCreditLineDTO     = new AddSalesTranCreditLineDTO();
     UpdatedSalesCreditQuantityDTO = new UpdatedSalesCreditQuantityDTO();
     DeleteSalesCreditLineDTO      = new DeleteSalesCreditLineDTO();
     SalesOrderCreditDTO           = new SalesOrderCreditDTO();
 }