Exemple #1
0
        /// <summary>
        /// 重写虚方法,此方法在Init事件执行
        /// </summary>
        protected override void InitPage()
        {
            action = HotoRequest.GetQueryString("action");

            //获得最后登录日志
            DataTable dt = new Hoto.BLL.user_login_log().GetList(2, "user_name='" + userModel.user_name + "'", "id desc").Tables[0];
            if (dt.Rows.Count == 2)
            {
                curr_login_ip = dt.Rows[0]["login_ip"].ToString();
                pre_login_ip = dt.Rows[1]["login_ip"].ToString();
                pre_login_time = dt.Rows[1]["login_time"].ToString();
            }
            else if (dt.Rows.Count == 1)
            {
                curr_login_ip = dt.Rows[0]["login_ip"].ToString();
            }
            //未完成订单
            total_order = new Hoto.BLL.orders().GetCount("user_name='" + userModel.user_name + "' and status<3");
            //未读短信息
            total_msg = new Hoto.BLL.user_message().GetCount("accept_user_name='" + userModel.user_name + "' and is_read=0");

            //退出登录==========================================================
            if (action == "exit")
            {
                //清险Session
                HttpContext.Current.Session[HotoKeys.SESSION_USER_INFO] = null;
                //清除Cookies
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie("UserName", "DTcms", -1);
                HotoUtils.WriteCookie("Password", "DTcms", -1);
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(linkurl("login"));
            }
        }
Exemple #2
0
        /// <summary>
        /// 重写虚方法,此方法在Init事件执行
        /// </summary>
        protected override void InitPage()
        {
            action = HotoRequest.GetQueryString("action");

            //获得最后登录日志
            DataTable dt = new Hoto.BLL.user_login_log().GetList(2, "user_name='" + userModel.user_name + "'", "id desc").Tables[0];

            if (dt.Rows.Count == 2)
            {
                curr_login_ip  = dt.Rows[0]["login_ip"].ToString();
                pre_login_ip   = dt.Rows[1]["login_ip"].ToString();
                pre_login_time = dt.Rows[1]["login_time"].ToString();
            }
            else if (dt.Rows.Count == 1)
            {
                curr_login_ip = dt.Rows[0]["login_ip"].ToString();
            }
            //未完成订单
            total_order = new Hoto.BLL.orders().GetCount("user_name='" + userModel.user_name + "' and status<3");
            //未读短信息
            total_msg = new Hoto.BLL.user_message().GetCount("accept_user_name='" + userModel.user_name + "' and is_read=0");

            //退出登录==========================================================
            if (action == "exit")
            {
                //清险Session
                HttpContext.Current.Session[HotoKeys.SESSION_USER_INFO] = null;
                //清除Cookies
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie(HotoKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", -43200);
                HotoUtils.WriteCookie("UserName", "DTcms", -1);
                HotoUtils.WriteCookie("Password", "DTcms", -1);
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(linkurl("login"));
            }
        }