protected void BtnSubmitClick(object sender, EventArgs e) { try { if (!ValidatePage()) { return; } switch (int.Parse(btnSubmit.CommandArgument)) { case 1: if (!AddBeneficiary()) { return; } break; case 2: if (!UpdateBeneficiary()) { return; } break; default: ConfirmAlertBox1.ShowMessage("Invalid process call!", ConfirmAlertBox.PopupMessageType.Error); mpeSelectDateRangePopup.Show(); break; } if (!LoadBeneficiaries()) { return; } ConfirmAlertBox1.ShowSuccessAlert2("The Beneficiary information was processed successfully."); } catch (Exception ex) { ConfirmAlertBox1.ShowMessage("An unknown error was encountered. Please contact the Administrator.", ConfirmAlertBox.PopupMessageType.Error); ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message); } }