Exemple #1
0
        public IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> GetList(EyouSoft.Model.SSOStructure.MGuanLiYuanChaXunInfo serModel)
        {
            IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> list = new List <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo>();
            StringBuilder query = new StringBuilder();

            query.Append("select *   from tbl_User where  1=1");

            if (serModel != null)
            {
                if (!string.IsNullOrEmpty(serModel.Username))
                {
                    query.AppendFormat(" and  UserName like '%{0}%' ", serModel.Username);
                }

                if (!string.IsNullOrEmpty(serModel.XingMing))
                {
                    query.AppendFormat(" and  ContactName like '%{0}%' ", serModel.XingMing);
                }
            }
            query.Append("  order by UserID  DESC  ");
            DbCommand cmd = this._db.GetSqlStringCommand(query.ToString());

            using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._db))
            {
                while (dr.Read())
                {
                    var model = new EyouSoft.Model.SSOStructure.MGuanLiYuanInfo();
                    model.UserId   = dr["UserID"].ToString();
                    model.Username = dr["UserName"].ToString();
                    model.MiMa     = dr["UserPwd"].ToString();
                    model.XingMing = dr["ContactName"].ToString();
                    if (!dr.IsDBNull(dr.GetOrdinal("ContactSex")))
                    {
                        model.XingBie = (sexType)dr.GetByte(dr.GetOrdinal("ContactSex"));
                    }
                    model.BeiZhu            = dr["Remark"].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.GongZhangFilepath = dr["SealImg"].ToString();
                    model.CreateTime        = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    model.LeiXing           = (Eyousoft_yhq.Model.WebmasterLeiXing)dr.GetInt32(dr.GetOrdinal("LeiXing"));

                    list.Add(model);
                }
            }
            return(list);
        }
Exemple #2
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.User bll = new Eyousoft_yhq.BLL.User();
            var serchModel            = new EyouSoft.Model.SSOStructure.MGuanLiYuanChaXunInfo();

            serchModel.XingMing = Utils.GetQueryStringValue("contactName");
            serchModel.Username = Utils.GetQueryStringValue("userName");
            pageIndex           = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;
            }
            else
            {
                rpt_list.Visible = false;
            }
        }
Exemple #3
0
        public IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> GetList(int PageSize, int PageIndex, ref int RecordCount, EyouSoft.Model.SSOStructure.MGuanLiYuanChaXunInfo serModel)
        {
            IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> list = new List <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo>();


            string tableName     = "tbl_User";
            string fileds        = " *  ";
            string orderByString = "IssueTime desc";

            StringBuilder query = new StringBuilder();

            query.AppendFormat(" 1=1 ");
            if (serModel != null)
            {
                if (!string.IsNullOrEmpty(serModel.Username))
                {
                    query.AppendFormat(" and  UserName like '%{0}%' ", serModel.Username);
                }

                if (!string.IsNullOrEmpty(serModel.XingMing))
                {
                    query.AppendFormat(" and  ContactName like '%{0}%' ", serModel.XingMing);
                }
            }


            using (IDataReader dr = DbHelper.ExecuteReader1(this._db, PageSize, PageIndex, ref RecordCount, tableName, fileds, query.ToString(), orderByString, null))
            {
                while (dr.Read())
                {
                    var model = new EyouSoft.Model.SSOStructure.MGuanLiYuanInfo();
                    model.UserId   = dr["UserID"].ToString();
                    model.Username = dr["UserName"].ToString();
                    model.MiMa     = dr["UserPwd"].ToString();
                    model.XingMing = dr["ContactName"].ToString();
                    if (!dr.IsDBNull(dr.GetOrdinal("ContactSex")))
                    {
                        model.XingBie = (sexType)dr.GetByte(dr.GetOrdinal("ContactSex"));
                    }
                    model.BeiZhu            = dr["Remark"].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.GongZhangFilepath = dr["SealImg"].ToString();
                    model.CreateTime        = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    model.LeiXing           = (Eyousoft_yhq.Model.WebmasterLeiXing)dr.GetInt32(dr.GetOrdinal("LeiXing"));

                    list.Add(model);
                }
            }
            return(list);
        }
Exemple #4
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <param name="serModel"></param>
 /// <param name="isAdmin">1,管理员,0,会员</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> GetList(EyouSoft.Model.SSOStructure.MGuanLiYuanChaXunInfo serModel)
 {
     return(dal.GetList(serModel));
 }
Exemple #5
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <param name="PageSize"></param>
 /// <param name="PageIndex"></param>
 /// <param name="RecordCount"></param>
 /// <param name="serModel"></param>
 /// <param name="isAdmin">1,管理员,0,会员</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.SSOStructure.MGuanLiYuanInfo> GetList(int PageSize, int PageIndex, ref int RecordCount, EyouSoft.Model.SSOStructure.MGuanLiYuanChaXunInfo serModel)
 {
     return(dal.GetList(PageSize, PageIndex, ref RecordCount, serModel));
 }