Example #1
0
        /// <summary>
        /// 分页获取数据列表(用户信息表)
        /// </summary>
        public PeterPages GetSearch(LogList LogList, int PageIndex, int PageSize)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(LogList.username))
            {
                sqlwhere = sqlwhere + " and username like '%" + LogList.username + "%' ";
            }
            //获取开始日期和结束日期
            string startTime = LogList.tmp_Data.Split('|')[0];
            string endTime   = LogList.tmp_Data.Split('|')[1];

            if (startTime != "" && endTime != "")
            {
                sqlwhere = sqlwhere + @" and  ( convert(varchar,LogTime, 120 )   between '" + startTime
                           + "' and  convert(char(10),dateadd(dd,1,'" + endTime + "'),120)) ";
            }
            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[LogList]";     //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";            //主键
            entity.Orderfield = " LogTime desc"; //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #2
0
        /// <summary>
        /// 分页获取数据列表(案卷借阅表)
        /// </summary>
        public PeterPages GetSearch(FileDestroy FileDestroy, int PageIndex, int PageSize, string strCountyId)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (FileDestroy.FileClassID > 0)
            {
                sqlwhere = sqlwhere + " and FileClassID like '%" + FileDestroy.FileClassID + "%' ";
            }
            if (!string.IsNullOrEmpty(FileDestroy.FileEnterName))
            {
                sqlwhere = sqlwhere + " and FileEnterName like '%" + FileDestroy.FileEnterName + "%' ";
            }
            if (strCountyId != "")
            {
                sqlwhere = sqlwhere + " and SZQXDM ='" + strCountyId + "' ";
            }

            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[FileDestroy]";     //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";                //主键
            entity.Orderfield = " DestroyDate desc"; //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #3
0
        /// <summary>
        /// 分页获取数据列表(用户信息表)
        /// </summary>
        public PeterPages GetSearch(UserList UserList, int PageIndex, int PageSize)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(UserList.userName))
            {
                sqlwhere = sqlwhere + " and userName like '%" + UserList.userName + "%' ";
            }
            if (UserList.userState != -1)
            {
                sqlwhere = sqlwhere + " and userState=" + UserList.userState + " ";
            }
            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[UserList]";    //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";            //主键
            entity.Orderfield = " AddTime desc"; //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #4
0
        /// <summary>
        /// 分页获取数据列表(案卷类别表)
        /// </summary>
        public PeterPages GetSearch(FileClass FileClass, int PageIndex, int PageSize)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(FileClass.FileCode))
            {
                sqlwhere = sqlwhere + " and FileCode like '%" + FileClass.FileCode + "%' ";
            }
            if (!string.IsNullOrEmpty(FileClass.FileName))
            {
                sqlwhere = sqlwhere + " and FileName like '%" + FileClass.FileName + "%' ";
            }

            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[FileClass]"; //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";          //主键
            entity.Orderfield = " id asc";     //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #5
0
        /// <summary>
        /// 分页获取数据列表(承办单位表)
        /// </summary>
        public PeterPages GetSearch(FileLibrary FileLibrary, int PageIndex, int PageSize)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(LoginUser.CountyId))
            {
                sqlwhere = "QXDM='" + LoginUser.CountyId + "'";
            }
            if (!string.IsNullOrEmpty(FileLibrary.FileLibraryName))
            {
                sqlwhere = sqlwhere + " and FileLibraryName like '%" + FileLibrary.FileLibraryName + "%' ";
            }
            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[FileLibrary]"; //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "ID";            //主键
            entity.Orderfield = " ID desc";      //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #6
0
        /// <summary>
        /// 分页获取数据列表(案卷类别表)
        /// </summary>
        public PeterPages GetSearch(FileBorrow FileBorrow, int PageIndex, int PageSize, string strCountyId)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (FileBorrow.FileClassID > 0)
            {
                sqlwhere = sqlwhere + " and FileClassID like '%" + FileBorrow.FileClassID + "%' ";
            }
            if (!string.IsNullOrEmpty(FileBorrow.FileEnterName))
            {
                sqlwhere = sqlwhere + " and FileEnterName like '%" + FileBorrow.FileEnterName + "%' ";
            }
            if (strCountyId != "")
            {
                sqlwhere = sqlwhere + " and SZQXDM ='" + strCountyId + "' ";
            }
            //数据类型 0默认全部[1未归还, 2已归还]
            if (FileBorrow.SJLX == 1)
            {
                sqlwhere = sqlwhere + " and ReturnDate ='' ";
            }
            else if (FileBorrow.SJLX == 2)
            {
                sqlwhere = sqlwhere + " and ReturnDate <>'' ";
            }

            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[FileBorrow]";                    //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";                              //主键
            entity.Orderfield = " BorrowDate desc,ReturnDate asc"; //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #7
0
        /// <summary>
        /// 分页获取数据列表(保管期限表)
        /// </summary>
        public PeterPages GetSearch(SaveDeadline SaveDeadline, int PageIndex, int PageSize)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            if (!string.IsNullOrEmpty(SaveDeadline.YearName))
            {
                sqlwhere = sqlwhere + " and YearName like '%" + SaveDeadline.YearName + "%' ";
            }
            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[SaveDeadline]"; //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";             //主键
            entity.Orderfield = " id desc";       //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }
Example #8
0
        //@tbname varchar(255),        --表名
        //@Fields varchar(1000)='*',      --返回字段
        //@OrderField varchar(255),   --排序的字段名
        //@PageSize int=15,                 --页尺寸
        //@PageCurrent int=1,                --页码
        //@OrderType bit=0,                --排序类型,1是升序,0是降序
        //@Where varchar(1500)= '',    --查询条件
        //@TotalPage int output            --返回总记录数

        public static PeterPages GetPageLists(PageInfoNew pageinfo)
        {
            SqlParameter[] Parameter = new SqlParameter[8];
            Parameter[0]               = new SqlParameter();
            Parameter[0].DbType        = DbType.String;
            Parameter[0].ParameterName = "@tbname";
            Parameter[0].Value         = pageinfo.Tablename;
            Parameter[0].Direction     = ParameterDirection.Input;

            Parameter[1]               = new SqlParameter();
            Parameter[1].DbType        = DbType.String;
            Parameter[1].Size          = 1000;
            Parameter[1].ParameterName = "@FieldShow";
            Parameter[1].Value         = pageinfo.Fields;
            Parameter[1].Direction     = ParameterDirection.Input;

            Parameter[2]               = new SqlParameter();
            Parameter[2].DbType        = DbType.String;
            Parameter[2].Size          = 1500;
            Parameter[2].ParameterName = "@Where";
            Parameter[2].Value         = pageinfo.Sqlwhere;
            Parameter[2].Direction     = ParameterDirection.Input;

            Parameter[3]               = new SqlParameter();
            Parameter[3].DbType        = DbType.Int16;
            Parameter[3].ParameterName = "@PageSize";
            Parameter[3].Value         = pageinfo.PageSize;
            Parameter[3].Direction     = ParameterDirection.Input;

            Parameter[4]               = new SqlParameter();
            Parameter[4].DbType        = DbType.Int16;
            Parameter[4].ParameterName = "@PageCurrent";
            Parameter[4].Value         = pageinfo.PageIndex;
            Parameter[4].Direction     = ParameterDirection.Input;

            Parameter[5]               = new SqlParameter();
            Parameter[5].DbType        = DbType.String;
            Parameter[5].ParameterName = "@FieldKey";
            Parameter[5].Value         = pageinfo.Fieldkey;
            Parameter[5].Direction     = ParameterDirection.Input;


            Parameter[6]               = new SqlParameter();
            Parameter[6].DbType        = DbType.String;
            Parameter[6].Size          = 50;
            Parameter[6].ParameterName = "@FieldOrder";

            Parameter[6].Value         = pageinfo.Orderfield;
            Parameter[6].Direction     = ParameterDirection.Input;
            Parameter[7]               = new SqlParameter();
            Parameter[7].DbType        = DbType.Int32;
            Parameter[7].Size          = 200;
            Parameter[7].ParameterName = "@RecordCount";
            Parameter[7].Direction     = ParameterDirection.Output;
            Parameter[7].Value         = 0;

            //存储过程sp_PageView进行分页
            DataSet ds = TSQLServer.RunProcedure("sp_PageView", Parameter, "pages");


            Int32      recordcount = (Int32)Parameter[7].Value;
            PeterPages pages       = new PeterPages(pageinfo.PageSize, pageinfo.PageIndex, recordcount, ds);

            return(pages);
        }
Example #9
0
        /// <summary>
        /// 分页获取数据列表(档案移交支队)
        /// </summary>
        public PeterPages GetSearch(FileTransfer FileTransfer, int PageIndex, int PageSize, string strCountyId, string strwhere)
        {
            PeterPages fy       = null;
            string     sqlwhere = " 1=1 ";

            //if (FileTransfer.FileClassID > 0)
            //{
            //    sqlwhere = sqlwhere + " and FileClassID like '%" + FileTransfer.FileClassID + "%' ";
            //}
            if (!string.IsNullOrEmpty(FileTransfer.FileEnterName))
            {
                sqlwhere = sqlwhere + " and FileEnterName like '%" + FileTransfer.FileEnterName + "%' ";
            }
            //获取开始日期和结束日期
            string startTime = FileTransfer.TransferDate.Split('|')[0];
            string endTime   = FileTransfer.TransferDate.Split('|')[1];

            if (startTime != "" && endTime != "" && FileTransfer.Lssjlx == 0)  //移交时间
            {
                sqlwhere = sqlwhere + @" and  ( convert(varchar,TransferDate, 120 )   between '" + startTime
                           + "' and  convert(char(10),dateadd(dd,1,'" + endTime + "'),120)) ";
            }
            if (startTime != "" && endTime != "" && FileTransfer.Lssjlx == 1)  //接收时间
            {
                sqlwhere = sqlwhere + @" and  ( convert(varchar,Jssj, 120 )   between '" + startTime
                           + "' and  convert(char(10),dateadd(dd,1,'" + endTime + "'),120)) ";
            }
            if (startTime != "" && endTime != "" && FileTransfer.Lssjlx == 2)  //归档时间
            {
                sqlwhere = sqlwhere + @" and  ( convert(varchar,Gdsj, 120 )   between '" + startTime
                           + "' and  convert(char(10),dateadd(dd,1,'" + endTime + "'),120)) ";
            }
            if (strCountyId != "420100")
            {
                sqlwhere = sqlwhere + " and SZQXDM ='" + strCountyId + "' ";
            }
            //数据状态 0 未接收  1拒收 2已接受 3已归档
            if (FileTransfer.SJZT == 3)
            {
                sqlwhere = sqlwhere + " and sjzt  in (2,3) ";
            }
            else if (FileTransfer.SJZT == 0)
            {
            }
            else
            {
                sqlwhere = sqlwhere + " and sjzt =" + (FileTransfer.SJZT - 1) + " ";
            }
            sqlwhere = sqlwhere + strwhere;
            PageInfoNew entity = new PageInfoNew();

            entity.Sqlwhere   = sqlwhere.Trim();
            entity.Tablename  = "[FileTransfer]";              //用户表,注意如果是多表可以写成视图进行查询,这里就为视图名称
            entity.PageSize   = PageSize;
            entity.Fieldkey   = "id";                          //主键
            entity.Orderfield = " sjzt asc,TransferDate desc"; //排序字段
            entity.PageIndex  = PageIndex;
            entity.Fields     = "*";

            fy = SqlPageList.GetPageLists(entity);
            return(fy);
        }