コード例 #1
0
        protected void btnReset_Click(object sender, EventArgs e)
        {
            try
            {
                int RowEffected = 0;

                A2ZSYSIDSDTO dto = new A2ZSYSIDSDTO();

                AtoZUtility a2zUtility = new AtoZUtility();
                //string newPass = a2zUtility.GeneratePassword("XXXXXXXX", 0);
                string newPass = "******";

                dto.IdsNo = Converter.GetInteger(txtIdsNo.Text);

                dto.IdsPass = newPass;

                RowEffected = A2ZSYSIDSDTO.UpdateResetPassword(dto);

                if (RowEffected > 0)
                {
                    UpdateMSG();
                    //ShowMessage("Data has been saved successfully.", Color.Green);
                    ClearInformation();
                    txtIdsNo.Focus();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.Add Problem');</script>");
                //throw ex;
            }
        }
コード例 #2
0
        protected void btnBooth_Click(object sender, EventArgs e)
        {
            string    qry    = "SELECT IdsNo,ModuleNo FROM A2ZSYSMODULECTRL WHERE ModuleNo=6";
            DataTable dt     = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZHKGMS");
            int       totrec = dt.Rows.Count;

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    var idsno    = dr["IdsNo"].ToString();
                    var moduleno = dr["ModuleNo"].ToString();


                    int RowEffected = 0;

                    A2ZSYSIDSDTO dto = new A2ZSYSIDSDTO();

                    AtoZUtility a2zUtility = new AtoZUtility();
                    //string newPass = a2zUtility.GeneratePassword("XXXXXXXX", 0);
                    string newPass = "******";

                    dto.IdsNo = Converter.GetInteger(idsno);

                    dto.IdsPass = newPass;

                    RowEffected = A2ZSYSIDSDTO.UpdateResetPassword(dto);
                }
                ClearInformation();
                Response.Redirect("A2ZERPModule.aspx", false);
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
ファイル: A2ZLogin.aspx.cs プロジェクト: rahee-aiub/OMS
        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;
            }
        }
コード例 #5
0
ファイル: A2ZStartUp.aspx.cs プロジェクト: rahee-aiub/MCUS
        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>");
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DivFromCashCode.Visible = false;



                lblLastProcDate.ForeColor = Color.Black;
                lblNewProcDt.ForeColor    = Color.Black;
                lblSOD.ForeColor          = Color.Black;

                DivChangePassword.Visible = false;
                txtIdNo.Focus();
                btChangePassword.Visible = false;
                DivLogin.Visible         = false;

                DivDetails.Visible = false;

                if (IsPostBack)
                {
                    lblPassword.Text = string.Empty;
                    lblold.Text      = string.Empty;
                }
                else
                {
                    lblUserId.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_ID));



                    DivLogin.Visible          = false;
                    DivChangePassword.Visible = false;
                    btnLogin.Enabled          = true;
                    DivLogin.Visible          = false;
                    Session["dummy"]          = "dummy";

                    AtoZUtility a2zUtility = new AtoZUtility();
                    string      notifyMsg  = string.Empty;
                    //OPEN

                    //if (a2zUtility.CheckAtoZLicense() == 1)
                    //{
                    //    notifyMsg = "?txtOne=" + "System Parameter Not Found" + "&txtTwo=" + "Contact AtoZ Computer Services or" +
                    //                       "&txtThree=" + "Contact Your Super User" + "&PreviousMenu=A2ZERP.aspx";
                    //    Server.Transfer("Notify.aspx" + notifyMsg);
                    //}
                    //if (a2zUtility.CheckAtoZLicense() == 2)
                    //{
                    //    notifyMsg = "?txtOne=" + "AtoZ License is Mismatch" + "&txtTwo=" + "Contact rptINVPPICRequirementMaterial Computer Services or" +
                    //                       "&txtThree=" + "Contact Your Super User" + "&PreviousMenu=A2ZERP.aspx";
                    //    Server.Transfer("Notify.aspx" + notifyMsg);
                    //}



                    //int cr = a2zUtility.CheckClientRegistry();
                    ////if (cr == 9)
                    ////{
                    ////    notifyMsg = "?txtOne=" + "Client Registry Missing" + "&txtTwo=" + "Contact AtoZ Computer Services or" +
                    ////                       "&txtThree=" + "Contact Your Super User" + "&PreviousMenu=ClientRegistry.aspx";
                    ////    Server.Transfer("Notify.aspx" + notifyMsg);
                    ////}
                    //if (cr == 1)
                    //{
                    //    notifyMsg = "?txtOne=" + "Mismatch Client Registry" + "&txtTwo=" + "Contact AtoZ Computer Services or" +
                    //                       "&txtThree=" + "Contact Your Super User" + "&PreviousMenu=Notify.aspx";
                    //    Server.Transfer("Notify.aspx" + notifyMsg);
                    //}

                    btnCustomerService.Visible = false;

                    //btnGl.Visible = false;

                    btnHk.Visible = false;

                    btnHr.Visible = false;

                    btnInv.Visible = false;

                    btnBooth.Visible = false;

                    //btnOffBooth.Visible = false;



                    A2ZERPSYSPRMDTO dto = A2ZERPSYSPRMDTO.GetParameterValue();
                    //lblCompany.Text = dto.PrmUnitName;

                    string a = (string)Session["IdsNo"];

                    txtIdNo.Text = a;
                    CheckUserId();

                    string sqlQuery = @"SELECT * FROM dbo.A2ZSYSMODULECTRL  WHERE IDSNO='" + txtIdNo.Text + "'";

                    DataTable dt = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(sqlQuery, "A2ZHKOMS");

                    if (dt.Rows.Count > 0)
                    {
                        lblNoRec.Text = Converter.GetString(dt.Rows.Count);


                        DataView view = new DataView(dt);

                        foreach (DataRowView row in view)
                        {
                            int moduleNo = Converter.GetInteger(row["ModuleNo"].ToString());

                            if (dt.Rows.Count == 1)
                            {
                                string LogOut = (string)Session["LogOutFlag"];
                                if (LogOut == "1")
                                {
                                    Session["LogOutFlag"] = "";
                                    Response.Redirect("A2ZLogin.aspx", false);
                                    return;
                                }
                                else
                                {
                                    hdnModule.Value = Converter.GetString(moduleNo);
                                    SODProcessFunction();
                                    if (lblMsgFlag.Text == "1")
                                    {
                                        ShowMessage();
                                    }
                                    else if (lblMsgFlag.Text == "2")
                                    {
                                        return;
                                    }

                                    if (moduleNo == 1)
                                    {
                                        lblSwFlag.Text = "0";

                                        if (lblSwFlag.Text == "0")
                                        {
                                            //SelectFromCashCodeSw();
                                        }
                                        else
                                        {
                                            CSFunc();
                                            return;
                                        }
                                    }
                                    else
                                    if (moduleNo == 2)
                                    {
                                        HKFunc();
                                        return;
                                    }
                                    else
                                    if (moduleNo == 3)
                                    {
                                        lblSwFlag.Text = "0";

                                        if (lblSwFlag.Text == "0")
                                        {
                                            //SelectFromCashCodeSw();
                                        }
                                        else
                                        {
                                            BoothFunc();
                                            return;
                                        }
                                    }
                                }
                            }

                            switch (moduleNo)
                            {
                            case 1:
                                btnCustomerService.Visible = true;
                                break;

                            case 2:
                                btnHk.Visible = true;
                                break;

                            case 3:
                                btnBooth.Visible = true;
                                break;

                            //case 3:
                            //    btnHr.Visible = true;
                            //    break;

                            //case 4:
                            //    btnInv.Visible = true;
                            //    break;

                            default:

                                break;
                            }
                        }
                    }
                    else
                    {
                        String csname1         = "PopupScript";
                        Type   cstype          = GetType();
                        ClientScriptManager cs = Page.ClientScript;

                        if (!cs.IsStartupScriptRegistered(cstype, csname1))
                        {
                            String cstext1 = "alert('This User Have No Permission.');";
                            cs.RegisterStartupScript(cstype, csname1, cstext1, true);

                            txtIdNo.Text     = string.Empty;
                            txtPassword.Text = string.Empty;
                        }
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #7
0
ファイル: A2ZLogin.aspx.cs プロジェクト: rahee-aiub/OMS
        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>");
            }
        }
コード例 #8
0
        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;
            }
        }