コード例 #1
0
ファイル: MemberController.cs プロジェクト: jonantoine/gcr
        public ActionResult Create(MemberViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var member = MemberViewModel.ToModel(model);
                    memberService.SaveMember(member);

                    return(RedirectToAction("Admin"));
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex);
                this.LogError(ex);
            }

            ViewBag.PageTitle = "Create New Member";
            ViewBag.Title     = "Create Member";
            return(View("CreateEdit", model));
        }