Exemple #1
0
        /// <summary>
        /// 获取数据列表
        /// </summary>
        /// <param name="sw">参见条件模型CollectDataSW</param>
        /// <returns>参见模型CollectDataListModel</returns>
        public static IEnumerable <CollectDataListModel> get_CollectDataModelList(CollectDataSW sw)
        {
            var       result = new List <CollectDataListModel>();
            DataTable dt     = T_IPSCOL_COLLECTDATA.getUnionDT(sw);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                CollectDataListModel m = new CollectDataListModel();
                m.COLLECTID = long.Parse(dt.Rows[i]["COLLECTID"].ToString());
                m.HID       = int.Parse(dt.Rows[i]["HID"].ToString());
                m.LONGITUDE = (dt.Rows[i]["LONGITUDE"] == null) ? 0 : decimal.Parse(dt.Rows[i]["LONGITUDE"].ToString());
                m.LATITUDE  = (dt.Rows[i]["LATITUDE"] == null) ? 0 : decimal.Parse(dt.Rows[i]["LATITUDE"].ToString());
                //******************计算坐标偏移量
                string[] arr = PublicCls.switJWD(m.LATITUDE.ToString(), m.LONGITUDE.ToString());
                m.LATITUDE  = Convert.ToDecimal(arr[0]);
                m.LONGITUDE = Convert.ToDecimal(arr[1]);
                //******************计算坐标偏移量 End
                m.SYSTYPEVALUE = dt.Rows[i]["SYSTYPEVALUE"].ToString();
                m.COLLECTNAME  = dt.Rows[i]["COLLECTNAME"].ToString();
                m.ADDRESS      = dt.Rows[i]["ADDRESS"].ToString();
                //if (string.IsNullOrEmpty(Convert.ToString(dt.Rows[i]["HEIGHT"])))//判断是否是空值
                //{
                //    dt.Rows[i]["HEIGHT"] = 0;
                //}
                m.COLLECTTIME = Convert.ToDateTime(dt.Rows[i]["COLLECTTIME"].ToString());

                result.Add(m);
            }
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 根据ID获取明细
        /// </summary>
        /// <param name="sw">sw.REPORTID</param>
        /// <returns>参见模型</returns>
        public static IEnumerable <T_IPSRPT_REPORT_Model> getDetailModelList(T_IPSRPT_REPORT_SW sw)
        {
            var       result = new List <T_IPSRPT_REPORT_Model>();
            DataTable dt     = BaseDT.T_IPSRPT_REPORT.getDetailDT(new T_IPSRPT_REPORT_SW {
                REPORTID = sw.REPORTID
            });

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPSRPT_REPORT_Model m = new T_IPSRPT_REPORT_Model();

                m.REPORTDETAILID = dt.Rows[i]["REPORTDETAILID"].ToString();
                m.REPORTID       = dt.Rows[i]["REPORTID"].ToString();
                m.LONGITUDE      = dt.Rows[i]["LONGITUDE"].ToString();
                m.LATITUDE       = dt.Rows[i]["LATITUDE"].ToString();
                //******************计算坐标偏移量
                string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                m.LATITUDE  = arr[0];
                m.LONGITUDE = arr[1];
                //******************计算坐标偏移量 End
                m.HEIGHT    = dt.Rows[i]["HEIGHT"].ToString();
                m.DIRECTION = dt.Rows[i]["DIRECTION"].ToString();
                m.SBTIME    = ClsSwitch.SwitTM(dt.Rows[i]["SBTIME"].ToString());



                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Exemple #3
0
        /// <summary>
        /// 护林员周边
        /// </summary>
        /// <param name="sw">周边模型</param>
        /// <returns></returns>
        public static IEnumerable <T_IPS_REALDATATEMPORARYModel> getModelList(HlyAreaDataSW sw)
        {
            var       result = new List <T_IPS_REALDATATEMPORARYModel>();
            DataTable dt     = BaseDT.T_IPS_REALDATATEMPORARY.getDTByArea(sw);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPS_REALDATATEMPORARYModel m = new T_IPS_REALDATATEMPORARYModel();
                //m.REALDATAID = dt.Rows[i]["REALDATAID"].ToString();
                m.USERID       = dt.Rows[i]["USERID"].ToString();
                m.LONGITUDE    = dt.Rows[i]["LONGITUDE"].ToString();
                m.LATITUDE     = dt.Rows[i]["LATITUDE"].ToString();
                m.ORILONGITUDE = dt.Rows[i]["LONGITUDE"].ToString(); //原始经度
                m.ORILATITUDE  = dt.Rows[i]["LATITUDE"].ToString();  //原始纬度
                if (sw.MapType != "Skyline")
                {
                    //******************计算坐标偏移量
                    string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                    m.LATITUDE  = arr[0];
                    m.LONGITUDE = arr[1];
                    //******************计算坐标偏移量 End
                }
                m.HEIGHT    = dt.Rows[i]["HEIGHT"].ToString();
                m.ELECTRIC  = dt.Rows[i]["ELECTRIC"].ToString();
                m.SPEED     = dt.Rows[i]["SPEED"].ToString();
                m.DIRECTION = dt.Rows[i]["DIRECTION"].ToString();
                m.SBTIME    = dt.Rows[i]["SBTIME"].ToString();
                if (string.IsNullOrEmpty(m.SBTIME) == false)
                {
                    m.SBTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.SBTIME);
                }
                m.NOTE   = dt.Rows[i]["NOTE"].ToString();
                m.ORGNO  = dt.Rows[i]["ORGNO"].ToString();
                m.SBDATE = dt.Rows[i]["SBDATE"].ToString();
                if (string.IsNullOrEmpty(m.SBDATE) == false)
                {
                    m.SBDATE = PublicClassLibrary.ClsSwitch.SwitDate(m.SBDATE);
                }
                m.SBTIMEBEGIN  = dt.Rows[i]["SBTIMEBEGIN"].ToString();
                m.PATROLLENGTH = dt.Rows[i]["PATROLLENGTH"].ToString();

                result.Add(m);
            }
            return(result);
        }
Exemple #4
0
        /// <summary>
        /// 根据电话号码获取实时传输数据
        /// </summary>
        /// <example>
        /// sw.SearchTime   查询日期,查询某日的电量信息
        /// sw.USERID       护林员序号(多序号以逗号分隔)
        /// sw.DateBegin    开始日期
        /// sw.DateEnd      结束日期
        /// </example>
        /// <param name="sw">参见条件模型T_IPS_REALDATASW</param>
        /// <returns>参见模型T_IPS_REALDATAModel</returns>
        public static IEnumerable <T_IPS_REALDATAModel> getModelList(T_IPS_REALDATASW sw)
        {
            var       result = new List <T_IPS_REALDATAModel>();
            DataTable dt     = BaseDT.T_IPS_REALDATA.getDT(sw);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPS_REALDATAModel m = new T_IPS_REALDATAModel();
                m.REALDATAID = dt.Rows[i]["REALDATAID"].ToString();
                m.PHONE      = dt.Rows[i]["PHONE"].ToString();
                m.LONGITUDE  = dt.Rows[i]["LONGITUDE"].ToString(); //经度
                m.LATITUDE   = dt.Rows[i]["LATITUDE"].ToString();  //纬度
                if (sw.MapType != "Skyline")
                {
                    //******************计算坐标偏移量
                    string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                    m.LATITUDE  = arr[0];
                    m.LONGITUDE = arr[1];
                    //******************计算坐标偏移量 End
                }
                m.HEIGHT    = dt.Rows[i]["HEIGHT"].ToString();
                m.ELECTRIC  = dt.Rows[i]["ELECTRIC"].ToString();
                m.SPEED     = dt.Rows[i]["SPEED"].ToString();
                m.DIRECTION = dt.Rows[i]["DIRECTION"].ToString();
                m.SBTIME    = dt.Rows[i]["SBTIME"].ToString();
                if (string.IsNullOrEmpty(m.SBTIME) == false)
                {
                    m.SBTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.SBTIME);
                }
                m.NOTE = dt.Rows[i]["NOTE"].ToString();


                result.Add(m);
            }
            //dtHUser.Clear();
            //dtHUser.Dispose();
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Exemple #5
0
        /// <summary>
        /// 根据ID获取明细
        /// </summary>
        /// <param name="sw">sw.COLLECTID</param>
        /// <returns>参见模型T_IPSCOL_COLLECT_Model</returns>
        public static IEnumerable <T_IPSCOL_COLLECT_Model> getDetailModelList(T_IPSCOL_COLLECT_SW sw)
        {
            var       result = new List <T_IPSCOL_COLLECT_Model>();
            DataTable dt     = BaseDT.T_IPSCOL_COLLECT.getDetailDT(new T_IPSCOL_COLLECT_SW {
                COLLECTID = sw.COLLECTID
            });

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPSCOL_COLLECT_Model m = new T_IPSCOL_COLLECT_Model();

                m.COLLECTDETAILID = dt.Rows[i]["COLLECTDETAILID"].ToString();
                m.COLLECTID       = dt.Rows[i]["COLLECTID"].ToString();
                m.LONGITUDE       = dt.Rows[i]["LONGITUDE"].ToString();
                m.LATITUDE        = dt.Rows[i]["LATITUDE"].ToString();
                m.ORILONGITUDE    = dt.Rows[i]["LONGITUDE"].ToString(); //原始经度
                m.ORILATITUDE     = dt.Rows[i]["LATITUDE"].ToString();  //原始纬度
                //******************计算坐标偏移量
                if (sw.MapType != "Skyline")
                {
                    string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                    m.LATITUDE  = arr[0];
                    m.LONGITUDE = arr[1];
                }
                //******************计算坐标偏移量 End
                m.HEIGHT      = dt.Rows[i]["HEIGHT"].ToString();
                m.DIRECTION   = dt.Rows[i]["DIRECTION"].ToString();
                m.COLLECTTIME = PublicClassLibrary.ClsSwitch.SwitTM(dt.Rows[i]["COLLECTTIME"].ToString());


                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Exemple #6
0
        /// <summary>
        /// 获取一条数据
        /// </summary>
        /// <example>
        /// sw.ALARMID       报警ID
        /// </example>
        /// <param name="sw">参见条件模型T_IPS_ALARM_SW</param>
        /// <returns>参见模型T_IPS_ALARM_Model</returns>
        public static T_IPS_ALARM_Model getModel(T_IPS_ALARM_SW sw)
        {
            DataTable         dt = BaseDT.T_IPS_ALARM.getDT(sw);
            T_IPS_ALARM_Model m  = new T_IPS_ALARM_Model();

            if (dt.Rows.Count > 0)
            {
                int i = 0;
                m.ALARMID   = dt.Rows[i]["ALARMID"].ToString();
                m.LONGITUDE = dt.Rows[i]["LONGITUDE"].ToString();
                m.LATITUDE  = dt.Rows[i]["LATITUDE"].ToString();
                //******************计算坐标偏移量
                string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                m.LATITUDE  = arr[0];
                m.LONGITUDE = arr[1];
                //******************计算坐标偏移量 End
                m.HEIGHT    = dt.Rows[i]["HEIGHT"].ToString();
                m.PHONE     = dt.Rows[i]["PHONE"].ToString();
                m.ADDRESS   = dt.Rows[i]["ADDRESS"].ToString();
                m.ALARMTIME = dt.Rows[i]["ALARMTIME"].ToString();
                if (string.IsNullOrEmpty(m.ALARMTIME) == false)
                {
                    m.ALARMTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.ALARMTIME);
                }
                m.ALARMCONTENT = dt.Rows[i]["ALARMCONTENT"].ToString();
                m.MANSTATE     = dt.Rows[i]["MANSTATE"].ToString();
                m.MANRESULT    = dt.Rows[i]["MANRESULT"].ToString();
                m.MANTIME      = dt.Rows[i]["MANTIME"].ToString();
                if (string.IsNullOrEmpty(m.MANTIME) == false)
                {
                    m.MANTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.MANTIME);
                }
                m.MANUSERID = dt.Rows[i]["MANUSERID"].ToString();

                DataTable dtHRUser = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW {
                    PHONE = m.PHONE
                });
                DataTable dtUser = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW {
                    USERID = m.MANUSERID
                });
                DataRow[] drHRUser = dtHRUser.Select("PHONE='" + m.PHONE + "'");
                if (drHRUser.Length > 0)
                {
                    m.OrgNoName = drHRUser[0]["ORGNAME"].ToString();
                    m.HName     = drHRUser[0]["HNAME"].ToString();
                    m.HID       = drHRUser[0]["HID"].ToString();
                    m.OrgNo     = drHRUser[0]["BYORGNO"].ToString();
                }

                if (!string.IsNullOrEmpty(m.MANUSERID))
                {
                    DataRow[] drUser = dtUser.Select("USERID='" + m.MANUSERID + "'");
                    if (drUser.Length > 0)
                    {
                        m.ManUserName = drUser[0]["USERNAME"].ToString();
                    }
                }
                dtUser.Clear();
                dtUser.Dispose();
                dtHRUser.Clear();
                dtHRUser.Dispose();

                ////权限获取
                //var userid = SystemCls.getUserID();
                //var rightsw = new T_SYSSEC_IPSUSER_SW();
                //rightsw.USERID = userid;
                //m.Rights = T_SYSSEC_RIGHTCls.getRightStrByUID(rightsw);
            }
            dt.Clear();
            dt.Dispose();
            return(m);
        }
Exemple #7
0
        /// <summary>
        /// 获取多条数据
        /// </summary>
        /// <example>
        /// sw.orgNo            机构编码,用于获取该机构编码下所有的采集信息
        /// sw.MANSTATE       处理状态 0未处理1已处理
        /// sw.DateBegin    开始日期
        /// sw.DateEnd      结束日期
        /// </example>
        /// <param name="sw">参见条件模型T_IPSCOL_COLLECT_SW</param>
        /// <returns>参见模型T_IPSCOL_COLLECT_Model</returns>
        public static IEnumerable <T_IPSCOL_COLLECT_Model> getModelList(T_IPSCOL_COLLECT_SW sw)
        {
            DataTable dtHRUser = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW {
                BYORGNO = sw.orgNo
            });
            DataTable dtUser        = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW {
            });
            DataTable dtCollectType = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW {
                DICTFLAG = "数据采集"
            });
            var       result = new List <T_IPSCOL_COLLECT_Model>();
            DataTable dt     = null;

            if (sw.UnionHUser)
            {
                dt = BaseDT.T_IPSCOL_COLLECT.getDtUnionHUser(sw); //关联护林员表
            }
            else
            {
                dt = BaseDT.T_IPSCOL_COLLECT.getDT(sw);
            }
            string IDList = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (i > 0)
                {
                    IDList += ",";
                }
                IDList += dt.Rows[i]["COLLECTID"].ToString();
            }
            DataTable dtDetail = BaseDT.T_IPSCOL_COLLECT.getDetailDT(new T_IPSCOL_COLLECT_SW {
                COLLECTID = IDList
            });
            DataTable dtUpload = BaseDT.T_IPSCOL_COLLECT.getUploadDT(new T_IPSCOL_COLLECT_SW {
                COLLECTID = IDList
            });

            //var userid = SystemCls.getUserID();
            //var rightsw = new T_SYSSEC_IPSUSER_SW();
            //rightsw.USERID = userid;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPSCOL_COLLECT_Model m = new T_IPSCOL_COLLECT_Model();

                m.HID          = dt.Rows[i]["HID"].ToString();
                m.COLLECTID    = dt.Rows[i]["COLLECTID"].ToString();
                m.SYSTYPEVALUE = dt.Rows[i]["SYSTYPEVALUE"].ToString();
                m.SYSTYPEName  = BaseDT.T_SYS_DICT.getName(dtCollectType, m.SYSTYPEVALUE);
                m.ADDRESS      = dt.Rows[i]["ADDRESS"].ToString();
                m.COLLECTTIME  = ClsSwitch.SwitTM(dt.Rows[i]["COLLECTTIME"].ToString());
                m.COLLECTNAME  = dt.Rows[i]["COLLECTNAME"].ToString();
                m.MANSTATE     = dt.Rows[i]["MANSTATE"].ToString();
                m.MANRESULT    = dt.Rows[i]["MANRESULT"].ToString();
                m.MANTIME      = ClsSwitch.SwitTM(dt.Rows[i]["MANTIME"].ToString());
                m.MANUSERID    = dt.Rows[i]["MANUSERID"].ToString();
                DataRow[] drDetail = dtDetail.Select("COLLECTID='" + m.COLLECTID + "'", "COLLECTTIME");
                if (drDetail.Length > 0)
                {
                    m.COLLECTDETAILID = drDetail[0]["COLLECTDETAILID"].ToString();
                    m.LONGITUDE       = drDetail[0]["LONGITUDE"].ToString();
                    m.LATITUDE        = drDetail[0]["LATITUDE"].ToString();
                    if (sw.MapType != "Skyline")
                    {
                        //******************计算坐标偏移量
                        string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                        m.LATITUDE  = arr[0];
                        m.LONGITUDE = arr[1];
                        //******************计算坐标偏移量 End
                    }
                    m.HEIGHT    = drDetail[0]["HEIGHT"].ToString();
                    m.DIRECTION = drDetail[0]["DIRECTION"].ToString();
                    // m.COLLECTTIME = ClsSwitch.SwitTM(drDetail[0]["COLLECTTIME"].ToString());
                }

                DataRow[] drUpload = dtUpload.Select("COLLECTID='" + m.COLLECTID + "'", "COLLECTUPLOADID");
                if (drUpload.Length > 0)
                {
                    m.COLLECTUPLOADID = drUpload[0]["COLLECTUPLOADID"].ToString();
                    m.UPLOADURL       = drUpload[0]["UPLOADURL"].ToString();
                    m.UPLOADNAME      = drUpload[0]["UPLOADNAME"].ToString();
                    m.UPLOADDESCRIBE  = drUpload[0]["UPLOADDESCRIBE"].ToString();
                }

                DataRow[] drHRUser = dtHRUser.Select("HID='" + m.HID + "'");
                if (drHRUser.Length > 0)
                {
                    m.OrgNoName = drHRUser[0]["ORGNAME"].ToString();
                    m.HName     = drHRUser[0]["HNAME"].ToString();
                    m.Phone     = drHRUser[0]["PHONE"].ToString();
                    m.OrgNo     = drHRUser[0]["BYORGNO"].ToString();
                    m.Phone     = drHRUser[0]["PHONE"].ToString();
                }
                if (!string.IsNullOrEmpty(m.MANUSERID))
                {
                    DataRow[] drUser = dtUser.Select("USERID='" + m.MANUSERID + "'");
                    if (drUser.Length > 0)
                    {
                        m.ManUserName = drUser[0]["USERNAME"].ToString();
                    }
                }
                //权限获取
                //m.Rights = T_SYSSEC_RIGHTCls.getRightStrByUID(rightsw);
                result.Add(m);
            }
            dtUser.Clear();
            dtUser.Dispose();
            dtHRUser.Clear();
            dtHRUser.Dispose();
            dtDetail.Clear();
            dtDetail.Dispose();
            dtUpload.Clear();
            dtUpload.Dispose();
            dtCollectType.Clear();
            dtCollectType.Dispose();
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Exemple #8
0
        /// <summary>
        /// 护林员定位 获取护林员最新一条位置信息
        /// </summary>
        /// <param name="sw">传递护林员列表 参见条件模型T_IPS_REALDATATEMPORARYSW</param>
        /// <returns>参见模型T_IPS_REALDATATEMPORARYModel</returns>
        public static IEnumerable <T_IPS_REALDATATEMPORARYModel> getTopOneModelList(T_IPS_REALDATATEMPORARYSW sw)
        {
            var       result = new List <T_IPS_REALDATATEMPORARYModel>();
            DataTable dt     = BaseDT.T_IPS_REALDATATEMPORARY.getTopOneDT(sw);
            DataTable dtOrg  = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                                               //获取当前登录用户有权限查看的组织机构
            DataTable dtFRUser = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW {
                ISENABLE = "1", HID = sw.USERID
            });                                                                                                     //获取所有有权限查看的护林员

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                T_IPS_REALDATATEMPORARYModel m = new T_IPS_REALDATATEMPORARYModel();
                //m.REALDATAID = dt.Rows[i]["REALDATAID"].ToString();
                m.USERID       = dt.Rows[i]["USERID"].ToString();
                m.LONGITUDE    = dt.Rows[i]["LONGITUDE"].ToString();
                m.LATITUDE     = dt.Rows[i]["LATITUDE"].ToString();
                m.ORILONGITUDE = dt.Rows[i]["LONGITUDE"].ToString(); //原经度
                m.ORILATITUDE  = dt.Rows[i]["LATITUDE"].ToString();  //原纬度
                if (sw.MapType != "Skyline")
                {
                    //******************计算坐标偏移量
                    string[] arr = PublicCls.switJWD(m.LATITUDE, m.LONGITUDE);
                    m.LATITUDE  = arr[0];
                    m.LONGITUDE = arr[1];
                    //******************计算坐标偏移量 End
                }
                m.HEIGHT    = dt.Rows[i]["HEIGHT"].ToString();
                m.ELECTRIC  = dt.Rows[i]["ELECTRIC"].ToString();
                m.SPEED     = dt.Rows[i]["SPEED"].ToString();
                m.DIRECTION = dt.Rows[i]["DIRECTION"].ToString();
                m.SBTIME    = dt.Rows[i]["SBTIME"].ToString();
                if (string.IsNullOrEmpty(m.SBTIME) == false)
                {
                    m.SBTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.SBTIME);
                }
                m.NOTE      = dt.Rows[i]["NOTE"].ToString();
                m.ORGNO     = dt.Rows[i]["ORGNO"].ToString();
                m.SBDATE    = dt.Rows[i]["SBDATE"].ToString();
                m.ISOUTRAIL = dt.Rows[i]["ISOUTRAIL"].ToString();//是否出围
                if (string.IsNullOrEmpty(m.SBDATE) == false)
                {
                    m.SBDATE = PublicClassLibrary.ClsSwitch.SwitDate(m.SBDATE);
                }
                m.SBTIMEBEGIN  = dt.Rows[i]["SBTIMEBEGIN"].ToString();
                m.PATROLLENGTH = dt.Rows[i]["PATROLLENGTH"].ToString();
                DataRow[] drFRUser = dtFRUser.Select("HID=" + m.USERID);
                if (drFRUser.Length > 0)
                {
                    m.HNAME   = drFRUser[0]["HNAME"].ToString();
                    m.PHONE   = drFRUser[0]["PHONE"].ToString();
                    m.ORGNO   = drFRUser[0]["BYORGNO"].ToString();
                    m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtOrg, m.ORGNO);
                }
                double intervalTime = ConfigCls.inLineTimeInterval();
                var    absTime      = Math.Abs(ClsStr.getMinutesDiff(DateTime.Now, m.SBTIME));
                m.HSTATE = absTime > intervalTime ? "0" : "1";//护林员在线状态 0 表示离线 1 表示在线

                //
                //m.ISOUTRAIL
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            dtOrg.Clear();
            dtOrg.Dispose();
            dtFRUser.Clear();
            dtFRUser.Dispose();

            return(result);
        }
Exemple #9
0
        /// <summary>
        /// 获取一条数据
        /// </summary>
        /// <example>
        /// sw.ALARMID       热点ID
        /// </example>
        /// <param name="sw">参见条件模型T_IPS_HOTS_SW</param>
        /// <returns>参见模型T_IPS_HOTS_Model</returns>
        public static T_IPS_HOTS_Model getModel(T_IPS_HOTS_SW sw)
        {
            DataTable        dt = BaseDT.T_IPS_HOTS.getDT(sw);
            T_IPS_HOTS_Model m  = new T_IPS_HOTS_Model();

            if (dt.Rows.Count > 0)
            {
                int i = 0;
                m.HOTSID = dt.Rows[i]["HOTSID"].ToString();
                m.BH     = dt.Rows[i]["BH"].ToString();
                m.WXBH   = dt.Rows[i]["WXBH"].ToString();
                m.DQRDBH = dt.Rows[i]["DQRDBH"].ToString();
                m.HLY    = dt.Rows[i]["HLY"].ToString();
                m.ZQWZ   = dt.Rows[i]["ZQWZ"].ToString();
                m.JD     = dt.Rows[i]["JD"].ToString();
                m.WD     = dt.Rows[i]["WD"].ToString();
                //******************计算坐标偏移量
                string[] arr = PublicCls.switJWD(m.WD, m.JD);
                m.WD = arr[0];
                m.JD = arr[1];
                //******************计算坐标偏移量 End
                m.XS     = dt.Rows[i]["XS"].ToString();
                m.DL     = dt.Rows[i]["DL"].ToString();
                m.YY     = dt.Rows[i]["YY"].ToString();
                m.JXHQSJ = dt.Rows[i]["JXHQSJ"].ToString();
                m.FXSJ   = dt.Rows[i]["FXSJ"].ToString();
                if (string.IsNullOrEmpty(m.FXSJ) == false)
                {
                    m.FXSJ = PublicClassLibrary.ClsSwitch.SwitTM(m.FXSJ);
                }
                m.SBSJ = dt.Rows[i]["SBSJ"].ToString();
                if (string.IsNullOrEmpty(m.SBSJ) == false)
                {
                    m.SBSJ = PublicClassLibrary.ClsSwitch.SwitTM(m.SBSJ);
                }
                m.BZW       = dt.Rows[i]["BZW"].ToString();
                m.FJBH      = dt.Rows[i]["FJBH"].ToString();
                m.WLBH      = dt.Rows[i]["WLBH"].ToString();
                m.XZQH      = dt.Rows[i]["XZQH"].ToString();
                m.CZW       = dt.Rows[i]["CZW"].ToString();
                m.MANSTATE  = dt.Rows[i]["MANSTATE"].ToString();
                m.MANRESULT = dt.Rows[i]["MANRESULT"].ToString();
                m.MANTIME   = dt.Rows[i]["MANTIME"].ToString();
                m.MANUSERID = dt.Rows[i]["MANUSERID"].ToString();

                if (!string.IsNullOrEmpty(m.MANUSERID))
                {
                    DataTable dtUser = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW {
                        USERID = m.MANUSERID
                    });
                    DataRow[] drUser = dtUser.Select("USERID='" + m.MANUSERID + "'");
                    if (drUser.Length > 0)
                    {
                        m.ManUserName = drUser[0]["USERNAME"].ToString();
                    }

                    dtUser.Clear();
                    dtUser.Dispose();
                }
                //权限获取
                //var userid = SystemCls.getUserID();
                //var rightsw = new T_SYSSEC_IPSUSER_SW();
                //rightsw.USERID = userid;
                //m.Rights = T_SYSSEC_RIGHTCls.getRightStrByUID(rightsw);
            }
            dt.Clear();
            dt.Dispose();
            return(m);
        }