Пример #1
0
 public ViewResult Index(IGetCurrentMeetingAndRaffleItems query, IGetMemberByEmail memberQuery)
 {
     var vm = new IndexViewModel
                  {
                      Meeting = query.Result(),
                      Member = memberQuery.Result(User.Identity.Name),
                  };
     return View(vm);
 }
Пример #2
0
        public ViewResult Register(IGetMemberRegistration regQuery,
            IGetCurrentMeetingAndRaffleItems meetingQuery,
            IGetMemberByEmail memberQuery)
        {
            var member = memberQuery.Result(User.Identity.Name);
            var meeting = meetingQuery.Result();
            var registration = regQuery.Result(meeting, member);

            return View(registration);
        }
Пример #3
0
        public ActionResult Create(IGetMemberByEmail query, Member member)
        {
            if (ModelState.IsValid)
            {
                var dbmember = query.Result(member.Email);
                if (dbmember == null)
                {
                    _repo.Save(member);
                    return Redirect("~/");
                }
                else
                {
                    ModelState.AddModelError("", "A member with this email already exists");
                }
            }

            return View(member);
        }