毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> net技术 >> 正文

提示失败后不会返回到原来的页面

更新时间:2012-11-8:  来源:毕业论文

namespace viviapi.WebUI
{
    public partial class DoLogin : viviapi.BLL.Web.PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (_action == "login")
            {
                SignIn();
            }
            else
            {
                Response.Redirect(rUrl, true);
            }
        }
        public string _action
        {
            get
            {
                return viviLib.Web.WebBase.GetFormString("__action", string.Empty);
            }
        }
        string rUrl = "login.aspx";
        void ShowErrorInfo(string error)
        {
            AlertAndRedirect(error,rUrl);
            //corp_errtipDiv.Style.Add("display", "");
            //corp_errtips.InnerHtml = error;
        }

        void SignIn()
        {
            string userName = Request.Form["inputuin"];
            string userPwd = Request.Form["pp"];
            string code = Request.Form["txtcheckCode"];
            if (string.IsNullOrEmpty(code))
            {
                ShowErrorInfo("请输入验证码!");
                return;
            }
            if (string.IsNullOrEmpty(userName))
            {
                ShowErrorInfo("请输入商户名!");
                return;
            }
            if (string.IsNullOrEmpty(userPwd))
            {
                ShowErrorInfo("请输入商户密码!");
                return;
            }
            if (this.Session["CCode"] == null)
            {
                ShowErrorInfo("验证码失效!请刷新页面");
                return;
            }
            if (this.Session["CCode"].ToString().ToUpper() != code.ToUpper())
            {
                ShowErrorInfo("验证码不正确");
                return;
            }

            UserInfo userInfo = new UserInfo();
            userInfo.UserName = userName;
            userInfo.Password = Cryptography.MD5(userPwd);
            userInfo.LastLoginIp = viviLib.Web.ServerVariables.TrueIP;
            userInfo.LastLoginTime = DateTime.Now;
            userInfo.LastLoginAddress = viviapi.web.WebUtility.GetIPAddress(userInfo.LastLoginIp);
            userInfo.LastLoginRemark = viviapi.web.WebUtility.GetIPAddressInfo(userInfo.LastLoginIp);

            string msg = viviapi.BLL.User.UserFactory.SignIn(userInfo);
            if (userInfo.ID > 0)
            {
                Response.Redirect("/Merchant/index.aspx", false);
            }
            else
            {
                AlertAndRedirect(msg);
            }
        }
    }
}

namespace viviapi.WebUI {     public partial class DoLogin : viviapi.BLL.Web.PageBase     {         protected void Page_Load(object sender, EventArgs e)         {                           if (_action == "login")             {                 SignIn();             }             else            {                 Response.Redirect(rUrl, true);             }         }         public string _action         {             get            {                 return viviLib.Web.WebBase.GetFormString("__action", string.Empty);             }         }         string rUrl = "login.aspx";         void ShowErrorInfo(string error)         {     Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "messages", "<script>alert('登录错误!');location.href='login.sapx';</script>", false);             //AlertAndRedirect(error,rUrl);             //corp_errtipDiv.Style.Add("display", "");             //corp_errtips.InnerHtml = error;         }           void SignIn()         {             string userName = Request.Form["inputuin"];             string userPwd = Request.Form["pp"];             string code = Request.Form["txtcheckCode"];             if (string.IsNullOrEmpty(code))             {                 ShowErrorInfo("请输入验证码!");                 return;             }             if (string.IsNullOrEmpty(userName))             {                 ShowErrorInfo("请输入商户名!");                 return;             }             if (string.IsNullOrEmpty(userPwd))             {                 ShowErrorInfo("请输入商户密码!");                 return;             }             if (this.Session["CCode"] == null)             {                 ShowErrorInfo("验证码失效!请刷新页面");                 return;             }             if (this.Session["CCode"].ToString().ToUpper() != code.ToUpper())             {                 ShowErrorInfo("验证码不正确");                 return;             }               UserInfo userInfo = new UserInfo();             userInfo.UserName = userName;             userInfo.Password = Cryptography.MD5(userPwd);             userInfo.LastLoginIp = viviLib.Web.ServerVariables.TrueIP;             userInfo.LastLoginTime = DateTime.Now;             userInfo.LastLoginAddress = viviapi.web.WebUtility.GetIPAddress(userInfo.LastLoginIp);             userInfo.LastLoginRemark = viviapi.web.WebUtility.GetIPAddressInfo(userInfo.LastLoginIp);               string msg = viviapi.BLL.User.UserFactory.SignIn(userInfo);             if (userInfo.ID > 0)             {                 Response.Redirect("/Merchant/index.aspx", false);             }             else            {                 AlertAndRedirect(msg);             }         }     } }

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。