Example #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string user = txtUserName.Text.Trim();
            string pass = txtPassword.Text.Trim();

            try
            {
                if (WebUser.No != null)
                {
                    WebUser.Exit();
                }

                BP.Port.Emp em = new BP.Port.Emp(user);
                if (em.CheckPass(pass))
                {
                    bool bl = this.IsRemember.Checked;
                    WebUser.SignInOfGenerLang(em, WebUser.SysLang, bl);
                    if (this.Request.RawUrl.ToLower().Contains("wap"))
                    {
                        WebUser.IsWap = true;
                    }
                    else
                    {
                        WebUser.IsWap = false;
                    }

                    WebUser.Token = this.Session.SessionID;

                    string s = "";
                    s = BP.Web.WebUser.No;
                    if (string.IsNullOrEmpty(s))
                    {
                        s = BP.Web.WebUser.NoOfRel;
                    }
                    if (string.IsNullOrEmpty(s))
                    {
                        throw new Exception("@编号没有写入:" + s);
                    }

                    this.Response.Redirect("Default.aspx?ss=" + s + "&DDD=" + em.No, false);
                    return;
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "kesy", "<script language=JavaScript>alert('用户名密码错误,注意密码区分大小写,请检查是否按下了CapsLock.。');</script>");
                }
            }
            catch (System.Exception ex)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "kesy", "<script language=JavaScript>alert('@用户名密码错误!@检查是否按下了CapsLock.@更详细的信息:" + ex.Message + "');</script>");
            }
        }
Example #2
0
        public string ReLoginSubmit()
        {
            string userNo   = this.GetValFromFrmByKey("TB_No");
            string password = this.GetValFromFrmByKey("TB_PW");

            BP.Port.Emp emp = new BP.Port.Emp();
            emp.No = userNo;
            if (emp.RetrieveFromDBSources() == 0)
            {
                return("err@用户名或密码错误.");
            }

            if (emp.CheckPass(password) == false)
            {
                return("err@用户名或密码错误.");
            }

            BP.Web.WebUser.SignInOfGener(emp);

            return("登录成功.");
        }