コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    lblUserName.Text     = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_NAME));
                    lblUserBranchNo.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_BRNO));
                    lblUserLabel.Text    = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_LEVEL));

                    string UnitAddress1 = string.Empty;
                    string UnitAddress2 = string.Empty;
                    string UnitAddress3 = string.Empty;

                    string UnitNameB     = string.Empty;
                    string UnitAddress1B = string.Empty;


                    var p = A2ZERPSYSPRMDTO.GetParameterValue();

                    lblUnitFlag.Text = Converter.GetString(p.PrmUnitFlag);

                    if (p.PrmUnitFlag == 1 || lblUserLabel.Text == "40")
                    {
                        lblUserBranchNo.Text = Converter.GetString(p.PrmUnitNo);
                        lblCompanyName.Text  = p.PrmUnitName;
                        UnitAddress1         = p.PrmUnitAdd1;

                        UnitNameB     = p.PrmUnitNameB;
                        UnitAddress1B = p.PrmUnitAdd1B;
                    }
                    else
                    {
                        A2ZERPBRANCHDTO getDTO     = new A2ZERPBRANCHDTO();
                        int             userbranch = Converter.GetInteger(lblUserBranchNo.Text);
                        getDTO = (A2ZERPBRANCHDTO.GetInformation(userbranch));

                        if (getDTO.BranchNo > 0)
                        {
                            lblCompanyName.Text = Converter.GetString(getDTO.BranchName);
                            UnitAddress1        = Converter.GetString(getDTO.BranchAdd1);

                            UnitNameB     = Converter.GetString(getDTO.BranchNameB);
                            UnitAddress1B = Converter.GetString(getDTO.BranchAdd1B);
                        }
                    }

                    SessionStore.SaveToCustomStore(Params.BRNO, lblUserBranchNo.Text);
                    SessionStore.SaveToCustomStore(Params.COMPANY_NAME, lblCompanyName.Text);
                    SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS, UnitAddress1);
                    SessionStore.SaveToCustomStore(Params.SYS_UNIT_FLAG, lblUnitFlag.Text);

                    SessionStore.SaveToCustomStore(Params.COMPANY_NAME_B, UnitNameB);
                    SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS_B, UnitAddress1B);

                    GetMenuData();

                    A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue();
                    lblProcessDate.Text = Converter.GetString(dto.ProcessDate.ToLongDateString());

                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 10)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Input";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 20)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Checked and Verify";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 30)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Approved";
                    //}

                    //hdnCashCode.Value = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_GLCASHCODE));
                    //string qry = "SELECT GLAccDesc FROM A2ZCGLMST where GLAccNo='" + hdnCashCode.Value + "'";
                    //DataTable dt = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZGLCUBS");
                    //if (dt.Rows.Count > 0)
                    //{
                    //    lblBoothNo.Text = hdnCashCode.Value;
                    //    lblBoothName.Text = Converter.GetString(dt.Rows[0]["GLAccDesc"]);
                    //}
                }
                else
                {
                    this.Page.MaintainScrollPositionOnPostBack = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    lblUserName.Text     = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_NAME));
                    lblUserBranchNo.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_BRNO));
                    lblUserLabel.Text    = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_LEVEL));

                    string UnitAddress1 = string.Empty;
                    string UnitAddress2 = string.Empty;
                    string UnitAddress3 = string.Empty;

                    string UnitNameB     = string.Empty;
                    string UnitAddress1B = string.Empty;

                    var p = A2ZERPSYSPRMDTO.GetParameterValue();

                    if (p.PrmUnitFlag == 1 || lblUserLabel.Text == "40")
                    {
                        lblUserBranchNo.Text = Converter.GetString(p.PrmUnitNo);
                        lblCompanyName.Text  = p.PrmUnitName;
                        UnitAddress1         = p.PrmUnitAdd1;
                        UnitAddress2         = p.PrmUnitAdd2;
                        UnitAddress3         = p.PrmUnitAdd3;

                        UnitNameB     = p.PrmUnitNameB;
                        UnitAddress1B = p.PrmUnitAdd1B;
                    }
                    else
                    {
                        A2ZERPBRANCHDTO getDTO     = new A2ZERPBRANCHDTO();
                        int             userbranch = Converter.GetInteger(lblUserBranchNo.Text);
                        getDTO = (A2ZERPBRANCHDTO.GetInformation(userbranch));

                        if (getDTO.BranchNo > 0)
                        {
                            lblCompanyName.Text = Converter.GetString(getDTO.BranchName);
                            UnitAddress1        = Converter.GetString(getDTO.BranchAdd1);

                            UnitNameB     = Converter.GetString(getDTO.BranchNameB);
                            UnitAddress1B = Converter.GetString(getDTO.BranchAdd1B);
                        }
                    }


                    SessionStore.SaveToCustomStore(Params.BRNO, lblUserBranchNo.Text);
                    SessionStore.SaveToCustomStore(Params.COMPANY_NAME, lblCompanyName.Text);
                    SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS, UnitAddress1);

                    SessionStore.SaveToCustomStore(Params.COMPANY_NAME_B, UnitNameB);
                    SessionStore.SaveToCustomStore(Params.BRANCH_ADDRESS_B, UnitAddress1B);



                    //    GetMenuData();


                    string Rdate = (string)Session["date"];

                    if (Rdate == null || Rdate == "")
                    {
                        A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue();
                        lblProcessDate.Text = Converter.GetString(dto.ProcessDate.ToLongDateString());
                    }
                    else
                    {
                        lblProcessDate.Text = Rdate;
                    }


                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 10)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Input";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 20)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Checked and Verify";
                    //}
                    //if (DataAccessLayer.Utility.Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_PERMISSION)) == 30)
                    //{
                    //    lblUserPermission.Text = "Permission :" + "Approved";
                    //}
                }
                else
                {
                    //Response.Cache.SetNoStore();
                    //Response.Cache.AppendCacheExtension("no-cache");
                    //Response.Expires = 0;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #3
0
        protected int CheckUserId()
        {
            // For Return Value of CheckUserId()
            //---------------------------------
            // 0 = Id is Available
            // 1 = ID not in Table
            // 2 = Please Change Password - New Id was created
            // 3 = Id was not Initialize - Abnormal Logout
            //---------------------------------
            // End of For Return Value of CheckUserId()

            try
            {
                A2ZSYSIDSDTO idsDto = A2ZSYSIDSDTO.GetUserInformation(Converter.GetInteger(txtUserId.Text), "A2ZACWMS");

                lblhdnfldVariable.Text = idsDto.IdsName;

                if (idsDto.IdsNo == 0)
                {
                    //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('ID Not Found');", true);

                    txtUserId.Text = string.Empty;
                    txtUserId.Focus();

                    return(1);
                }

                //string sqlQuery = @"SELECT * FROM dbo.A2ZSYSMODULECTRL  WHERE IDSNO='" + txtUserId.Text + "' AND ModuleNo = 3";

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

                //if (dt.Rows.Count > 0)
                //{

                lblOrgPassH.Text = idsDto.IdsPass;

                lblCashCode.Text = Converter.GetString(idsDto.GLCashCode);

                lblUserBranchNo.Text = Converter.GetString(idsDto.UserBranchNo);

                //lblMobileFlag.Text = Converter.GetString(idsDto.IdsMobile);



                A2ZERPBRANCHDTO getDTO     = new A2ZERPBRANCHDTO();
                int             userbranch = Converter.GetInteger(lblUserBranchNo.Text);
                getDTO = (A2ZERPBRANCHDTO.GetInformation(userbranch));

                if (getDTO.BranchNo > 0)
                {
                    lblCompanyName.Text = Converter.GetString(getDTO.BranchName);
                    UnitAddress1.Text   = Converter.GetString(getDTO.BranchAdd1);
                    UnitNameB.Text      = Converter.GetString(getDTO.BranchNameB);
                    UnitAddress1B.Text  = Converter.GetString(getDTO.BranchAdd1B);
                }

                txtPassword.Focus();

                if (idsDto.IdsPass == "XXXXXXXX")
                {
                    return(2);
                }

                return(0);
                //}
                //else
                //{
                //    txtUserId.Text = string.Empty;
                //    txtUserId.Focus();

                //    return 1;
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }