Пример #1
0
        /// <summary>
        /// 设备类型查询
        /// </summary>
        /// <param name="ID">自动增量编号</param>
        /// <param name="DEVID">设备编号</param>
        /// <param name="DEVNAME">设备名称</param>
        /// <param name="DEVTYPE">设备类型</param>
        /// <param name="PageCount">单页记录数</param>
        /// <param name="CurrPage">当前页</param>
        /// <param name="dtRet">查询内容记录表</param>
        /// <param name="dtRetInfo">查询辅助信息记录表{总记录数,总页数}</param>
        public static void Devinfo_Query(int ID, string DEVID, string DEVNAME, string DEVTYPE,
                                         int PageCount, int CurrPage, ref DataTable dtRet, ref DataTable dtRetInfo)
        {
            try
            {
                string strsql = "";

                if ((DEVID != null) && (DEVNAME != null))
                {
                    strsql = "devno like" + "\'%" + DEVID.ToString() + "%\'" + " and " + "name like " + "\'%" + DEVNAME + "%\'";
                }
                else
                {
                    if (DEVID != null)
                    {
                        strsql = " devno like" + "\'%" + DEVID.ToString() + "%\' ";
                    }
                    if (DEVNAME != null)
                    {
                        strsql = " name like " + "\'%" + DEVNAME + "%\' ";
                    }
                }
                if (DEVTYPE != null)
                {
                    strsql = " devid=" + DEVTYPE.ToString();
                }
                if (ID > 0)
                {
                    strsql = " id=" + ID.ToString();
                }
                DALPages.SQLPages sp = new DALPages.SQLPages();
                //sp.FIELDS = "id AS ID,devid as DTID,IFNULL(devname,'') as DTNAME";
                sp.FIELDS      = "id as ID,devno as DEVID,name as DEVNAME,devid as DEVTYPE,ip as IP,port as PORT,updevid as UPDEVID,remark as DESCR";
                sp.CURRENTPAGE = CurrPage;
                sp.ORDERTYPE   = 0;
                sp.PAGESIZE    = PageCount;
                sp.SQLWHERE    = strsql; // "";
                sp.STRORDERBY  = "id";   // " ID DESC ";
                sp.TABLENAME   = "t_devinfo";
                sp.ORDERBYNAME = "id";
                DataSet ds = sp.ds(CommClass.DBCONN, "sp_PageCommand");

                if (ds.Tables.Count <= 0)
                {
                    dtRet     = null;
                    dtRetInfo = null;
                }
                else
                {
                    dtRet     = ds.Tables[0].Copy();
                    dtRetInfo = ds.Tables[1].Copy();
                }
            }
            catch (Exception ex)
            {
                Commonality.ConsoleManage.Write(Commonality.ErrorLevel.Serious, "KOIPMonitor>>DevinfoQuery>>Devinfo_Query>>", ex.Message);
            }
        }
Пример #2
0
        /// <summary>
        /// 设备类型查询
        /// </summary>
        /// <param name="STARTDATE">开始时间</param>
        /// <param name="ENDDATE">结束时间</param>
        /// <param name="PageCount">单页记录数</param>
        /// <param name="CurrPage">当前页</param>
        /// <param name="dtRet">查询内容记录表</param>
        /// <param name="dtRetInfo">查询辅助信息记录表{总记录数,总页数}</param>
        public static void AlarmLog_Query(string STARTDATE, string ENDDATE,
                                          int PageCount, int CurrPage, ref DataTable dtRet, ref DataTable dtRetInfo)
        {
            try
            {
                string strsql = "";

                if ((STARTDATE != null) && (ENDDATE != null))
                {
                    strsql = "alarmdate >" + "\'" + STARTDATE.ToString() + "\'" + " and " + "alarmdate < " + "\'" + ENDDATE.ToString() + "\'";
                }
                else
                {
                    if (STARTDATE != null)
                    {
                        strsql = "alarmdate >" + "\'" + STARTDATE.ToString() + "\'";
                    }
                    if (ENDDATE != null)
                    {
                        strsql = "alarmdate < " + "\'" + ENDDATE.ToString() + "\'";
                    }
                }

                DALPages.SQLPages sp = new DALPages.SQLPages();
                sp.FIELDS      = " id as ID,alarmdate as ALARMDATE,devid as DEVID,descr as DESCR";
                sp.CURRENTPAGE = CurrPage;
                sp.ORDERTYPE   = 0;
                sp.PAGESIZE    = PageCount;
                sp.SQLWHERE    = strsql; // "";
                sp.STRORDERBY  = "id";   // " ID DESC ";
                sp.TABLENAME   = "t_alarmlog";
                sp.ORDERBYNAME = "id";
                DataSet ds = sp.ds(CommClass.DBCONN, "sp_PageCommand");

                if (ds.Tables.Count <= 0)
                {
                    dtRet     = null;
                    dtRetInfo = null;
                }
                else
                {
                    dtRet     = ds.Tables[0].Copy();
                    dtRetInfo = ds.Tables[1].Copy();
                }
            }
            catch (Exception ex)
            {
                Commonality.ConsoleManage.Write(Commonality.ErrorLevel.Serious, "KOIPMonitor>>AlarmLogQuery>>AlarmLog_Query>>", ex.Message);
            }
        }
Пример #3
0
        /// <summary>
        /// 用户查询
        /// </summary>
        /// <param name="ID">自动增量ID编号</param>
        /// <param name="USERID">用户编号</param>
        /// <param name="PageCount">单页记录数</param>
        /// <param name="CurrPage">当前页</param>
        /// <param name="dtRet">查询内容记录表</param>
        /// <param name="dtRetInfo">查询辅助信息记录表{总记录数,总页数}</param>
        public static void UserInfo_Query(int ID, string USERID,
                                          int PageCount, int CurrPage, ref DataTable dtRet, ref DataTable dtRetInfo)
        {
            try
            {
                string strsql = "";


                if (USERID != null)
                {
                    strsql = " userid like" + "\'%" + USERID + "%\' ";
                }


                if (ID > 0)
                {
                    strsql = " id=" + ID.ToString();
                }
                DALPages.SQLPages sp = new DALPages.SQLPages();

                sp.FIELDS      = "id as ID,userid as USERID, name as USERNAME,email as EMAIL,isemail as ISEMAIL,mobile as MOBILE, ismobile as ISMOBILE,uroles as ROLES,password  as USERPWD";
                sp.CURRENTPAGE = CurrPage;
                sp.ORDERTYPE   = 0;
                sp.PAGESIZE    = PageCount;
                sp.SQLWHERE    = strsql; // "";
                sp.STRORDERBY  = "id";   // " ID DESC ";
                sp.TABLENAME   = "t_userinfo";
                sp.ORDERBYNAME = "id";
                DataSet ds = sp.ds(CommClass.DBCONN, "sp_PageCommand");

                if (ds.Tables.Count <= 0)
                {
                    dtRet     = null;
                    dtRetInfo = null;
                }
                else
                {
                    dtRet     = ds.Tables[0].Copy();
                    dtRetInfo = ds.Tables[1].Copy();
                }
            }
            catch (Exception ex)
            {
                Commonality.ConsoleManage.Write(Commonality.ErrorLevel.Serious, "KOIPMonitor>>UserInfoQuery>>UserInfo_Query>>", ex.Message);
            }
        }