示例#1
0
 /// <summary>
 /// 三维添加
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Add(TD_MOUNTAIN_Model m)
 {
     if (PublicCls.OrgIsZhen(m.BYORGNO) == false)
     {
         return(new Message(false, "添加失败,请选择所属乡镇!", ""));
     }
     if (TD_MOUNTAIN.isPExists(new TD_MOUNTAIN_Model {
         JD = m.JD, WD = m.WD
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into MOUNTAIN(NAME,BYORGNO,BYORGNOXS,DISPLAY_X,DISPLAY_Y,Shape,VILLAGE,TYPE) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.BYORGNO));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.BYORGNOXS));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0},", m.Shape);
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.VILLAGE));
         sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
         }
     }
     else
     {
         return(new Message(false, "已有相同地址的山,请重新选择地址", ""));
     }
 }
示例#2
0
        /// <summary>
        /// 添加三维库
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <param name="emid">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message AddSHIPINGJIANKONG(JC_MONITOR_BASICINFO_Model m, string emid)
        {
            if (PublicCls.OrgIsZhen(m.BYORGNO) == false)
            {
                return(new Message(false, "添加失败,所属单位必须为乡镇!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("insert into SHIPINGJIANKONG(OBJECTID,BYORGNO,NAME,JD,WD,Shape,ADDRESS) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(emid));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.EMNAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
            sb.AppendFormat("{0},", m.Shape);
            sb.AppendFormat("{0})", ClsSql.saveNullField(m.ADDRESS));

            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
示例#3
0
        /// <summary>
        /// 三维-修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Mdy(TD_POINTMARK_Model m)
        {
            if (PublicCls.OrgIsZhen(m.BYORGNO) == false)
            {
                return(new Message(false, "添加失败,所属单位必须为乡镇!", ""));
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE CUNZHUDI");
            sb.AppendFormat(" set ");
            sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",MAPNAME={0}", ClsSql.saveNullField(m.MAPNAME));
            sb.AppendFormat(",BYORGNO={0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",BYORGNOXS={0}", ClsSql.saveNullField(m.BYORGNOXS));
            sb.AppendFormat(",TYPE={0}", ClsSql.saveNullField(m.TYPE));
            sb.AppendFormat(",VILLAGE={0}", ClsSql.saveNullField(m.VILLAGE));
            sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",KIND={0}", ClsSql.saveNullField(m.KIND));
            sb.AppendFormat(",TELEPHONE={0}", ClsSql.saveNullField(m.TELEPHONE));
            sb.AppendFormat(",ADDRESS={0}", ClsSql.saveNullField(m.ADDRESS));
            sb.AppendFormat(",Shape={0}", m.Shape);
            sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
示例#4
0
        /// <summary>
        /// 三维-修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Mdy(TD_MOUNTAIN_Model m)
        {
            if (PublicCls.OrgIsZhen(m.BYORGNO) == false)
            {
                return(new Message(false, "修改失败,请选择所属乡镇!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE MOUNTAIN");
            sb.AppendFormat(" set ");
            sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",BYORGNO={0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",BYORGNOXS={0}", ClsSql.saveNullField(m.BYORGNOXS));
            sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",VILLAGE={0}", ClsSql.saveNullField(m.VILLAGE));
            sb.AppendFormat(",TYPE={0}", ClsSql.saveNullField(m.TYPE));
            sb.AppendFormat(",Shape={0}", m.Shape);
            sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
示例#5
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(YHSWJCD_Model m)
 {
     if (isExists(new YHSWJCD_Model {
         OBJECTID = m.OBJECTID
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("INSERT INTO YHSWJCD(OBJECTID, NAME, ADDRESS, DISPLAY_X, DISPLAY_Y, Shape) Values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.ADDRESS));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0})", m.Shape);
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败!", ""));
         }
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("UPDATE YHSWJCD SET ");
         sb.AppendFormat(" NAME={0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",ADDRESS={0}", ClsSql.saveNullField(m.ADDRESS));
         sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.WD));
         if (!string.IsNullOrEmpty(m.Shape))
         {
             sb.AppendFormat(",Shape={0}", m.Shape);
         }
         else
         {
             sb.AppendFormat(",Shape=null");
         }
         sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "修改成功!", ""));
         }
         else
         {
             return(new Message(false, "修改失败!", ""));
         }
     }
 }
示例#6
0
 /// <summary>
 /// 点的修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(WILD_BotanyPoint_Model m)
 {
     if (TD_WILD_BOTANYDISTRIBUTE.isExists(new WILD_BotanyPoint_Model {
         OBJECTID = m.OBJECTID
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into BOTANYPOINT(OBJECTID,NAME,JD,WD,Shape,TYPE,BYORGNO) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0},", m.Shape);
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.TYPE));
         sb.AppendFormat("{0})", ClsSql.saveNullField(m.BYORGNO));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
         }
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("UPDATE BOTANYPOINT");
         sb.AppendFormat(" set ");
         sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",JD={0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
         sb.AppendFormat(",TYPE={0}", ClsSql.saveNullField(m.TYPE));
         sb.AppendFormat(",Shape={0}", m.Shape);
         sb.AppendFormat(",BYORGNO={0}", ClsSql.saveNullField(m.BYORGNO));
         sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "修改成功!", ""));
         }
         else
         {
             return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
示例#7
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message DelHONGWAIXIANGJI(JC_INFRAREDCAMERA_BASICINFO_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete HONGWAIXIANGJI");
            sb.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.INFRAREDCAMERAID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
示例#8
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(TD_CAMP_Model m)
 {
     if (TD_CAMP.isExists(new TD_CAMP_Model {
         OBJECTID = m.OBJECTID
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into YINGFANG(OBJECTID,NAME,DISPLAY_X,DISPLAY_Y,Shape,category) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0},", m.Shape);
         sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
         }
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("UPDATE YINGFANG");
         sb.AppendFormat(" set ");
         sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.WD));
         sb.AppendFormat(",category={0}", ClsSql.saveNullField(m.TYPE));
         sb.AppendFormat(",Shape={0}", m.Shape);
         sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "修改成功!", ""));
         }
         else
         {
             return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
示例#9
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Del(YHSWJCD_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete YHSWJCD");
            sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败!", ""));
            }
        }
示例#10
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Del(TD_CAMP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete YINGFANG");
            sb.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.OBJECTID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
示例#11
0
        /// <summary>
        /// 面的删除
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message DelA(WILD_ANIMALDISTRIBUTEArea_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete ANIMALAREA");
            sb.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.OBJECTID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
示例#12
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(Firedepartment_Model m)
 {
     if (Firedepartment.isExists(new Firedepartment_Model {
         OBJECTID = m.OBJECTID
     }) == false)                                                                             //如果开始添加空的的经纬度之后再修改则插入空间库是添加
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into XIAOFANGDUIWU(OBJECTID,Name,DISPLAY_X,DISPLAY_Y,Shape,category) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0},", m.Shape);
         sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
         }
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("UPDATE XIAOFANGDUIWU");
         sb.AppendFormat(" set ");
         sb.AppendFormat("Name={0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.WD));
         sb.AppendFormat(",category={0}", ClsSql.saveNullField(m.TYPE));
         sb.AppendFormat(",Shape={0}", m.Shape);
         sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "修改成功!", ""));
         }
         else
         {
             return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
示例#13
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message DelSHIPINGJIANKONG(JC_MONITOR_BASICINFO_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete SHIPINGJIANKONG");
            sb.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.EMID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
示例#14
0
        /// <summary>
        /// 面的修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>

        public static Message MdyA(WILD_ANIMALDISTRIBUTEArea_Model m)
        {
            if (TD_WILD_ANIMALDISTRIBUTE.isExistsArea(new WILD_ANIMALDISTRIBUTEArea_Model {
                OBJECTID = m.OBJECTID
            }) == false)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("insert into ANIMALAREA(OBJECTID,NAME,Shape,JD,WD,TYPE) values(");
                sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
                sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
                sb.AppendFormat("{0},", m.Shape);
                sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
                sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
                sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
                bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
                if (bln == true)
                {
                    return(new Message(true, "添加成功!", ""));
                }
                else
                {
                    return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
                }
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("UPDATE ANIMALAREA");
                sb.AppendFormat(" set ");
                sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.NAME));
                sb.AppendFormat(",TYPE={0}", ClsSql.saveNullField(m.TYPE));
                sb.AppendFormat(",Shape={0}", m.Shape);
                sb.AppendFormat(",JD={0}", ClsSql.EncodeSql(m.JD));
                sb.AppendFormat(",WD={0}", ClsSql.EncodeSql(m.WD));
                sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID));
                bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
                if (bln == true)
                {
                    return(new Message(true, "修改成功!", ""));
                }
                else
                {
                    return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
                }
            }
        }
示例#15
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(BINGCHONGHAI_Model m)
 {
     if (isExists(new BINGCHONGHAI_Model {
         OBJECTID = m.OBJECTID
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat(" INSERT INTO BINGCHONGHAI(OBJECTID,NAME,CATEGORY,DISPLAY_X,DISPLAY_Y,Shape) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID.ToString()));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.CATEGORY));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_X));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_Y));
         sb.AppendFormat("{0})", m.Shape);
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败!", ""));
         }
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat(" UPDATE BINGCHONGHAI SET ");
         sb.AppendFormat(" NAME={0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",CATEGORY={0}", ClsSql.saveNullField(m.CATEGORY));
         sb.AppendFormat(",DISPLAY_X={0}", ClsSql.saveNullField(m.DISPLAY_X));
         sb.AppendFormat(",DISPLAY_Y={0}", ClsSql.saveNullField(m.DISPLAY_Y));
         sb.AppendFormat(",Shape={0}", m.Shape);
         sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.OBJECTID.ToString()));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "修改成功!", ""));
         }
         else
         {
             return(new Message(false, "修改失败!", ""));
         }
     }
 }
示例#16
0
        /// <summary>
        /// 增加点
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>

        public static Message AddPoints(T_COLLECTPOINTS_SW m)
        {
            StringBuilder sb = new StringBuilder();

            ////([OBJECTID],[TYPEID],[NAME],[SHAPE])
            sb.AppendFormat(" Insert  INTO  T_COLLECTPOINTS (OBJECTID,TYPEID,NAME,SHAPE)");
            sb.AppendFormat(" values({0},{1},'{2}','{3}') ", m.OBJECTID, m.TypeId, m.NAME, m.Shape);
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "空间数据点处理成功!", ""));
            }
            else
            {
                return(new Message(false, "空间数据点处理失败!", ""));
            }
        }
示例#17
0
        /// <summary>
        /// 三维删除
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Del(TD_DUTYROUTE_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(" ZERENLUXIAN");
            sb.AppendFormat(" WHERE OBJECTID = '{0}'", ClsSql.EncodeSql(m.OBJECTID));
            string sql = "DELETE" + sb.ToString();
            bool   bln = SDEDataBaseClass.ExeSql(sql);

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
示例#18
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Del(FIRERECORD_FIREINFO_Model m)
        {
            List <string> sqllist = new List <string>();
            //删除FIRERECORD_FIREINFO表中的数据
            StringBuilder sb1 = new StringBuilder();

            sb1.AppendFormat("delete from FIRERECORD_FIREINFO ");
            sb1.AppendFormat(" where JCFID = '{0}'", ClsSql.EncodeSql(m.JCFID));
            sqllist.Add(sb1.ToString());

            //删除JC_FIRE表中的数据
            StringBuilder sb2 = new StringBuilder();

            sb2.AppendFormat("delete from JC_FIRE ");
            sb2.AppendFormat(" where JCFID ='{0}'", ClsSql.EncodeSql(m.JCFID));
            sqllist.Add(sb2.ToString());

            //删除JC_FIRE_PROP表中的数据
            StringBuilder sb3 = new StringBuilder();

            sb3.AppendFormat("delete from JC_FIRE_PROP ");
            sb3.AppendFormat(" where JCFID = '{0}'", ClsSql.EncodeSql(m.JCFID));
            sqllist.Add(sb3.ToString());

            //删除空间库HUOQINGDANGAN的数据
            StringBuilder sc = new StringBuilder();

            sc.AppendFormat("delete from HUOQINGDANGAN ");
            sc.AppendFormat(" where OBJECTID = '{0}", ClsSql.EncodeSql(m.JCFID));

            var y = DataBaseClass.ExecuteSqlTran(sqllist);

            if (y > 0)
            {
                SDEDataBaseClass.ExeSql(sc.ToString());
                return(new Message(true, "删除成功!", m.returnUrl));
            }
            else
            {
                return(new Message(false, "删除失败,事物回滚机制!", ""));
            }
        }
示例#19
0
        /// <summary>
        /// 三维-野生动物区域入库
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message AddA(WILD_ANIMALDISTRIBUTEArea_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("insert into ANIMALAREA(OBJECTID,NAME,Shape,JD,WD,TYPE) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", m.Shape);
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
            sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
示例#20
0
        /// <summary>
        /// 三维修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Mdy(TD_DUTYROUTE_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE ZERENLUXIAN");
            sb.AppendFormat(" set ");
            sb.AppendFormat("NAME='{0}'", ClsSql.EncodeSql(m.NAME));
            sb.AppendFormat(",TELEPHONE='{0}'", ClsSql.EncodeSql(m.TELEPHONE));
            sb.AppendFormat(",ORGNAME='{0}'", ClsSql.EncodeSql(m.ORGNAME));
            sb.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.OBJECTID));

            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
示例#21
0
        /// <summary>
        /// 三维营房
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(TD_CAMP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("insert into YINGFANG(OBJECTID,NAME,DISPLAY_X,DISPLAY_Y,Shape,category) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
            sb.AppendFormat("{0},", m.Shape);
            sb.AppendFormat("{0})", ClsSql.saveNullField(m.TYPE));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
示例#22
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(YHSWJCD_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO YHSWJCD(OBJECTID, NAME, ADDRESS, DISPLAY_X, DISPLAY_Y, Shape) Values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.ADDRESS));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
            sb.AppendFormat("{0})", m.Shape);
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败!", ""));
            }
        }
示例#23
0
 /// <summary>
 /// 三维添加
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Add(TD_POINTMARK_Model m)
 {
     if (PublicCls.OrgIsZhen(m.BYORGNO) == false)
     {
         return(new Message(false, "添加失败,所属单位必须为乡镇!", ""));
     }
     if (TD_POINTMARK.isExists(new TD_POINTMARK_Model {
         JD = m.JD, WD = m.WD
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into CUNZHUDI(NAME,MAPNAME,BYORGNO,BYORGNOXS,TYPE,VILLAGE,DISPLAY_X,DISPLAY_Y,Shape,KIND,TELEPHONE,ADDRESS) values(");
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.MAPNAME));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.BYORGNO));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.BYORGNOXS));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.TYPE));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.VILLAGE));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
         sb.AppendFormat("{0},", m.Shape);
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.KIND));
         sb.AppendFormat("{0},", ClsSql.saveNullField(m.TELEPHONE));
         sb.AppendFormat("{0})", ClsSql.saveNullField(m.ADDRESS));
         bool bln = SDEDataBaseClass.ExeSql(sb.ToString());
         if (bln == true)
         {
             return(new Message(true, "添加成功!", ""));
         }
         else
         {
             return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
         }
     }
     else
     {
         return(new Message(false, "已有相同地址的自然村,请重新选择地址", ""));
     }
 }
示例#24
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(BINGCHONGHAI_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO BINGCHONGHAI(OBJECTID,NAME,CATEGORY,DISPLAY_X,DISPLAY_Y,Shape) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID.ToString()));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.CATEGORY));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_X));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_Y));
            sb.AppendFormat("{0})", m.Shape);
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败!", ""));
            }
        }
示例#25
0
        /// <summary>
        /// 修改空间库
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyHONGWAIXIANGJI(JC_INFRAREDCAMERA_BASICINFO_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE HONGWAIXIANGJI");
            sb.AppendFormat(" set ");
            sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.INFRAREDCAMERANAME));
            sb.AppendFormat(",JD={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",ADDRESS={0}", ClsSql.saveNullField(m.ADDRESS));
            sb.AppendFormat(",Shape={0}", m.Shape);
            sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.INFRAREDCAMERAID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
示例#26
0
        /// <summary>
        /// 三维-野生动物点入库
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(WILD_BotanyPoint_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("insert into BOTANYPOINT(OBJECTID,NAME,JD,WD,Shape,TYPE,BYORGNO) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.JD));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.WD));
            sb.AppendFormat("{0},", m.Shape);
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.TYPE));
            sb.AppendFormat("{0})", ClsSql.saveNullField(m.BYORGNO));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
示例#27
0
        /// <summary>
        /// 修改空间库
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdySHIPINGJIANKONG(JC_MONITOR_BASICINFO_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE SHIPINGJIANKONG");
            sb.AppendFormat(" set ");
            sb.AppendFormat("NAME={0}", ClsSql.saveNullField(m.EMNAME));
            sb.AppendFormat(",BYORGNO={0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",JD={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",ADDRESS={0}", ClsSql.saveNullField(m.ADDRESS));
            sb.AppendFormat(",Shape={0}", m.Shape);
            sb.AppendFormat(" where OBJECTID= {0}", ClsSql.saveNullField(m.EMID));
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
示例#28
0
        /// <summary>
        /// 三维添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(TD_DUTYROUTE_Model m)
        {
            Del(m);//先删除在添加,相当于修改
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("insert into ZERENLUXIAN(OBJECTID,ORGNAME,NAME,TELEPHONE,DISPLAY_X,DISPLAY_Y,Shape) values(");
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.OBJECTID));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.ORGNAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.TELEPHONE));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_X));
            sb.AppendFormat("{0},", ClsSql.saveNullField(m.DISPLAY_Y));
            sb.AppendFormat("{0})", m.Shape);
            bool bln = SDEDataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
示例#29
0
        /// <summary>
        /// 修改火情档案
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(FIRERECORD_FIREINFO_Model m)
        {
            List <string> sqllist = new List <string>();

            #region 更新FIRERECORD_FIREINFO表数据
            StringBuilder sb = new StringBuilder();
            if (isExists(new FIRERECORD_FIREINFO_SW {
                JCFID = m.JCFID
            }))
            {
                sb.AppendFormat(" Update FIRERECORD_FIREINFO SET ");
                sb.AppendFormat(" BYORGNO='{0}'", ClsSql.EncodeSql(m.BYORGNO));
                sb.AppendFormat(",FIRECODE={0}", ClsSql.saveNullField(m.FIRECODE));
                sb.AppendFormat(",FIREADDRESSCOUNTY={0}", ClsSql.saveNullField(m.FIREADDRESSCOUNTY));
                sb.AppendFormat(",FIREADDRESSTOWNS={0}", ClsSql.saveNullField(m.FIREADDRESSTOWNS));
                sb.AppendFormat(",FIREADDRESSVILLAGES={0}", ClsSql.saveNullField(m.FIREADDRESSVILLAGES));
                sb.AppendFormat(",FIREADDRESS={0}", ClsSql.saveNullField(m.FIREADDRESS));
                sb.AppendFormat(",FIRETIME={0}", ClsSql.saveNullField(m.FIRETIME));
                sb.AppendFormat(",FIREENDTIME={0}", ClsSql.saveNullField(m.FIREENDTIME));
                sb.AppendFormat(",FIRERECINFO000={0}", ClsSql.saveNullField(m.FIRERECINFO000));
                sb.AppendFormat(",FIRERECINFO001={0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sb.AppendFormat(",FIRERECINFO020={0}", ClsSql.saveNullField(m.FIRERECINFO020));
                sb.AppendFormat(",FIRERECINFO021={0}", ClsSql.saveNullField(m.FIRERECINFO021));
                sb.AppendFormat(",FIRERECINFO030={0}", ClsSql.saveNullField(m.FIRERECINFO030));
                sb.AppendFormat(",FIRERECINFO031={0}", ClsSql.saveNullField(m.FIRERECINFO031));
                sb.AppendFormat(",FIRERECINFO032={0}", ClsSql.saveNullField(m.FIRERECINFO032));
                sb.AppendFormat(",FIRERECINFO040={0}", ClsSql.saveNullField(m.FIRERECINFO040));
                sb.AppendFormat(",FIRERECINFO041={0}", ClsSql.saveNullField(m.FIRERECINFO041));
                sb.AppendFormat(",FIRERECINFO050={0}", ClsSql.saveNullField(m.FIRERECINFO050));
                sb.AppendFormat(",FIRERECINFO051={0}", ClsSql.saveNullField(m.FIRERECINFO051));
                sb.AppendFormat(",FIRERECINFO060={0}", ClsSql.saveNullField(m.FIRERECINFO060));
                sb.AppendFormat(",FIRERECINFO061={0}", ClsSql.saveNullField(m.FIRERECINFO061));
                sb.AppendFormat(",FIRERECINFO070={0}", ClsSql.saveNullField(m.FIRERECINFO070));
                sb.AppendFormat(",FIRERECINFO071={0}", ClsSql.saveNullField(m.FIRERECINFO071));
                sb.AppendFormat(",FIRERECINFO072={0}", ClsSql.saveNullField(m.FIRERECINFO072));
                sb.AppendFormat(",FIRERECINFO080={0}", ClsSql.saveNullField(m.FIRERECINFO080));
                sb.AppendFormat(",FIRERECINFO081={0}", ClsSql.saveNullField(m.FIRERECINFO081));
                sb.AppendFormat(",FIRERECINFO082={0}", ClsSql.saveNullField(m.FIRERECINFO082));
                sb.AppendFormat(",FIRERECINFO090={0}", ClsSql.saveNullField(m.FIRERECINFO090));
                sb.AppendFormat(",FIRERECINFO100={0}", ClsSql.saveNullField(m.FIRERECINFO100));
                sb.AppendFormat(",FIRERECINFO110={0}", ClsSql.saveNullField(m.FIRERECINFO110));
                sb.AppendFormat(",FIRERECINFO111={0}", ClsSql.saveNullField(m.FIRERECINFO111));
                sb.AppendFormat(",FIRERECINFO120={0}", ClsSql.saveNullField(m.FIRERECINFO120));
                sb.AppendFormat(",FIRERECINFO130={0}", ClsSql.saveNullField(m.FIRERECINFO130));
                sb.AppendFormat(",FIRERECINFO140={0}", ClsSql.saveNullField(m.FIRERECINFO140));
                sb.AppendFormat(",FIRERECINFO150={0}", ClsSql.saveNullField(m.FIRERECINFO150));
                sb.AppendFormat(",FIRERECINFO160={0}", ClsSql.saveNullField(m.FIRERECINFO160));
                sb.AppendFormat(",FIRELOSEAREA={0}", ClsSql.saveNullField(m.FIRELOSEAREA));
                sb.AppendFormat(" where JCFID= '{0}'", ClsSql.EncodeSql(m.JCFID));
                sqllist.Add(sb.ToString());
            }
            else
            {
                sb.AppendFormat("INSERT  INTO  FIRERECORD_FIREINFO(JCFID, BYORGNO,FIRECODE, FIREADDRESSCOUNTY, FIREADDRESSTOWNS, FIREADDRESSVILLAGES, FIREADDRESS,FIRETIME,FIREENDTIME,");
                sb.AppendFormat("FIRERECINFO000,FIRERECINFO001, FIRERECINFO020,FIRERECINFO021,FIRERECINFO030,FIRERECINFO031,FIRERECINFO032,FIRERECINFO040,FIRERECINFO041,");
                sb.AppendFormat("FIRERECINFO050,FIRERECINFO051,FIRERECINFO060,FIRERECINFO061,FIRERECINFO070,FIRERECINFO071,FIRERECINFO072,FIRERECINFO080,FIRERECINFO081,FIRERECINFO082,");
                sb.AppendFormat("FIRERECINFO090,FIRERECINFO100,FIRERECINFO110,FIRERECINFO111,FIRERECINFO120,FIRERECINFO130,FIRERECINFO140,FIRERECINFO150,FIRERECINFO160,FIRELOSEAREA)");
                sb.AppendFormat("VALUES(");
                sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.JCFID));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRECODE));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSCOUNTY));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSTOWNS));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSVILLAGES));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRETIME));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREENDTIME));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO000));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO020));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO021));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO030));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO031));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO032));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO040));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO041));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO050));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO051));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO060));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO061));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO070));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO071));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO072));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO080));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO081));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO082));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO090));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO100));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO110));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO111));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO120));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO130));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO140));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO150));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO160));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRELOSEAREA));
                sb.AppendFormat(")");
                sqllist.Add(sb.ToString());
            }

            #endregion

            #region 修改JC_FIRE表中的数据
            StringBuilder sc = new StringBuilder();
            sc.AppendFormat(" Update JC_FIRE SET ");
            sc.AppendFormat(" BYORGNO='{0}'", ClsSql.EncodeSql(m.FIREADDRESSTOWNS));
            sc.AppendFormat(",FIRETIME={0}", ClsSql.saveNullField(m.FIRETIME));
            sc.AppendFormat(",FIREENDTIME={0}", ClsSql.saveNullField(m.FIREENDTIME));
            sc.AppendFormat(",ZQWZ={0}", ClsSql.saveNullField(m.FIREADDRESS));
            sc.AppendFormat(",JD={0}", ClsSql.saveNullField(m.JD));
            sc.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sc.AppendFormat(" where JCFID= '{0}'", ClsSql.EncodeSql(m.JCFID));
            sqllist.Add(sc.ToString());
            #endregion

            #region 修改火灾等级到JC_FIRE_PROP中
            StringBuilder sd = new StringBuilder();
            if (isExistsfirelevel(new JC_FIRE_PROP_SW {
                JCFID = m.JCFID
            }))
            {
                sd.AppendFormat(" Update  JC_FIRE_PROP SET ");
                sd.AppendFormat(" FIRELEVEL={0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sd.AppendFormat(" where JCFID= '{0}'", ClsSql.EncodeSql(m.JCFID));
                sqllist.Add(sd.ToString());
            }
            else
            {
                sd.AppendFormat(" INSERT  INTO  JC_FIRE_PROP(JCFID,FIRELEVEL) ");
                sd.AppendFormat(" VALUES(");
                sd.AppendFormat("'{0}'", ClsSql.EncodeSql(m.JCFID));
                sd.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sd.AppendFormat(")");
                sqllist.Add(sd.ToString());
            }
            #endregion

            #region 修改空间库HUOQINGDANGAN的数据
            StringBuilder se = new StringBuilder();
            se.AppendFormat("delete from HUOQINGDANGAN");
            se.AppendFormat(" where OBJECTID= '{0}'", ClsSql.EncodeSql(m.JCFID));
            se.AppendFormat(";");
            se.AppendFormat("INSERT  INTO  HUOQINGDANGAN(OBJECTID,NAME,JD,WD,ADDRESS,YEAR,Shape) ");
            se.AppendFormat("VALUES(");
            se.AppendFormat(" {0}", ClsSql.saveNullField(m.JCFID));
            se.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
            se.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
            se.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
            se.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
            string[] sTIME = m.FIRETIME.Split('-');
            se.AppendFormat(",{0}", ClsSql.saveNullField(sTIME[0]));
            se.AppendFormat(",{0}", m.Shape);
            se.AppendFormat(")");
            #endregion

            var y = DataBaseClass.ExecuteSqlTran(sqllist);
            if (y > 0)
            {
                SDEDataBaseClass.ExeSql(se.ToString());
                return(new Message(true, "修改成功!", m.returnUrl));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", m.returnUrl));
            }
        }
示例#30
0
        /// <summary>
        /// 添加火情档案管理
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(FIRERECORD_FIREINFO_Model m)
        {
            #region 添加数据至JC_FIRE表中
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("INSERT  INTO  JC_FIRE(BYORGNO,FIREFROM,FIRETIME,FIREENDTIME,JD,WD,ZQWZ,ISOUTFIRE) output inserted.JCFID ");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat(" {0}", ClsSql.saveNullField(m.FIREADDRESSTOWNS));
            sb.AppendFormat(",'50'");
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRETIME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREENDTIME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
            sb.AppendFormat(",'1'");
            sb.AppendFormat(")");
            string str = DataBaseClass.ReturnSqlField(sb.ToString());
            #endregion

            if (str != "")
            {
                List <string> sqllist = new List <string>();

                #region 添加数据至FIRERECORD_FIREINFO表中
                StringBuilder sb1 = new StringBuilder();
                sb1.AppendFormat("INSERT  INTO  FIRERECORD_FIREINFO(JCFID, BYORGNO,FIRECODE, FIREADDRESSCOUNTY, FIREADDRESSTOWNS, FIREADDRESSVILLAGES, FIREADDRESS,FIRETIME,FIREENDTIME,");
                sb1.AppendFormat("FIRERECINFO000,FIRERECINFO001, FIRERECINFO020,FIRERECINFO021,FIRERECINFO030,FIRERECINFO031,FIRERECINFO032,FIRERECINFO040,FIRERECINFO041,");
                sb1.AppendFormat("FIRERECINFO050,FIRERECINFO051,FIRERECINFO060,FIRERECINFO061,FIRERECINFO070,FIRERECINFO071,FIRERECINFO072,FIRERECINFO080,FIRERECINFO081,FIRERECINFO082,");
                sb1.AppendFormat("FIRERECINFO090,FIRERECINFO100,FIRERECINFO110,FIRERECINFO111,FIRERECINFO120,FIRERECINFO130,FIRERECINFO140,FIRERECINFO150,FIRERECINFO160,FIRELOSEAREA)");
                sb1.AppendFormat("VALUES(");
                sb1.AppendFormat("'{0}'", ClsSql.EncodeSql(str));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRECODE));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSCOUNTY));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSTOWNS));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESSVILLAGES));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRETIME));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREENDTIME));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO000));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO020));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO021));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO030));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO031));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO032));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO040));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO041));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO050));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO051));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO060));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO061));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO070));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO071));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO072));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO080));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO081));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO082));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO090));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO100));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO110));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO111));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO120));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO130));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO140));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO150));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO160));
                sb1.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRELOSEAREA));
                sb1.AppendFormat(")");
                sqllist.Add(sb1.ToString());
                #endregion ;

                #region 添加火灾等级到JC_FIRE_PROP中
                StringBuilder sb2 = new StringBuilder();
                sb2.AppendFormat("INSERT  INTO  JC_FIRE_PROP(JCFID,FIRELEVEL) ");
                sb2.AppendFormat("VALUES(");
                sb2.AppendFormat("'{0}'", ClsSql.EncodeSql(str));
                sb2.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRERECINFO001));
                sb2.AppendFormat(")");
                sqllist.Add(sb2.ToString());
                #endregion

                #region 添加数据至空间库HUOQINGDANGAN
                StringBuilder sb3 = new StringBuilder();
                sb3.AppendFormat("INSERT  INTO  HUOQINGDANGAN(OBJECTID,NAME,JD,WD,ADDRESS,YEAR,Shape) ");
                sb3.AppendFormat("VALUES(");
                sb3.AppendFormat("'{0}'", ClsSql.EncodeSql(str));
                sb3.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
                sb3.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
                sb3.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
                sb3.AppendFormat(",{0}", ClsSql.saveNullField(m.FIREADDRESS));
                string[] sTIME = m.FIRETIME.Split('-');
                sb3.AppendFormat(",{0}", ClsSql.saveNullField(sTIME[0]));
                sb3.AppendFormat(",{0}", m.Shape);
                sb3.AppendFormat(")");
                #endregion

                var y = DataBaseClass.ExecuteSqlTran(sqllist);
                if (y > 0)
                {
                    SDEDataBaseClass.ExeSql(sb3.ToString());
                    return(new Message(true, "添加成功!", m.returnUrl));
                }
                else
                {
                    return(new Message(false, "添加失败,事物回滚机制!", ""));
                }
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", m.returnUrl));
            }
        }