public static List <UserImgs> GetUserImgList(string userid, int status, int pageIndex, int pageSize, ref int totalCount, ref int pageCount) { string whereSql = " a.Status<>9 "; if (status > -1) { whereSql += " and a.status=" + status; } if (!string.IsNullOrEmpty(userid)) { whereSql += " and a.UserID='" + userid + "' "; } string clumstr = "a.*,b.Name as UserName "; DataTable dt = CommonBusiness.GetPagerData("UserImgs a left join M_Users b on a.Userid=b.Userid ", clumstr, whereSql, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount); List <UserImgs> list = new List <UserImgs>(); foreach (DataRow item in dt.Rows) { UserImgs model = new UserImgs(); model.FillData(item); list.Add(model); } return(list); }
public static List <UserImgs> GetUserImgList(string keywords, int status, string begintime, string endtime, int pageIndex, int pageSize, ref int totalCount, ref int pageCount) { string whereSql = " a.Status<>9 "; if (status > -1) { whereSql += " and a.status=" + status; } if (!string.IsNullOrEmpty(begintime)) { whereSql += " and a.CreateTime>='" + begintime + " 00:00:00'"; } if (!string.IsNullOrEmpty(endtime)) { whereSql += " and a.CreateTime<'" + endtime + " 23:59:59:999'"; } if (!string.IsNullOrEmpty(keywords)) { whereSql += " and b.Name like '%" + keywords + "%' "; } string clumstr = "a.*,b.Name as UserName "; DataTable dt = CommonBusiness.GetPagerData("UserImgs a left join M_Users b on a.Userid=b.Userid ", clumstr, whereSql, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount); List <UserImgs> list = new List <UserImgs>(); foreach (DataRow item in dt.Rows) { UserImgs model = new UserImgs(); model.FillData(item); list.Add(model); } return(list); }
public static List <UserImgs> GetNewImg(int tops, int status) { DataTable dt = UserImgsDAL.BaseProvider.GetNewImg(tops, status); List <UserImgs> list = new List <UserImgs>(); foreach (DataRow item in dt.Rows) { UserImgs model = new UserImgs(); model.FillData(item); list.Add(model); } return(list); }