Пример #1
0
        public ActionResult Create(ScriptManageModel model, SubmitType submit)
        {
            if (ModelState.IsValid)
            {
                var response = _scriptService.SaveScriptManageModel(model);
                SetResponseMessage(response);
                if (response.Success)
                {
                    var id = (int)response.Data;
                    switch (submit)
                    {
                    case SubmitType.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id }));
                    }
                }
            }
            return(View(model));
        }