Exemplo n.º 1
0
        public ActionResult MspEveningCreate(MeetingMspEveningEdit meetingMspEveningEdit)
        {
            ModelState.Merge(meetingMspEveningEdit.Validate(Db));

            if (ModelState.IsValid)
            {
                MeetingCache.Insert(Db, MeetingType.MspEvening, UserId, meetingMspEveningEdit);
                return RedirectToAction("MspEveningIndex");
            }

            PopulateMainLeaderId(meetingMspEveningEdit.OrganizerId.GetValueOrDefault(UserId));
            PopulateSecondaryLeaderId(meetingMspEveningEdit.SecondaryLeaderId);

            return View(meetingMspEveningEdit);
        }
Exemplo n.º 2
0
        public ActionResult MspEveningEdit(MeetingMspEveningEdit meetingMspEveningEdit)
        {
            ModelState.Merge(meetingMspEveningEdit.Validate(Db));

            if (ModelState.IsValid)
            {
                Meeting meeting = meetingMspEveningEdit.GetModel(UserId);
                bool success = MeetingCache.Update(Db, ref meeting);
                if (!success)
                {
                    return RedirectToAccessDenied();
                }

                return RedirectToAction("MspEveningIndex");
            }

            PopulateMainLeaderId(UserId, meetingMspEveningEdit.MainLeaderId);
            PopulateSecondaryLeaderId(meetingMspEveningEdit.SecondaryLeaderId);
            PopulateSecondaryOrganizerId(meetingMspEveningEdit.MainLeaderId, meetingMspEveningEdit.SecondaryLeaderId, meetingMspEveningEdit.SecondaryOrganizerId);

            return View(meetingMspEveningEdit);
        }
Exemplo n.º 3
0
        public static MeetingMspEveningEdit GetModelView(Meeting meeting)
        {
            if (meeting == null || meeting.MeetingType != MeetingType.MspEvening)
                return null;

            var meetingMspEvening = new MeetingMspEveningEdit(meeting);
            return meetingMspEvening;
        }