コード例 #1
0
ファイル: BLLUser.cs プロジェクト: WalkWithWind/HT_HCBSB
        /// <summary>
        /// 获取提现记录列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="type"></param>
        /// <returns></returns>

        public static HT.Model.Model.PageResult <ht_user_money_log> GetUserMoneyLogList(int pageIndex, int pageSize, int type, int?status = null)
        {
            HT.Model.Model.PageResult <ht_user_money_log> pageModel = new HT.Model.Model.PageResult <ht_user_money_log>();
            using (Entities db = new Entities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                var userMoneyList = db.ht_user_money_log.Where(r => true);

                if (type > 0)
                {
                    userMoneyList = userMoneyList.Where(r => r.type == type);
                }

                if (status.HasValue)
                {
                    userMoneyList = userMoneyList.Where(r => r.status == status);
                }
                int total = userMoneyList.Count();

                pageModel.totalpage = (int)Math.Ceiling((decimal)total / (decimal)pageSize);//总页数
                pageModel.total     = total;
                pageModel.list      = userMoneyList.OrderByDescending(p => p.id).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
                return(pageModel);
            }
        }
コード例 #2
0
ファイル: BLLProject.cs プロジェクト: WalkWithWind/HT_HCBSB
        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="cateId"></param>
        /// <param name="keyword"></param>
        /// <returns></returns>

        public static HT.Model.Model.PageResult <ht_news> GetNewsList(int pageIndex, int pageSize, int cateId, string status, string keyword, string fromDate = "", string toDate = "")
        {
            HT.Model.Model.PageResult <ht_news> pageModel = new HT.Model.Model.PageResult <ht_news>();
            using (Entities db = new Entities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                var unDelList = db.ht_news.Where(r => true);
                if (cateId > 0)
                {
                    unDelList = unDelList.Where(r => r.cateid == cateId);
                }
                if (!string.IsNullOrWhiteSpace(keyword))
                {
                    unDelList = unDelList.Where(r => r.title.Contains(keyword.Trim()));
                }
                if (!string.IsNullOrWhiteSpace(status))
                {
                    int statusInt = int.Parse(status);
                    if (statusInt > 0)
                    {
                        unDelList = unDelList.Where(r => r.status == statusInt);
                    }
                    else
                    {
                        if (statusInt == 0)
                        {
                            unDelList = unDelList.Where(r => r.status == 0 && r.pay_status == 1);
                        }
                        else
                        {
                            unDelList = unDelList.Where(r => r.status == 0 && r.pay_status == 0);
                        }
                    }
                }
                if (!string.IsNullOrWhiteSpace(fromDate))
                {
                    DateTime dtFrom = DateTime.Parse(fromDate);
                    unDelList = unDelList.Where(r => r.add_time >= dtFrom);
                }
                if (!string.IsNullOrWhiteSpace(toDate))
                {
                    DateTime dtTo = DateTime.Parse(toDate).AddDays(1).AddSeconds(-1);
                    unDelList = unDelList.Where(r => r.add_time <= dtTo);
                }
                int total = unDelList.Count();

                pageModel.totalpage = (int)Math.Ceiling((decimal)total / (decimal)pageSize);//总页数
                pageModel.total     = total;
                pageModel.list      = unDelList.OrderByDescending(p => p.id).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();

                foreach (var item in pageModel.list)
                {
                    item.review_s0 = db.ht_review
                                     .Where(p => p.news_id == item.id && p.status == 0)
                                     .Count();
                }
            }
            return(pageModel);
        }
コード例 #3
0
ファイル: BLLUser.cs プロジェクト: WalkWithWind/HT_HCBSB
    {/// <summary>
     /// 获取列表
     /// </summary>
     /// <param name="pageIndex"></param>
     /// <param name="pageSize"></param>
     /// <param name="keyword"></param>
     /// <returns></returns>

        public static HT.Model.Model.PageResult <ht_user> GetUsersList(int pageIndex, int pageSize, string keyword)
        {
            HT.Model.Model.PageResult <ht_user> pageModel = new HT.Model.Model.PageResult <ht_user>();
            using (Entities db = new Entities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                var unDelList = db.ht_user.Where(r => true);
                unDelList = unDelList.Where(p => p.isdelete == 0);
                if (!string.IsNullOrWhiteSpace(keyword))
                {
                    unDelList = unDelList.Where(r => r.mobile.Contains(keyword.Trim()) || r.nickname.Contains(keyword.Trim()));
                }
                int total = unDelList.Count();

                pageModel.totalpage = (int)Math.Ceiling((decimal)total / (decimal)pageSize);//总页数
                pageModel.total     = total;
                pageModel.list      = unDelList.OrderByDescending(p => p.id).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
                return(pageModel);
            }
        }
コード例 #4
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="type"></param>
        /// <param name="keyword"></param>
        /// <returns></returns>

        public static HT.Model.Model.PageResult <ht_review> GetReviewsList(int pageIndex, int pageSize, string news_id, string type, string status, string keyword, string review_id)
        {
            HT.Model.Model.PageResult <ht_review> pageModel = new HT.Model.Model.PageResult <ht_review>();
            using (Entities db = new Entities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                var unDelList = db.ht_review.Where(r => true);
                if (!string.IsNullOrWhiteSpace(news_id))
                {
                    int newsid = int.Parse(news_id);
                    unDelList = unDelList.Where(r => r.news_id == newsid);
                }
                if (!string.IsNullOrWhiteSpace(type) && type != "all")
                {
                    unDelList = unDelList.Where(r => r.review_type == type);
                }
                if (!string.IsNullOrWhiteSpace(keyword))
                {
                    unDelList = unDelList.Where(r => r.nickname == keyword || r.review_content.StartsWith(keyword));
                }
                if (!string.IsNullOrWhiteSpace(status))
                {
                    int statusInt = int.Parse(status);
                    unDelList = unDelList.Where(r => r.status == statusInt);
                }
                if (!string.IsNullOrWhiteSpace(review_id))
                {
                    int review_id_num = Convert.ToInt32(review_id);
                    unDelList = unDelList.Where(r => r.review_id == review_id_num);
                }
                int total = unDelList.Count();

                pageModel.totalpage = (int)Math.Ceiling((decimal)total / (decimal)pageSize);//总页数
                pageModel.total     = total;
                pageModel.list      = unDelList.OrderBy(p => p.status).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
                if (type == "all")
                {
                    foreach (var item in pageModel.list)
                    {
                        if (item.review_type == "reply")
                        {
                            var pr = db.ht_review.Find(item.review_id);
                            if (pr != null)
                            {
                                item.parent_content = pr.review_content;
                            }
                        }
                        else if (item.review_type == "comment")
                        {
                            var pn = db.ht_news.Find(item.news_id);
                            if (pn == null)
                            {
                                continue;
                            }
                            if (pn.cateid == 1 || pn.cateid == 2)
                            {
                                item.parent_content = BLLNews.GetCity(pn.start_city, pn.start_district, pn.start_province) + "→" + BLLNews.GetCity(pn.stop_city, pn.stop_district, pn.stop_province);
                            }
                            else
                            {
                                item.parent_content = pn.add_nickname + " " + pn.cate;
                            }
                        }
                    }
                }
                return(pageModel);
            }
        }