public ActionResult Index(string returnUrl) { var model = new NewDiscModel { ReturnUrl = returnUrl }; return(View(model)); }
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()); }