Esempio n. 1
0
        public ActionResult BusinessInfoCreate(MeetingBusinessInfoEdit meetingBusinessInfoEdit)
        {
            ModelState.Merge(meetingBusinessInfoEdit.Validate(Db));

            if (ModelState.IsValid)
            {
                MeetingCache.Insert(Db, MeetingType.Lgs, UserId, meetingBusinessInfoEdit);
                return RedirectToAction("BusinessInfoIndex");
            }

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

            return View(meetingBusinessInfoEdit);
        }
Esempio n. 2
0
        public ActionResult BusinessInfoEdit(MeetingBusinessInfoEdit meetingBusinessInfoEdit)
        {
            ModelState.Merge(meetingBusinessInfoEdit.Validate(Db));

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

                return RedirectToAction("BusinessInfoIndex");
            }

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

            return View(meetingBusinessInfoEdit);
        }