Beispiel #1
0
        public async Task <IActionResult> Create(promocodeCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                var obj = new promocodemaster
                {
                    id = model.id
                    ,
                    promocode = model.promocode
                    ,
                    promocodeusagelimit = model.promocodeusagelimit
                    ,
                    discount = model.discount
                    ,
                    discounttype = model.discounttype
                    ,
                    expirydate = model.expirydate
                    ,
                    createddate = DateTime.Now
                    ,
                    isdeleted = false
                    ,
                    isactive = false
                };

                await _promocodeServices.CreateAsync(obj);

                TempData["success"] = "Record Saved successfully";
                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(View());
            }
        }
Beispiel #2
0
        public IActionResult Create()
        {
            var model = new promocodeCreateViewModel();

            return(View(model));
        }