protected void btnPasswordChange_Click(object sender, EventArgs e) { try { if (txtNewPassword.Text == string.Empty) { txtNewPassword.Focus(); MSG4(); return; } //AtoZUtility a2zUtility = new AtoZUtility(); //string orgPass = a2zUtility.GeneratePassword(OrgPass.Value, 1); AtoZUtility a2zUtility = new AtoZUtility(); string orgPass = a2zUtility.GeneratePassword(lblOrgPassH.Text.Replace(" ", ""), 1); if (orgPass != txtOldPassword.Text) { txtOldPassword.Focus(); MSG1(); } else { if (txtNewPassword.Text != this.txtConfirmPassword.Text) { MSG2(); } else { string newPass = a2zUtility.GeneratePassword(txtNewPassword.Text, 0); A2ZSYSIDSDTO idsDto = new A2ZSYSIDSDTO(); idsDto.IdsNo = Converter.GetSmallInteger(txtBoothUserId.Text); idsDto.IdsPass = newPass; int rowEffiect = A2ZSYSIDSDTO.UpdateNewPassword(idsDto); if (rowEffiect > 0) { MSG3(); txtBoothUserId.Text = string.Empty; txtUserId.Text = string.Empty; txtUserId.Focus(); divMain.Visible = true; divChangePass.Visible = false; } } } } catch (Exception ex) { throw ex; } }
protected void btnPasswordChange_Click(object sender, EventArgs e) { try { AtoZUtility a2zUtility = new AtoZUtility(); string orgPass = a2zUtility.GeneratePassword(OrgPass.Value, 1); if (orgPass != txtOldPassword.Text) { MSG1(); //ShowMessage("Old Password did not match.", Color.Red); // DivLogin.Visible = false; } else { if (txtNewPassword.Text != this.txtConfirmPassword.Text) { MSG2(); //ShowMessage("New Password did not match.", Color.Red); // DivLogin.Visible = false; } else { string newPass = a2zUtility.GeneratePassword(txtNewPassword.Text, 0); A2ZSYSIDSDTO idsDto = new A2ZSYSIDSDTO(); idsDto.IdsNo = Converter.GetSmallInteger(txtIdNo.Text); idsDto.IdsPass = newPass; int rowEffiect = A2ZSYSIDSDTO.UpdateNewPassword(idsDto); if (rowEffiect > 0) { MSG3(); //ShowMessage("Data saved successfully.", Color.Green); main.Visible = true; Pass.Visible = false; } } } txtIdNo.Text = string.Empty; //lblWelcome.Text = string.Empty; } catch (Exception ex) { throw ex; } }
protected void btnLogin_Click(object sender, EventArgs e) { try { if (txtPassword.Text == string.Empty) { String csname1 = "PopupScript"; Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; if (!cs.IsStartupScriptRegistered(cstype, csname1)) { String cstext1 = "alert('Password shoud be filled up .');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true); txtPassword.Focus(); } return; } AtoZUtility a2zUtility = new AtoZUtility(); string orgPass = a2zUtility.GeneratePassword(OrgPass.Value, 1); if (orgPass != txtPassword.Text) { String csname1 = "PopupScript"; Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; if (!cs.IsStartupScriptRegistered(cstype, csname1)) { String cstext1 = "alert('Wrong Password');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true); txtPassword.Focus(); } return; } else { //A2ZERPSYSPRMDTO prmobj = A2ZERPSYSPRMDTO.GetParameterValue(); //if (prmobj.PrmEODStat == 0) //{ SessionStore.SaveToCustomStore(Params.SYS_USER_ID, txtIdNo.Text); Session["IdsNo"] = txtIdNo.Text; Session["LogOutFlag"] = ""; Response.Redirect("A2ZERP.aspx", false); //} //else //{ // A2ZSYSIDSDTO sysobj = A2ZSYSIDSDTO.GetUserInformation(Converter.GetInteger(txtIdNo.Text), "A2ZHKMCUS"); // if (sysobj.SODflag == false) // { // String csname1 = "PopupScript"; // Type cstype = GetType(); // ClientScriptManager cs = Page.ClientScript; // if (!cs.IsStartupScriptRegistered(cstype, csname1)) // { // String cstext1 = "alert('Access Denied START OF DAY NOT DONE');"; // cs.RegisterStartupScript(cstype, csname1, cstext1, true); // } // return; // } // else // { // ShowMessage(); // //SessionStore.SaveToCustomStore(Params.SYS_USER_ID, txtIdNo.Text); // //Session["IdsNo"] = txtIdNo.Text; // //Response.Redirect("A2ZERP.aspx", false); // } //} } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.btnLogin_Click Problem');</script>"); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { //========== Check No. Of User =========================== AtoZUtility installData = new AtoZUtility(); //if (installData.CheckAtoZUserLicense(1) != 0) 10/19/2017 //{ // Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('Total No. of User - Overflow');</script>"); // return; //} //========== End of Check No. Of User ==================== //========== Check Company Name =========================== //if (installData.CheckAtoZUserLicense(3) != 0) 10/19/2017 //{ // Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('Improper Installation - Check Company Name');</script>"); // return; //} //========== End of Check No. Of User ==================== if (txtPassword.Text == string.Empty) { String csname1 = "PopupScript"; Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; //if (!cs.IsStartupScriptRegistered(cstype, csname1)) //{ // String cstext1 = "alert('Password shoud be filled up .');"; // cs.RegisterStartupScript(cstype, csname1, cstext1, true); txtPassword.Focus(); //} return; } //khaite tohobe AtoZUtility a2zUtility = new AtoZUtility(); string orgPass = a2zUtility.GeneratePassword(OrgPass.Value, 1); if (orgPass != txtPassword.Text) { String csname1 = "PopupScript"; Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; if (!cs.IsStartupScriptRegistered(cstype, csname1)) { String cstext1 = "alert('Wrong Password');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true); txtPassword.Focus(); } return; } else { //A2ZERPSYSPRMDTO prmobj = A2ZERPSYSPRMDTO.GetParameterValue(); //if (prmobj.PrmEODStat == 0) //{ SessionStore.SaveToCustomStore(Params.SYS_USER_ID, txtIdNo.Text); Session["IdsNo"] = txtIdNo.Text; Session["LogOutFlag"] = ""; //DataAccessLayer.DTO.HouseKeeping.A2ZERPSYSPRMDTO.UpdateNoOfUser(1); 10/19/2017 Response.Redirect("A2ZERP.aspx", false); //} //else //{ // A2ZSYSIDSDTO sysobj = A2ZSYSIDSDTO.GetUserInformation(Converter.GetInteger(txtIdNo.Text), "A2ZHKMCUS"); // if (sysobj.SODflag == false) // { // String csname1 = "PopupScript"; // Type cstype = GetType(); // ClientScriptManager cs = Page.ClientScript; // if (!cs.IsStartupScriptRegistered(cstype, csname1)) // { // String cstext1 = "alert('Access Denied START OF DAY NOT DONE');"; // cs.RegisterStartupScript(cstype, csname1, cstext1, true); // } // return; // } // else // { // ShowMessage(); // //SessionStore.SaveToCustomStore(Params.SYS_USER_ID, txtIdNo.Text); // //Session["IdsNo"] = txtIdNo.Text; // //Response.Redirect("A2ZERP.aspx", false); // } //} } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.btnLogin_Click Problem');</script>"); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { int checkUser = CheckUserId(); if (checkUser == 0) { btnLogin.Enabled = true; } else { string msg = string.Empty; switch (checkUser) { case 1: DisplayMsg.Text = "ID Not Found"; DisplayMassage(); txtUserId.Text = string.Empty; txtUserId.Focus(); return; case 2: DisplayMsg.Text = "Change Password - New Id was Created"; DisplayMassage(); txtUserId.Text = string.Empty; txtUserId.Focus(); return; case 3: DisplayMsg.Text = "User Id is using by other client or Abnormal Logout"; DisplayMassage(); txtUserId.Text = string.Empty; txtUserId.Focus(); return; default: DisplayMsg.Text = "Check User Id Information"; DisplayMassage(); txtUserId.Text = string.Empty; txtUserId.Focus(); return; } } //--------------------------------------------------------------------------------------------------- if (txtPassword.Text == string.Empty) { txtPassword.Focus(); DisplayMsg.Text = "Password shoud be filled up."; DisplayMassage(); return; } AtoZUtility a2zUtility = new AtoZUtility(); string orgPass = a2zUtility.GeneratePassword(lblOrgPassH.Text.Replace(" ", ""), 1); string orgPass2 = a2zUtility.GeneratePassword(hidTripDetails.Value, 1); if (orgPass != txtPassword.Text) { DisplayMsg.Text = "Wrong Password"; DisplayMassage(); txtPassword.Focus(); return; } //if (lblMobileFlag.Text == "False") //{ // DisplayMsg.Text = "Un Authorized User Id."; // DisplayMassage(); // txtUserId.Text = string.Empty; // txtPassword.Text = string.Empty; // txtUserId.Focus(); // return; //} //------------------------------------------------------------------ A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue(); lblProcessDate.Text = Converter.GetString(dto.ProcessDate.ToLongDateString()); SessionStore.SaveToCustomStore(Params.BRNO, lblUserBranchNo.Text); SessionStore.SaveToCustomStore(Params.COMPANY_NAME, lblCompanyName.Text); SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS, UnitAddress1.Text); SessionStore.SaveToCustomStore(Params.COMPANY_NAME_B, UnitNameB.Text); SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS_B, UnitAddress1B.Text); SessionStore.SaveToCustomStore(Params.SYS_USER_GLCASHCODE, lblCashCode.Text); SessionStore.SaveToCustomStore(Params.SYS_USER_BRNO, lblUserBranchNo.Text); SessionStore.SaveToCustomStore(Params.SYS_USER_ID, txtUserId.Text); SessionStore.SaveToCustomStore(Params.SYS_USER_NAME, lblhdnfldVariable.Text); //-------------------------------------------------------------------- DataAccessLayer.DTO.A2ZSYSIDSDTO.UpdateUserCSLoginFlag(Converter.GetInteger(txtUserId.Text), 1); Response.Redirect("A2ZERP.aspx", false); } catch (Exception ex) { throw ex; } }