コード例 #1
0
        public ActionResult RefundCheckList(RefundCheckListSearchModel search)
        {
            RefundCheckListModel model = new RefundCheckListModel();                                                           //页面模型

            model.search             = search;                                                                                 //页面的搜索模型
            model.search.PageSize    = 15;                                                                                     //每页显示
            model.search.CurrentPage = Convert.ToInt32(Request["pageindex"]) <= 0 ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页
            //search.StateID = "1";
            model.RefundlList = RefundCheckData.GetRefundList(search);                                                         //填充页面模型数据
            return(View(model));                                                                                               //返回页面模型
        }
コード例 #2
0
ファイル: RefundCheckData.cs プロジェクト: IOT001/IOT1.0-me
        /// <summary>
        /// 分页获取审核表的数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_Refund> GetRefundList(RefundCheckListSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_Refund ";                                                                         //表或者视图
            orderby = "ID desc";                                                                              //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");



            if (!string.IsNullOrWhiteSpace(search.SutdentName))//姓名
            {
                sb.AppendFormat(" and SutdentName like '%{0}%' ", search.SutdentName);
            }
            if (!string.IsNullOrWhiteSpace(search.BindPhone))//学号
            {
                sb.AppendFormat(" and BindPhone like '%{0}%' ", search.BindPhone);
            }

            if (!string.IsNullOrWhiteSpace(search.timeStart))//开班时间
            {
                sb.AppendFormat(" and CreateTime > = '{0}' ", search.timeStart);
            }
            if (!string.IsNullOrWhiteSpace(search.timeEnd))//结束时间
            {
                sb.AppendFormat(" and CreateTime <= '{0}' ", search.timeEnd);
            }

            //if (!string.IsNullOrWhiteSpace(search.StateID))//学号
            //{
            //    sb.AppendFormat(" and StateID = '{0}' ", search.StateID);
            //}
            where = sb.ToString();

            int allcount = 0;
            var list     = CommonPage <vw_Refund> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_Refund>(list, search.CurrentPage, search.PageSize, allcount));
        }