Esempio n. 1
0
        public User[] GetUsers(int pageSize, int pageIndex, string tableName)
        {
            //DataTable table = OleDbHelper.ExecuteDataTable("Main", "select * from [用户资料]");

            //User[] users = new User[table.Rows.Count];
            //for (int i = 0; i < table.Rows.Count; i++)
            //{
            //    DataRow row = table.Rows[i];

            //    users[i] = ToUser(row);
            //}
            //return users;

            DataPageDAL dataPage = new DataPageDAL();

            dataPage.PageSize       = pageSize;
            dataPage.TableName      = "用户资料";
            dataPage.PageIndex      = pageIndex;
            dataPage.QueryFieldName = " * ";
            dataPage.OrderStr       = "[主机编号]";
            dataPage.PrimaryKey     = "[主机编号]";
            DataTable table = dataPage.QueryDataTable("Main");

            pageCount = dataPage.PageCount;

            User[] users = new User[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                DataRow row = table.Rows[i];

                users[i] = ToUser(row);
            }
            return(users);
        }
Esempio n. 2
0
        public User[] GetUsersDataTable(string DBName, string tableName, int pageSize, int pageIndex)
        {
            //DataPageDAL dataPage = new DataPageDAL();
            //dataPage.PageSize = pageSize;
            //dataPage.TableName = "用户资料";
            //dataPage.PageIndex = pageIndex;
            //dataPage.QueryFieldName = " 用户名称,用户地址,主机编号,用户类型,用户状态 ";
            //dataPage.OrderStr = "[主机编号]";
            //dataPage.PrimaryKey = "[主机编号]";
            //DataTable table = dataPage.QueryDataTable(DBName);
            //pageCount = dataPage.PageCount;
            //return table;

            DataPageDAL dataPage = new DataPageDAL();

            dataPage.PageSize       = pageSize;
            dataPage.TableName      = "用户资料";
            dataPage.PageIndex      = pageIndex;
            dataPage.QueryFieldName = " 序号,主机编号,用户名称,用户地址,安装单位,安装日期,安装人员,主机类型,主机状态,通讯格式,备注说明,故障状态,用户类型,合同期限,收费标准,最后一条事件时间 ";
            dataPage.OrderStr       = "[序号]";
            dataPage.PrimaryKey     = "[序号]";
            DataTable table = dataPage.QueryDataTable(DBName);

            pageCount = dataPage.PageCount;
            User[] users = new User[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                DataRow row = table.Rows[i];

                users[i] = ToUser(row);
            }
            return(users);
        }
Esempio n. 3
0
        public DataTable GetMessagesDataTable(string DBName, string tableName, int pageSize, int pageIndex)
        {
            DataPageDAL dataPage = new DataPageDAL();

            dataPage.PageSize       = pageSize;
            dataPage.TableName      = tableName;
            dataPage.PageIndex      = pageIndex;
            dataPage.QueryFieldName = " * ";
            dataPage.OrderStr       = "[AUTO]";
            dataPage.PrimaryKey     = "[AUTO]";
            DataTable table = dataPage.QueryDataTable(DBName);

            pageCount = dataPage.PageCount;
            return(table);
        }
Esempio n. 4
0
        public DataTable GetReceiversDataTable(string DBName, string tableName, int pageSize, int pageIndex)
        {
            DataPageDAL dataPage = new DataPageDAL();

            dataPage.PageSize       = pageSize;
            dataPage.TableName      = "串口设置";
            dataPage.PageIndex      = pageIndex;
            dataPage.QueryFieldName = " 序号,串口序号,接警机名,接警机类型,版本号,波特率,数据位,停止位,流控制,校验,结束代码,握手代码,连接检查间隔,是否检查连接,备注 ";
            dataPage.OrderStr       = "[序号]";
            dataPage.PrimaryKey     = "[序号]";
            DataTable table = dataPage.QueryDataTable(DBName);

            pageCount = dataPage.PageCount;
            return(table);
        }
Esempio n. 5
0
        public Receiver[] GetReceivers(int pageSize, int pageIndex, string tableName)
        {
            DataPageDAL dataPage = new DataPageDAL();

            dataPage.PageSize       = pageSize;
            dataPage.TableName      = "串口设置";
            dataPage.PageIndex      = pageIndex;
            dataPage.QueryFieldName = " * ";
            dataPage.OrderStr       = "[序号]";
            dataPage.PrimaryKey     = "[序号]";
            DataTable table = dataPage.QueryDataTable("Main");

            pageCount = dataPage.PageCount;

            Receiver[] receivers = new Receiver[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                DataRow row = table.Rows[i];

                receivers[i] = ToReceiver(row);
            }
            return(receivers);
        }