protected void ButtonReset_Click(object sender, EventArgs e) { try { string userName = TextBoxResetUserId.Text.Trim(); if (!string.IsNullOrEmpty(userName)) { bool isUserExixst = AppAuthentication.IsUserExist(userName); if (isUserExixst) { GenerateUserPassword(userName); } else { string serverMessage = "User Name not found"; string LabelTextDialog = Localization.GetLabelText("", Session["selectedCulture"] as string, "WARNING"); ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jNotify('" + serverMessage + "');", true); } } else { string serverMessage = "User Name cannot be blank"; string LabelTextDialog = Localization.GetLabelText("", Session["selectedCulture"] as string, "WARNING"); ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jNotify('" + serverMessage + "');", true); } } catch { string serverMessage = "Failed to reset password"; string LabelTextDialog = Localization.GetLabelText("", Session["selectedCulture"] as string, "ERROR"); ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "jError('" + serverMessage + "');", true); } }
protected void ButtonReset_Click(object sender, EventArgs e) { try { string userName = TextBoxUserId.Text.Trim(); if (!string.IsNullOrEmpty(userName)) { bool isUserExixst = AppAuthentication.IsUserExist(userName); if (isUserExixst) { GenerateUserPassword(userName); } else { divStaus.Visible = true; LabelStatus.ForeColor = Color.Red; LabelStatus.Text = "User Name not found"; return; } } else { divStaus.Visible = true; LabelStatus.ForeColor = Color.Red; LabelStatus.Text = "User Name cannot be blank"; return; } } catch { divStaus.Visible = true; LabelStatus.ForeColor = Color.Red; LabelStatus.Text = "Failed to reset password"; return; } }