Esempio n. 1
0
        /// <summary>
        /// 根据查询条件获取某一条信息记录
        /// </summary>
        /// <param name="sw">参见模型</param>
        /// <returns>参见模型</returns>
        public static JC_INFRAREDCAMERA_BASICINFO_Model getModel(JC_INFRAREDCAMERA_BASICINFO_SW sw)
        {
            DataTable dt = BaseDT.JC_INFRAREDCAMERA_BASICINFO.getDT(sw);
            JC_INFRAREDCAMERA_BASICINFO_Model m = new JC_INFRAREDCAMERA_BASICINFO_Model();
            DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                                               //获取单位

            if (dt.Rows.Count > 0)
            {
                int i = 0;
                m.INFRAREDCAMERAID   = dt.Rows[i]["INFRAREDCAMERAID"].ToString();
                m.BYORGNO            = dt.Rows[i]["BYORGNO"].ToString();
                m.PHONE              = dt.Rows[i]["PHONE"].ToString();
                m.INFRAREDCAMERANAME = dt.Rows[i]["INFRAREDCAMERANAME"].ToString();
                m.PHONE              = dt.Rows[i]["PHONE"].ToString();
                m.JD      = dt.Rows[i]["JD"].ToString();
                m.WD      = dt.Rows[i]["WD"].ToString();
                m.GC      = dt.Rows[i]["GC"].ToString();
                m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString();
                m.PHONE   = dt.Rows[i]["PHONE"].ToString();
                m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, dt.Rows[i]["BYORGNO"].ToString());
            }

            dt.Clear();
            dt.Dispose();
            dtORG.Clear();
            dtORG.Dispose();
            return(m);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public static IEnumerable <JC_INFRAREDCAMERA_BASICINFO_Model> getListModel(JC_INFRAREDCAMERA_BASICINFO_SW sw, out int total)
        {
            DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                         //获取单位
            DataTable dt     = BaseDT.JC_INFRAREDCAMERA_BASICINFO.getDT(sw, out total); //列表
            var       result = new List <JC_INFRAREDCAMERA_BASICINFO_Model>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                JC_INFRAREDCAMERA_BASICINFO_Model m = new JC_INFRAREDCAMERA_BASICINFO_Model();
                m.INFRAREDCAMERAID   = dt.Rows[i]["INFRAREDCAMERAID"].ToString();
                m.BYORGNO            = dt.Rows[i]["BYORGNO"].ToString();
                m.PHONE              = dt.Rows[i]["PHONE"].ToString();
                m.INFRAREDCAMERANAME = dt.Rows[i]["INFRAREDCAMERANAME"].ToString();
                m.PHONE              = dt.Rows[i]["PHONE"].ToString();
                m.JD      = dt.Rows[i]["JD"].ToString();
                m.WD      = dt.Rows[i]["WD"].ToString();
                m.GC      = dt.Rows[i]["GC"].ToString();
                m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString();
                m.PHONE   = dt.Rows[i]["PHONE"].ToString();
                m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, dt.Rows[i]["BYORGNO"].ToString());
                result.Add(m);
            }
            dtORG.Clear();
            dtORG.Dispose();
            dt.Clear();
            dt.Dispose();
            return(result);
        }
        /// <summary>
        /// 获取相机列表
        /// </summary>
        /// <returns></returns>
        public JsonResult GetCamareaInfo()
        {
            MessageListObject msg = null;
            var sw   = new JC_INFRAREDCAMERA_BASICINFO_SW();
            var list = JC_INFRAREDCAMERACls.getListModel(sw);

            if (list.Count() > 0)
            {
                msg = new MessageListObject(true, list);
            }
            return(Json(msg));
        }
Esempio n. 4
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <returns>参见模型</returns>
        public static DataTable getDT(JC_INFRAREDCAMERA_BASICINFO_SW sw, out int total)
        {
            StringBuilder sb = new StringBuilder();


            sb.AppendFormat(" FROM      JC_INFRAREDCAMERA_BASICINFO a");
            sb.AppendFormat(" WHERE   1=1");
            if (string.IsNullOrEmpty(sw.INFRAREDCAMERAID) == false)
            {
                sb.AppendFormat(" AND INFRAREDCAMERAID = '{0}'", ClsSql.EncodeSql(sw.INFRAREDCAMERAID));
            }
            if (string.IsNullOrEmpty(sw.PHONE) == false)
            {
                sb.AppendFormat(" AND PHONE = '{0}'", ClsSql.EncodeSql(sw.PHONE));
            }
            if (string.IsNullOrEmpty(sw.BYORGNO) == false)
            {
                if (PublicCls.OrgIsShi(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like '{0}%'", PublicCls.getShiIncOrgNo(sw.BYORGNO));
                }
                else if (PublicCls.OrgIsXian(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like  '{0}%'", PublicCls.getXianIncOrgNo(sw.BYORGNO));
                }
                else if (PublicCls.OrgIsZhen(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like '{0}%'", PublicCls.getZhenIncOrgNo(sw.BYORGNO));
                }
                else
                {
                    sb.AppendFormat(" and BYORGNO = '{0}'", sw.BYORGNO);
                }
            }
            string sql = "SELECT    INFRAREDCAMERAID,BYORGNO,INFRAREDCAMERANAME,PHONE,JD,WD,GC,ADDRESS"
                         + sb.ToString()
                         + " order by BYORGNO";
            string sqlC = "select count(1) " + sb.ToString();

            total      = int.Parse(DataBaseClass.ReturnSqlField(sqlC));
            sw.curPage = PagerCls.getCurPage(new PagerSW {
                curPage = sw.curPage, pageSize = sw.pageSize, rowCount = total
            });
            DataSet ds = DataBaseClass.FullDataSet(sql, (sw.curPage - 1) * sw.pageSize, sw.pageSize, "a");

            return(ds.Tables[0]);
        }
Esempio n. 5
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns>参见模型</returns>
        public static DataTable getDT(JC_INFRAREDCAMERA_BASICINFO_SW sw)
        {
            StringBuilder sb = new StringBuilder();


            sb.AppendFormat(" FROM      JC_INFRAREDCAMERA_BASICINFO a");
            sb.AppendFormat(" WHERE   1=1");
            if (string.IsNullOrEmpty(sw.INFRAREDCAMERAID) == false)
            {
                sb.AppendFormat(" AND INFRAREDCAMERAID = '{0}'", ClsSql.EncodeSql(sw.INFRAREDCAMERAID));
            }
            if (string.IsNullOrEmpty(sw.PHONE) == false)
            {
                sb.AppendFormat(" AND PHONE = '{0}'", ClsSql.EncodeSql(sw.PHONE));
            }
            if (string.IsNullOrEmpty(sw.BYORGNO) == false)
            {
                if (PublicCls.OrgIsShi(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like '{0}%'", PublicCls.getShiIncOrgNo(sw.BYORGNO));
                }
                else if (PublicCls.OrgIsXian(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like  '{0}%'", PublicCls.getXianIncOrgNo(sw.BYORGNO));
                }
                else if (PublicCls.OrgIsZhen(sw.BYORGNO))
                {
                    sb.AppendFormat(" and BYORGNO like '{0}%'", PublicCls.getZhenIncOrgNo(sw.BYORGNO));
                }
                else
                {
                    sb.AppendFormat(" and BYORGNO = '{0}'", sw.BYORGNO);
                }
            }
            string sql = "SELECT    INFRAREDCAMERAID,BYORGNO,INFRAREDCAMERANAME,PHONE,JD,WD,GC,ADDRESS"
                         + sb.ToString()
                         + " order by BYORGNO";
            DataSet ds = DataBaseClass.FullDataSet(sql);

            return(ds.Tables[0]);
        }