Пример #1
0
        public ActionResult Create(PollAnswerManageModel model, SubmitType submit)
        {
            if (ModelState.IsValid)
            {
                var response = _pollAnswerService.SavePollAnswer(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));
        }