Esempio n. 1
0
        public ActionResult SkoleniDavidaKotaskaCreate(MeetingSkoleniDavidaKotaskaEdit meetingSkoleniDavidaKotaskaEdit)
        {
            ModelState.Merge(meetingSkoleniDavidaKotaskaEdit.Validate(Db));

            if (ModelState.IsValid)
            {
                MeetingCache.Insert(Db, MeetingType.SkoleniDavidaKotaska, UserId, meetingSkoleniDavidaKotaskaEdit);
                return RedirectToAction("SkoleniDavidaKotaskaIndex");
            }

            PopulateMainLeaderId(meetingSkoleniDavidaKotaskaEdit.OrganizerId.GetValueOrDefault(UserId));
            PopulateSecondaryLeaderId(meetingSkoleniDavidaKotaskaEdit.SecondaryLeaderId);
            PopulateBankAccountId(BankAccountType.DavidKotasekTraining, UserId, meetingSkoleniDavidaKotaskaEdit.BankAccountId);
            PopulateSecondBankAccountId(BankAccountType.DavidKotasekTraining, UserId, meetingSkoleniDavidaKotaskaEdit.SecondBankAccountId);

            return View(meetingSkoleniDavidaKotaskaEdit);
        }
Esempio n. 2
0
        public ActionResult SkoleniDavidaKotaskaEdit(MeetingSkoleniDavidaKotaskaEdit meetingSkoleniDavidaKotaskaEdit)
        {
            ModelState.Merge(meetingSkoleniDavidaKotaskaEdit.Validate(Db));

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

                return RedirectToAction("SkoleniDavidaKotaskaIndex");
            }

            PopulateMainLeaderId(UserId, meetingSkoleniDavidaKotaskaEdit.MainLeaderId);
            PopulateSecondaryLeaderId(meetingSkoleniDavidaKotaskaEdit.SecondaryLeaderId);
            PopulateSecondaryOrganizerId(meetingSkoleniDavidaKotaskaEdit.MainLeaderId, meetingSkoleniDavidaKotaskaEdit.SecondaryLeaderId, meetingSkoleniDavidaKotaskaEdit.SecondaryOrganizerId);
            PopulateBankAccountId(BankAccountType.DavidKotasekTraining, UserId, meetingSkoleniDavidaKotaskaEdit.BankAccountId);
            PopulateSecondBankAccountId(BankAccountType.DavidKotasekTraining, UserId, meetingSkoleniDavidaKotaskaEdit.SecondBankAccountId);

            return View(meetingSkoleniDavidaKotaskaEdit);
        }
Esempio n. 3
0
        public static MeetingSkoleniDavidaKotaskaEdit GetModelView(Meeting meeting)
        {
            if (meeting == null || meeting.MeetingType != MeetingType.SkoleniDavidaKotaska)
                return null;

            var meetingViewSkoleniDavidaKotaska = new MeetingSkoleniDavidaKotaskaEdit(meeting);
            return meetingViewSkoleniDavidaKotaska;
        }