protected void btnUpdate_Click(object sender, EventArgs e) { try { AssignValue(true); businessLayer.Setting(userDetails); pnlSuccess.Visible = true; pnlErrorCredential.Visible = false; } catch (FormatException ex) { pnlErrorCredential.Visible = false; switch (Convert.ToInt32(ex.Message)) { case (int)ErrorStatus.SignupUsernameMissing: pnlErrorCredential.Visible = true; lblErrorDetails.Text = "Please enter email address"; break; case (int)ErrorStatus.SigupPasswordMissing: pnlErrorCredential.Visible = true; lblErrorDetails.Text = "Please enter password"; break; case (int)ErrorStatus.SignupRePasswordMissing: pnlErrorCredential.Visible = true; lblErrorDetails.Text = "Please re enter password"; break; case (int)ErrorStatus.SignupPasswordNotMatch: pnlErrorCredential.Visible = true; lblErrorDetails.Text = "Password does not match"; break; default: break; } } catch (Exception) { Response.Redirect(string.Format("Error.aspx?stat={0}", (int)ErrorStatus.UpdateUserDEtailsFail)); } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { AssignValue(true); BusinessLayer.Setting(userDetails); pnlErrorCompany.Visible = false; pnlErrorContact.Visible = false; pnlErrorDetails.Visible = false; pnlSuccess.Visible = true; } catch (FormatException ex) { pnlErrorCompany.Visible = false; pnlErrorContact.Visible = false; pnlErrorDetails.Visible = false; switch (Convert.ToInt32(ex.Message)) { case (int)ErrorStatus.SignupNameMissing: pnlErrorDetails.Visible = true; lblErrorDetails.Text = "Please enter owner name"; break; case (int)ErrorStatus.SignupSurnameMissing: pnlErrorDetails.Visible = true; lblErrorDetails.Text = "Please enter owner surname"; break; case (int)ErrorStatus.SignupCompanyMissing: pnlErrorCompany.Visible = true; lblErrorCompany.Text = "Please enter company name"; break; default: break; } } catch (Exception) { Response.Redirect(string.Format("Error.aspx?stat={0}", (int)ErrorStatus.UpdateUserDEtailsFail)); } }