Ejemplo n.º 1
0
        /// <summary>
        /// 用户是否登录
        /// </summary>
        /// <param name="info">登录用户信息</param>
        /// <returns></returns>
        public static bool IsLogin(out MWebmasterInfo info)
        {
            info = GetUserInfo();

            if (info == null) return false;

            return true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        private MWebmasterInfo ReadUserInfo(DbCommand cmd)
        {
            EyouSoft.Model.SSOStructure.MWebmasterInfo model = null;
            using (IDataReader dr = DbHelper.ExecuteReader(cmd, SystemStore))
            {
                if (dr.Read())
                {
                    model            = new MWebmasterInfo();
                    model.UserId     = dr["UserID"].ToString();
                    model.Username   = dr["UserName"].ToString();
                    model.XingMing   = dr["ContactName"].ToString();
                    model.Telephone  = dr["ContactTel"].ToString();
                    model.IsAdmin    = dr["IsAdmin"].ToString() == "1";
                    model.Status     = dr.GetByte(dr.GetOrdinal("UserState"));
                    model.Privs      = dr["Privs"].ToString();
                    model.CreateTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    model.LeiXing    = (Eyousoft_yhq.Model.WebmasterLeiXing)dr.GetInt32(dr.GetOrdinal("LeiXing"));
                }
            }

            return(model);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// OnInit
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            MWebmasterInfo m = null;
            bool isLogin = IsLogin(out m);

            if (!isLogin)
            {
                Response.Redirect("/webMaster/login.aspx");
            }

            HuiYuanInfo = m;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        private MWebmasterInfo ReadUserInfo(DbCommand cmd)
        {
            EyouSoft.Model.SSOStructure.MWebmasterInfo model = null;
            using (IDataReader dr = DbHelper.ExecuteReader(cmd, SystemStore))
            {
                if (dr.Read())
                {
                    model = new MWebmasterInfo();
                    model.UserId = dr["UserID"].ToString();
                    model.Username = dr["UserName"].ToString();
                    model.XingMing = dr["ContactName"].ToString();
                    model.Telephone = dr["ContactTel"].ToString();
                    model.IsAdmin = dr["IsAdmin"].ToString() == "1";
                    model.Status = dr.GetByte(dr.GetOrdinal("UserState"));
                    model.Privs = dr["Privs"].ToString();
                    model.CreateTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    model.LeiXing = (Eyousoft_yhq.Model.WebmasterLeiXing)dr.GetInt32(dr.GetOrdinal("LeiXing"));

                }
            }

            return model;
        }