Example #1
0
        public async Task <IActionResult> storepayment(storePayAmountViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.finalamt < model.amount)
                {
                    ModelState.AddModelError("ModelOnly", "Please Pay Proper Amount");
                    return(View(model));
                }
                else
                {
                    var paramter = new DynamicParameters();
                    paramter.Add("@storeid", model.storeid);
                    paramter.Add("@amount", model.amount);
                    _sP_Call.Execute("insertStorePaymentamt", paramter);

                    TempData["success"] = "Amount Pay to Store successfully";
                    return(RedirectToAction(nameof(storepaymentIndex)));
                }
            }
            else
            {
                return(View(model));
            }

            //  return View(model);
        }
Example #2
0
        public async Task <IActionResult> storepayment(string id, string name, decimal amount)
        {
            var model = new storePayAmountViewModel
            {
                storeid = id
                ,
                storename = name
                ,
                amount = 0
                ,
                finalamt = amount
                ,
                remaining = amount
            };

            return(View(model));
        }