Example #1
0
        public ActionResult Index(string returnUrl)
        {
            var model = new NewDiscModel
            {
                ReturnUrl = returnUrl
            };

            return(View(model));
        }
Example #2
0
        public ActionResult Index(NewDiscModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            DiscountLogic nwdsc = new DiscountLogic();
            string        res   = nwdsc.addnew(Int32.Parse(model.UserID), Int32.Parse(model.GoodID), Int32.Parse(model.percents));

            // Don't do this in production!


            // user authN failed
            ModelState.AddModelError("", res);
            return(View());
        }