public ViewResult Index(IGetCurrentMeetingAndRaffleItems query, IGetMemberByEmail memberQuery) { var vm = new IndexViewModel { Meeting = query.Result(), Member = memberQuery.Result(User.Identity.Name), }; return View(vm); }
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); }
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); }