Пример #1
0
        public ActionResult WebinarCreate(MeetingWebinarEdit meetingWebinarEdit)
        {
            ModelState.Merge(meetingWebinarEdit.Validate(Db));

            if (ModelState.IsValid)
            {
                MeetingCache.Insert(Db, MeetingType.Webinar, UserId, meetingWebinarEdit);
                return RedirectToAction("WebinarIndex");
            }

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

            return View(meetingWebinarEdit);
        }
Пример #2
0
        public ActionResult WebinarEdit(MeetingWebinarEdit meetingWebinarEdit)
        {
            ModelState.Merge(meetingWebinarEdit.Validate(Db));

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

                return RedirectToAction("WebinarIndex");
            }

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

            return View(meetingWebinarEdit);
        }
Пример #3
0
        public static MeetingWebinarEdit GetModelView(Meeting meeting)
        {
            if (meeting == null || meeting.MeetingType != MeetingType.Webinar)
                return null;

            var meetingWebinar = new MeetingWebinarEdit(meeting);
            return meetingWebinar;
        }