Beispiel #1
0
    //重新插入数据
    public void btnOK_Click(object sender, DirectEventArgs e)
    {
        //if (FSecurityHelper.CurrentUserDataGET()[8] != "G01")
        //    return;
        //if (FSecurityHelper.CurrentUserDataGET()[29] == "Y" && JSON.Deserialize(e.ExtraParams["IsLockStat"]).ToString() == "1")
        if (((FSecurityHelper.CurrentUserDataGET()[29].ToUpper() == "Y" && JSON.Deserialize(e.ExtraParams["IsLockStat"]).ToString() == "1") || (FSecurityHelper.CurrentUserDataGET()[29].ToUpper() == "N" && JSON.Deserialize(e.ExtraParams["CompanyID"]).ToString().ToUpper() != FSecurityHelper.CurrentUserDataGET()[32].ToUpper())) && FSecurityHelper.CurrentUserDataGET()[28].ToUpper() != "IT")
        {
            //对不起,登录失败!当前分站系统用户已经锁定,无法登录到总站系统,请核对后重新登录!
            //Sorry, logon failure! The current station system users have locked and unable to log on to the terminal system, please check log in again!
            Ext.Net.X.MessageBox.Alert("Status", "Sorry, the operation failed.", new JFunction {
                Handler = "location.reload();"
            }).Show();
            return;
        }

        this.ReturnValue = FSecurityHelper.CurrentUserDataSET(new string[] {
            FSecurityHelper.CurrentUserDataGET()[0]                        // 0
            , FSecurityHelper.CurrentUserDataGET()[1]                      // 1
            , FSecurityHelper.CurrentUserDataGET()[2]                      // 2
            , FSecurityHelper.CurrentUserDataGET()[3]                      // 3

            , JSON.Deserialize(e.ExtraParams["CompanyID"]).ToString()      // 4
            , JSON.Deserialize(e.ExtraParams["NameCHS"]).ToString()        // 5
            , JSON.Deserialize(e.ExtraParams["NAMEENG"]).ToString()        // 6
            , JSON.Deserialize(e.ExtraParams["District"]).ToString()       // 7

            , FSecurityHelper.CurrentUserDataGET()[8]                      // 8
            , FSecurityHelper.CurrentUserDataGET()[9]                      // 9
            , FSecurityHelper.CurrentUserDataGET()[10]                     // 10

            , FSecurityHelper.CurrentUserDataGET()[11]                     // 11
            , JSON.Deserialize(e.ExtraParams["Stat"]).ToString()           // 12
            , FSecurityHelper.CurrentUserDataGET()[13]                     // 13
            , ""                                                           //FSecurityHelper.CurrentUserDataGET()[14] // 14
            , FSecurityHelper.CurrentUserDataGET()[15]                     //15

            , JSON.Deserialize(e.ExtraParams["Tel"]).ToString()            //16
            , JSON.Deserialize(e.ExtraParams["Fax"]).ToString()            //17
            , JSON.Deserialize(e.ExtraParams["Email"]).ToString()          //18
            , JSON.Deserialize(e.ExtraParams["DIMUnit"]).ToString()        //19          ----AE
            , JSON.Deserialize(e.ExtraParams["DIMFloat"]).ToString()       //20         ----AE
            , JSON.Deserialize(e.ExtraParams["AddressCHS"]).ToString()     //21
            , JSON.Deserialize(e.ExtraParams["AddressENG"]).ToString()     //22
            , JSON.Deserialize(e.ExtraParams["DIMRate"]).ToString()        //23          ----AE
            , JSON.Deserialize(e.ExtraParams["AWBArrange"]).ToString()     //24       ----AE 用  默认值
            , JSON.Deserialize(e.ExtraParams["ChinaMode"]).ToString()      //25       是否中国大陆使用
            , JSON.Deserialize(e.ExtraParams["ChineseInvoice"]).ToString() //26       Chinese Invoice
            , FSecurityHelper.CurrentUserDataGET()[27]                     //27
            , FSecurityHelper.CurrentUserDataGET()[28]                     //28
            , FSecurityHelper.CurrentUserDataGET()[29]                     //29
            , JSON.Deserialize(e.ExtraParams["IsServer"]).ToString()       //30
            , JSON.Deserialize(e.ExtraParams["IsLockStat"]).ToString()     //31
            , FSecurityHelper.CurrentUserDataGET()[32]                     //32
        });

        FSecurityHelper.SignIn(true, FSecurityHelper.CurrentUserDataGET()[0], 720, false, this.ReturnValue);
    }
Beispiel #2
0
    public void ReloadDate()
    {
        this.ReturnValue = FSecurityHelper.CurrentUserDataSET(new string[] {
            FSecurityHelper.CurrentUserDataGET()[0]    // 0
            , txtUserName.Text.ToUpper()               //FSecurityHelper.CurrentUserDataGET()[1] // 1
            , txtUserNameen.Text.ToUpper()             //FSecurityHelper.CurrentUserDataGET()[2] // 2
            , txtUserEmail.Text                        //FSecurityHelper.CurrentUserDataGET()[3] // 3

            , FSecurityHelper.CurrentUserDataGET()[4]  // 4
            , FSecurityHelper.CurrentUserDataGET()[5]  // 5
            , FSecurityHelper.CurrentUserDataGET()[6]  // 6
            , FSecurityHelper.CurrentUserDataGET()[7]  // 7

            , FSecurityHelper.CurrentUserDataGET()[8]  // 8
            , FSecurityHelper.CurrentUserDataGET()[9]  // 9
            , FSecurityHelper.CurrentUserDataGET()[10] // 10

            , FSecurityHelper.CurrentUserDataGET()[11] // 11
            , FSecurityHelper.CurrentUserDataGET()[12] // 12
            , FSecurityHelper.CurrentUserDataGET()[13] // 13
            , ""                                       //FSecurityHelper.CurrentUserDataGET()[14] // 14
            , FSecurityHelper.CurrentUserDataGET()[15] //15

            , FSecurityHelper.CurrentUserDataGET()[16] //16
            , FSecurityHelper.CurrentUserDataGET()[17] //17
            , FSecurityHelper.CurrentUserDataGET()[18] //18
            , FSecurityHelper.CurrentUserDataGET()[19] //19          ----AE
            , FSecurityHelper.CurrentUserDataGET()[20] //20         ----AE
            , FSecurityHelper.CurrentUserDataGET()[21] //21
            , FSecurityHelper.CurrentUserDataGET()[22] //22
            , FSecurityHelper.CurrentUserDataGET()[23] //23          ----AE
            , FSecurityHelper.CurrentUserDataGET()[24] //24       ----AE 用  默认值
            , FSecurityHelper.CurrentUserDataGET()[25] //25       是否中国大陆使用
            , FSecurityHelper.CurrentUserDataGET()[26] //26       Chinese Invoice
            , FSecurityHelper.CurrentUserDataGET()[27] //27
            , FSecurityHelper.CurrentUserDataGET()[28] //28
            , FSecurityHelper.CurrentUserDataGET()[29] //29
            , FSecurityHelper.CurrentUserDataGET()[30] //30
            , FSecurityHelper.CurrentUserDataGET()[31] //31
            , FSecurityHelper.CurrentUserDataGET()[32] //32
        });


        FSecurityHelper.SignIn(true, FSecurityHelper.CurrentUserDataGET()[0], 120, false, this.ReturnValue);
    }
Beispiel #3
0
    /// <summary>
    /// 用户登录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string username = this.UserName.Text.Trim();
        string password = this.UserPWD.Text.Trim();

        if (username == "")
        {
            PageHelper.MsgBox(Page, "User name can't be empty.");
            UserName.Focus();
            return;
        }
        else if (password == "")
        {
            PageHelper.MsgBox(Page, "Password can't be empty.");
            UserPWD.Focus();
            return;
        }
        DateTime dt1 = DateTime.Now;

        string Browser = Request.Browser.Type + "," + Request.Browser.Version;

        DataTable dt = this.FactoryDAL(PageHelper.ConnectionStrings, "FW_USER_SP", new List <IFields>()
        {
            this.CreateIFields().Append("Option", "user-login")

            .Append("UserName", this.UserName.Text.Trim())
            .Append("UserPWD", PageHelper.MD5(this.UserPWD.Text.Trim()))
            .Append("Browser", Browser)
        }).GetTable();
        //string a = PageHelper.MD5("ynsa9981");
        bool     IsLogin = (dt != null && dt.Rows.Count > 0) ? true : false;
        DateTime dt2     = DateTime.Now;
        TimeSpan t       = dt2.Subtract(dt1);
        double   delay   = t.TotalMilliseconds;

        //PageHelper.MsgBox(Page, delay.ToString());
        if (IsLogin == false && delay > 3000)
        {
            PageHelper.MsgBox(Page, "System is timeout,Please try later again.");
            UserPWD.Focus();
            return;
        }
        if (IsLogin)
        {
            //如果为总站系统 Y,标记 islock 为1 的锁住,不让登录系统。如果为分站系统 N , 当前登录用户不能匹配所属分站系统,锁住,不让登录.
            //if (((dt.Rows[0]["StationSys"].ToString().ToUpper() == "Y" && dt.Rows[0]["IsLockStat"].ToString() == "1") || (dt.Rows[0]["StationSys"].ToString().ToUpper() == "N" && dt.Rows[0]["CompanyID"].ToString().ToUpper() != dt.Rows[0]["CurrStation"].ToString().ToUpper())) && dt.Rows[0]["Dept"].ToString().ToUpper() != "IT")
            //{

            if (((dt.Rows[0]["StationSys"].ToString().ToUpper() == "Y" && dt.Rows[0]["IsLockStat"].ToString() == "1") ||
                 (dt.Rows[0]["StationSys"].ToString().ToUpper() == "N" && !dt.Rows[0]["StatList"].ToString().ToUpper().Contains(dt.Rows[0]["CurrStation"].ToString().ToUpper()))) &&
                dt.Rows[0]["Dept"].ToString().ToUpper() != "IT")
            {
                //对不起,登录失败!当前分站系统用户已经锁定,无法登录到总站系统,请核对后重新登录!
                //Sorry, logon failure! The current station system users have locked and unable to log on to the terminal system, please check log in again!
                PageHelper.MsgBox(Page, "Sorry, logon failure! Please check the login address is correct!");
                UserPWD.Focus();
                return;
            }

            string stat = dt.Rows[0]["STAT"].ToString();

            if (dt.Rows[0]["CurrStation"].ToString() != "")
            {
                string cs = dt.Rows[0]["CurrStation"].ToString();
                if (cs == "PEK" || cs == "SHA" || cs == "SIN" || cs == "XMN")
                {
                    stat = "USG/" + dt.Rows[0]["CurrStation"].ToString();
                }
                else
                {
                    stat = "CON/" + dt.Rows[0]["CurrStation"].ToString();
                }
            }

            #region string[]数组中的数据项位置请勿乱动
            this.ReturnValue = FSecurityHelper.CurrentUserDataSET(new string[] { this.UserName.Text.Trim().ToUpper()          // 0
                                                                                 , dt.Rows[0]["NameCHS"].ToString().ToUpper() // 1
                                                                                 , dt.Rows[0]["NameENG"].ToString().ToUpper() // 2
                                                                                 , dt.Rows[0]["Email"].ToString()             // 3

                                                                                 , dt.Rows[0]["CompanyID"].ToString()         // 4
                                                                                 , dt.Rows[0]["CompanyNameCHS"].ToString()    // 5
                                                                                 , dt.Rows[0]["CompanyNameENG"].ToString()    // 6
                                                                                 , dt.Rows[0]["CompanyDistrict"].ToString()   // 7

                                                                                 , dt.Rows[0]["GroupID"].ToString()           // 8
                                                                                 , dt.Rows[0]["GroupNameCHS"].ToString()      // 9
                                                                                 , dt.Rows[0]["GroupNameENG"].ToString()      // 10

                                                                                 , dt.Rows[0]["SYS"].ToString()               // 11
                                                                                 , stat                                       // 12
                                                                                 , dt.Rows[0]["PermissionList"].ToString()    // 13
                                                                                 , ""                                         //dt.Rows[0]["MenuList"].ToString() // 14
                                                                                 , dt.Rows[0]["Tel"].ToString()               //15

                                                                                 , dt.Rows[0]["Cmp_Tel"].ToString()           //16
                                                                                 , dt.Rows[0]["Cmp_Fax"].ToString()           //17
                                                                                 , dt.Rows[0]["Cmp_Email"].ToString()         //18
                                                                                 , dt.Rows[0]["DimUnit"].ToString()           //19        ----AE
                                                                                 , dt.Rows[0]["DimFloat"].ToString()          //20       ----AE
                                                                                 , dt.Rows[0]["AddressCHS"].ToString()        //21
                                                                                 , dt.Rows[0]["AddressENG"].ToString()        //22
                                                                                 , dt.Rows[0]["DIMRate"].ToString()           //23       ----AE
                                                                                 , dt.Rows[0]["AWBArrange"].ToString()        // 24   ----AE 用  默认值
                                                                                 , dt.Rows[0]["ChinaMode"].ToString()         // 25   是否中国大陆使用
                                                                                 , dt.Rows[0]["ChineseInvoice"].ToString()    // 26
                                                                                 , dt.Rows[0]["UserGrade"].ToString()         // 27
                                                                                 , dt.Rows[0]["Dept"].ToString()              // 28
                                                                                 , dt.Rows[0]["StationSys"].ToString()        // 29  ---- 是否为总站系统, Y 是总站系统 , N 为分站系统
                                                                                 , dt.Rows[0]["IsServer"].ToString()          // 30  ---- 是否已分开系统, Y 已分开系统 , N 为没有分开系统
                                                                                 , dt.Rows[0]["IsLockStat"].ToString()        // 31 -----当前站的用户是否被锁住,不让登录操作
                                                                                 , dt.Rows[0]["CurrStation"].ToString()       // 32 -----当前所在的操作系统, 空为香港总站系统
                                                                  });
            #endregion

            MenuHelper.SetMenu(dt.Rows[0]["MenuList"].ToString(), this.UserName.Text.Trim(), "MenuList");
            FSecurityHelper.SignIn(IsLogin, this.UserName.Text.Trim(), 720, false, this.ReturnValue);
        }
        else
        {
            //JScriptlib.MsgBox("User name or password is not correct", ConfigHelper.GetAppSettings("loginUrl"));
            PageHelper.MsgBox(Page, "User name or password is not correct.");
            UserPWD.Focus();
            return;
        }
    }