protected void ButtonEditOffice_OnClick(object sender, EventArgs e) { switch (EditOfficeReloading.Value) { case "reloading": { EditOfficeReloading.Value = string.Empty; _EditOfficeDialogInfo.LoadControls(); FeedbackEditOffice.AddInfo("Office information loaded."); } break; case "": { // normal update _EditOfficeDialogInfo.ClearValidationErrors(); if (AdminPageLevel != AdminPageLevel.State) { OfficeToEdit.Value = Offices.ActualizeOffice(GetOfficeKeyToEdit(), CountyCode, LocalCode); } if (_EditOfficeDialogInfo.Update(FeedbackEditOffice) == 0) { LoadOfficeControl(OfficeToEdit.Value); } } break; default: throw new VoteException("Unknown reloading option"); } }
protected void ButtonEditOffice_OnClick(object sender, EventArgs e) { switch (EditOfficeReloading.Value) { case "reloading": { EditOfficeReloading.Value = Empty; if (AdminPageLevel != AdminPageLevel.State) { OfficeToEdit.Value = Offices.ActualizeOffice(GetOfficeKeyToEdit(), CountyCode, LocalKey); } _EditOfficeDialogInfo.LoadControls(); var adRates = Offices.GetDefaultAdRates(GetOfficeKeyToEdit()); PrimaryAdRateDefault.InnerText = adRates.PrimaryAdRate.ToString(CultureInfo.InvariantCulture); GeneralAdRateDefault.InnerText = adRates.GeneralAdRate.ToString(CultureInfo.InvariantCulture); FeedbackEditOffice.AddInfo("Office information loaded."); } break; case "": { // normal update _EditOfficeDialogInfo.ClearValidationErrors(); if (AdminPageLevel != AdminPageLevel.State) { OfficeToEdit.Value = Offices.ActualizeOffice(GetOfficeKeyToEdit(), CountyCode, LocalKey); } if (_EditOfficeDialogInfo.Update(FeedbackEditOffice) == 0) { LoadOfficeControl(OfficeToEdit.Value); } } break; default: throw new VoteException($"Unknown reloading option: '{EditOfficeReloading.Value}'"); } }