Exemple #1
0
        protected void ButtonEditVolunteer_OnClick(object sender, EventArgs e)
        {
            switch (EditVolunteerReloading.Value)
            {
            case "reloading":
            {
                EditVolunteerReloading.Value = Empty;
                RefreshReport.Value          = "N";
                var stateCode = VolunteersView.GetStateCode(GetVolunteerToEdit()).SafeString();
                StateCache.Populate(ControlEditVolunteerStateCode, stateCode);
                Parties.PopulateNationalParties(ControlEditVolunteerPartyCode, true, null, true,
                                                null);
                //LoadEditParties(stateCode);
                _EditVolunteerDialogInfo.LoadControls();
                //LoadEditUndos();
                FeedbackEditVolunteer.AddInfo("Volunteer information loaded.");
            }
            break;

            case "":
            {
                // normal update
                _EditVolunteerDialogInfo.ClearValidationErrors();
                _EditVolunteerDialogInfo.Update(FeedbackEditVolunteer);
                var emailItem = _EditVolunteerDialogInfo.FirstOrDefault(i => i.Column == "Email");
                if (!emailItem?.DataControl.HasClass("error") == true)
                {
                    VolunteerToEdit.Value = DataItemBase.GetCurrentValue(emailItem);
                }
                RefreshReport.Value = "Y";
                //LoadEditUndos();
            }
            break;

            default:
                throw new VoteException(
                          $"Unknown reloading option: '{EditVolunteerReloading.Value}'");
            }
        }