コード例 #1
0
ファイル: TransferData.cs プロジェクト: IOT001/IOT1.0-me
        /// <summary>
        /// 报销列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_Transfer> GetTransferList(TransferListSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

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

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.JName))//甲方
            {
                sb.AppendFormat(" and JStudentIDName like '%{0}%' ", search.JName);
            }
            if (!string.IsNullOrWhiteSpace(search.YName))//乙方
            {
                sb.AppendFormat(" and YStudentIDName like '%{0}%' ", search.YName);
            }

            if (!string.IsNullOrWhiteSpace(search.StateID))//状态
            {
                sb.AppendFormat(" and StateID = '{0}' ", search.StateID);
            }

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


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

            return(new PagedList <vw_Transfer>(list, search.CurrentPage, search.PageSize, allcount));
        }
コード例 #2
0
        //
        // GET: /Transfer/

        /// <summary>
        /// 转让列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public ActionResult TransferAgreementList(TransferListSearchModel search)
        {
            TransferListViewModel model = new TransferListViewModel();                                                         //页面模型

            model.search             = search;                                                                                 //页面的搜索模型
            model.search.PageSize    = 15;                                                                                     //每页显示
            model.search.CurrentPage = Convert.ToInt32(Request["pageindex"]) <= 0 ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页
            //状态下拉框
            List <CommonEntity> StateIDIL = CommonData.GetDictionaryList(20);                                                  //1是字典类型值,仅供测试参考

            model.StateIDIL = CommonData.Instance.GetBropDownListData(StateIDIL);

            //学生下拉框
            List <CommonEntity> StudentsIDIL = CommonData.GetStudentsList();

            model.StudentsIDIL = CommonData.Instance.GetBropDownListData(StudentsIDIL);

            List <CommonEntity> StudentsIDIL_1 = CommonData.GetStudentsList();

            model.StudentsIDIL_1 = CommonData.Instance.GetBropDownListData(StudentsIDIL_1);

            string        SYS_Role = "0";
            List <string> roles    = UserSession.roles;//取账号角色

            for (int i = 0; i < roles.Count; i++)
            {
                if (roles[i] == "1" || roles[i] == "4")
                {
                    SYS_Role = "1";
                }
            }

            ViewData["SYS_Role"] = SYS_Role;


            model.Transferlist = TransferData.GetTransferList(search); //填充页面模型数据
            return(View(model));                                       //返回页面模型
        }