Exemplo n.º 1
0
        /// <summary>
        /// 火情档案_森林防火基础设施统计年报表二
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(FIRERECORD_REPORT11_Model m)
        {
            List <string> sqllist = new List <string>();

            string[] arrREPORTCODE  = m.REPORTCODE.Split(',');
            string[] arrREPORTVALUE = m.REPORTVALUE.Split(',');
            for (int i = 0; i < arrREPORTVALUE.Length - 1; i++)
            {
                #region 更新
                if (isExists(new FIRERECORD_REPORT11_SW {
                    BYORGNO = m.BYORGNO, REPORTYEAR = m.REPORTYEAR, REPORTCODE = arrREPORTCODE[i],
                }))
                {
                    StringBuilder sbUpdate = new StringBuilder();
                    sbUpdate.AppendFormat("UPDATE FIRERECORD_REPORT11 SET ");
                    sbUpdate.AppendFormat(" REPORTVALUE= '{0}'", ClsSql.EncodeSql(arrREPORTVALUE[i]));
                    sbUpdate.AppendFormat(" where BYORGNO= '{0}'", ClsSql.EncodeSql(m.BYORGNO));
                    sbUpdate.AppendFormat(" and REPORTYEAR= '{0}'", ClsSql.EncodeSql(m.REPORTYEAR));
                    sbUpdate.AppendFormat(" and REPORTCODE= '{0}'", ClsSql.EncodeSql(arrREPORTCODE[i]));
                    sqllist.Add(sbUpdate.ToString());
                }
                #endregion

                #region 添加
                else
                {
                    StringBuilder sbInsert = new StringBuilder();
                    sbInsert.AppendFormat("INSERT  INTO  FIRERECORD_REPORT11(BYORGNO,REPORTYEAR,REPORTCODE,REPORTVALUE)");
                    sbInsert.AppendFormat("VALUES(");
                    sbInsert.AppendFormat(" {0}", ClsSql.saveNullField(m.BYORGNO));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(m.REPORTYEAR));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(arrREPORTCODE[i]));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(arrREPORTVALUE[i]));
                    sbInsert.AppendFormat(")");
                    sqllist.Add(sbInsert.ToString());
                }
                #endregion
            }
            var j = DataBaseClass.ExecuteSqlTran(sqllist);
            if (j >= 0)
            {
                return(new Message(true, "保存成功!", ""));
            }
            else
            {
                return(new Message(false, "保存失败,事物回滚机制!", ""));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="m">参见模型</param>
 /// <returns>参见模型</returns>
 public static Message Add(DC_UTILITY_OVERWATCH_Model m)
 {
     if (DC_UTILITY_OVERWATCH.isExistsPoint(new DC_UTILITY_OVERWATCH_Model {
         JD = m.JD, WD = m.WD
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         //sb.AppendFormat("INSERT INTO  DC_UTILITY_OVERWATCH( NUMBER, NAME, ORGNOS, AREA, BUILDDATE, FLOOR, STRUCTURETYPE, SUBFACILITIES, MARK, JD, WD)");
         sb.AppendFormat("INSERT INTO  DC_UTILITY_OVERWATCH(  NUMBER, NAME, ORGNOS, AREA, BUILDDATE, FLOOR, STRUCTURETYPE, SUBFACILITIES, MARK, JD, WD,WORTH,BUILDDATEBEGIN,BUILDDATEEND) output inserted.DC_UTILITY_OVERWATCH_ID");
         sb.AppendFormat(" VALUES(");
         sb.AppendFormat("{0}", ClsSql.saveNullField(m.NUMBER));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ORGNOS));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.AREA));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FLOOR));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.STRUCTURETYPE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.SUBFACILITIES));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MARK));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WORTH));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATEBEGIN));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATEEND));
         sb.AppendFormat(")");
         try
         {
             string strid = DataBaseClass.ReturnSqlField(sb.ToString());
             if (string.IsNullOrEmpty(strid) == false)
             {
                 return(new Message(true, "添加成功!", strid));
             }
             else
             {
                 return(new Message(false, "添加失败!请检查输入框是否正确!", strid));
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         return(new Message(false, "添加失败,已有相同的位置的瞭望台!", ""));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="m">参见模型</param>
 /// <returns>参见模型</returns>
 public static Message Add(PEST_MONITORINGSTATION_Model m)
 {
     if (IsExistsPoint(new PEST_MONITORINGSTATION_Model {
         JD = m.JD, WD = m.WD
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("INSERT INTO  PEST_MONITORINGSTATION(NUMBER, NAME, ADDRESS, MODEL, BYORGNO, TRANSFERMODETYPE, MONICONTENT, BUILDDATE, USESTATE, MANAGERSTATE, MARK, JD, WD, WORTH)");
         sb.AppendFormat(" OUTPUT INSERTED.PEST_MONITORINGSTATIONID");
         sb.AppendFormat(" VALUES(");
         sb.AppendFormat("{0}", ClsSql.saveNullField(m.NUMBER));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ADDRESS));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MODEL));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.TRANSFERMODETYPE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MONICONTENT));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.USESTATE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MANAGERSTATE));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MARK));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
         sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WORTH));
         sb.AppendFormat(")");
         try
         {
             string sId = DataBaseClass.ReturnSqlField(sb.ToString());
             if (sId != "")
             {
                 return(new Message(true, "添加成功!", sId));
             }
             else
             {
                 return(new Message(false, "添加失败!", ""));
             }
         }
         catch
         {
             return(new Message(false, "添加失败!", ""));
         }
     }
     else
     {
         return(new Message(false, "添加失败,已有相同的位置的监测点!", ""));
     }
 }
Exemplo n.º 4
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, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(PEST_COLLECTDATA_Model m)
        {
            if (isExists(new PEST_COLLECTDATA_SW {
                PESTCOLLDATAID = m.PESTCOLLDATAID
            }) == false)
            {
                return(new Message(false, "修改失败,采集数据不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Update PEST_COLLECTDATA SET ");
            sb.AppendFormat(" HID='{0}'", ClsSql.EncodeSql(m.HID));
            sb.AppendFormat(",BYORGNO='{0}'", ClsSql.EncodeSql(m.BYORGNO));
            sb.AppendFormat(",COLLECTRESOURCE='{0}'", ClsSql.EncodeSql(m.COLLECTRESOURCE));
            sb.AppendFormat(",VILLAGENAME='{0}'", ClsSql.EncodeSql(m.VILLAGENAME));
            sb.AppendFormat(",SMALLADDRESS='{0}'", ClsSql.EncodeSql(m.SMALLADDRESS));
            sb.AppendFormat(",SMALLCLASSCODE='{0}'", ClsSql.EncodeSql(m.SMALLCLASSCODE));
            sb.AppendFormat(",SMALLCLASSAREA={0}", ClsSql.saveNullField(m.SMALLCLASSAREA));
            sb.AppendFormat(",HOSTTREESPECIESCODE='{0}'", ClsSql.EncodeSql(m.HOSTTREESPECIESCODE));
            sb.AppendFormat(",SEARCHTYPE='{0}'", ClsSql.EncodeSql(m.SEARCHTYPE));
            sb.AppendFormat(",COLLECTPESTCODE='{0}'", ClsSql.EncodeSql(m.COLLECTPESTCODE));
            sb.AppendFormat(",HARMPOSITION='{0}'", ClsSql.EncodeSql(m.HARMPOSITION));
            sb.AppendFormat(",HARMLEVEL='{0}'", ClsSql.EncodeSql(m.HARMLEVEL));
            sb.AppendFormat(",DEADCOUNT={0}", ClsSql.saveNullField(m.DEADCOUNT));
            sb.AppendFormat(",UNKNOWNDIEOFFCOUNT={0}", ClsSql.saveNullField(m.UNKNOWNDIEOFFCOUNT));
            sb.AppendFormat(",ELSEDIEOFFCOUNT={0}", ClsSql.saveNullField(m.ELSEDIEOFFCOUNT));
            sb.AppendFormat(",SAMPLECOUNT={0}", ClsSql.saveNullField(m.SAMPLECOUNT));
            sb.AppendFormat(",MARK={0}", ClsSql.saveNullField(m.MARK));
            sb.AppendFormat(",MANSTATE='{0}'", ClsSql.EncodeSql(m.MANSTATE));
            sb.AppendFormat(",MANRESULT={0}", ClsSql.saveNullField(m.MANRESULT));
            sb.AppendFormat(",MANTIME='{0}'", m.MANTIME);
            sb.AppendFormat(",MANUSERID='{0}'", ClsSql.EncodeSql(m.MANUSERID));
            sb.AppendFormat(",KID={0}", ClsSql.saveNullField(m.KID));
            sb.AppendFormat(",JWDLIST={0}", ClsSql.saveNullField(m.JWDLIST));
            sb.AppendFormat(" WHERE PESTCOLLDATAID= '{0}'", ClsSql.EncodeSql(m.PESTCOLLDATAID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.PESTCOLLDATAID));
            }
            else
            {
                return(new Message(false, "修改失败!", ""));
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 点的修改
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public static Message Mdy(WILD_ANIMALDISTRIBUTEPoint_Model m)
 {
     if (TD_WILD_ANIMALDISTRIBUTE.isExists(new WILD_ANIMALDISTRIBUTEPoint_Model {
         OBJECTID = m.OBJECTID
     }) == false)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("insert into ANIMALPOINT(OBJECTID,NAME,JD,WD,Shape,TYPE) 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 ANIMALPOINT");
         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(" 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, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
Exemplo n.º 7
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, "删除失败!", ""));
            }
        }
Exemplo n.º 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, "修改失败,请检查各输入框是否正确!", ""));
         }
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(DC_RESOURCE_NEW_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO  DC_RESOURCE_NEW( RESOURCETYPE, NUMBER, NAME, ORGNOS, KINDTYPE, AGETYPE, ORIGINTYPE, AREA, BURNTYPE, TREETYPE, ASPECT, ANGLE, MARK, JD, WD,POTHOOKLEADER,POTHOOKLEADERJOB,POTHOOKLEADERTLEE,DUTYPERSON,DUTYPERSONTELL,JWDLIST) output inserted.DC_RESOURCE_NEW_ID");
            sb.AppendFormat(" VALUES(");
            sb.AppendFormat("{0}", ClsSql.saveNullField(m.RESOURCETYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NUMBER));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ORGNOS));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.KINDTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.AGETYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ORIGINTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.AREA));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BURNTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.TREETYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ASPECT));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ANGLE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MARK));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.POTHOOKLEADER));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.POTHOOKLEADERJOB));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.POTHOOKLEADERTLEE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.DUTYPERSON));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.DUTYPERSONTELL));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JWDLIST));
            sb.AppendFormat(")");
            try
            {
                string strid = DataBaseClass.ReturnSqlField(sb.ToString());
                if (string.IsNullOrEmpty(strid) == false)
                {
                    return(new Message(true, "添加成功!", strid));
                }
                else
                {
                    return(new Message(false, "添加失败!请检查输入框是否正确!", strid));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 10
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, "修改失败!", ""));
         }
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// 添加返回当前记录的id
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(DC_ARMY_Model m)
        {
            if (DC_ARMY.isExistsPoint(new DC_ARMY_Model { JD = m.JD, WD = m.WD }) == false)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("INSERT INTO  DC_ARMY( ARMYTYPE, NUMBER, NAME, BYORGNO, ARMYMEMBERCOUNT, ARMYLEADER, CONTACTS,ARMYCHARACTER, ARMYEQUIP, MARK, JD, WD) output inserted.DC_ARMY_ID");
                sb.AppendFormat(" VALUES(");
                sb.AppendFormat("{0}", ClsSql.saveNullField(m.ARMYTYPE));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NUMBER));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ARMYMEMBERCOUNT));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ARMYLEADER));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.CONTACTS));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ARMYCHARACTER));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ARMYEQUIP));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MARK));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
                sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
                sb.AppendFormat(")");
                try
                {
                    string strid = DataBaseClass.ReturnSqlField(sb.ToString());
                    if (string.IsNullOrEmpty(strid)==false)
                    {
                        return new Message(true, "添加成功!", strid);
                    }
                    else
                    {
                        return new Message(false, "添加失败!请检查输入框是否正确!", strid);
                    }
                    
                }
                catch (Exception)
                {

                    throw;
                }
            }
            else 
            {
                return new Message(false, "添加失败,已有相同的位置的队伍!", "");
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 更新物资剩余数量
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Mdy(DC_DETAILS_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE DC_DETAILS");
            sb.AppendFormat(" set ");
            sb.AppendFormat(" REPERTORYCOUNT={0}", ClsSql.saveNullField(m.REPERTORYCOUNT));
            sb.AppendFormat(" where DCDETAILSID= '{0}'", ClsSql.EncodeSql(m.DCDETAILSID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyTP(PEST_COLLECT_DATAUPLOAD_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE PEST_COLLECT_DATAUPLOAD SET ");
            sb.AppendFormat(" UPLOADNAME='{0}'", ClsSql.EncodeSql(m.UPLOADNAME));
            sb.AppendFormat(",UPLOADDESCRIBE={0}", ClsSql.saveNullField(m.UPLOADDESCRIBE));
            sb.AppendFormat(" where PESTCOLLDATAUPLOADID= '{0}'", ClsSql.EncodeSql(m.PESTCOLLDATAUPLOADID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(DC_UTILITY_ISOLATIONSTRIP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE DC_UTILITY_ISOLATIONSTRIP");
            sb.AppendFormat(" set ");
            sb.AppendFormat("ISOLATIONTYPE={0}", ClsSql.saveNullField(m.ISOLATIONTYPE));
            sb.AppendFormat(",NUMBER={0}", ClsSql.saveNullField(m.NUMBER));
            sb.AppendFormat(",NAME={0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",BYORGNO={0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",BUILDDATE={0}", ClsSql.saveNullField(m.BUILDDATE));
            sb.AppendFormat(",USESTATE={0}", ClsSql.saveNullField(m.USESTATE));
            sb.AppendFormat(",MANAGERSTATE={0}", ClsSql.saveNullField(m.MANAGERSTATE));
            sb.AppendFormat(",WIDTH={0}", ClsSql.saveNullField(m.WIDTH));
            sb.AppendFormat(",LENGTH={0}", ClsSql.saveNullField(m.LENGTH));
            sb.AppendFormat(",JDBEGIN={0}", ClsSql.saveNullField(m.JDBEGIN));
            sb.AppendFormat(",WDBEGIN={0}", ClsSql.saveNullField(m.WDBEGIN));
            sb.AppendFormat(",JDEND={0}", ClsSql.saveNullField(m.JDEND));
            sb.AppendFormat(",WDEND={0}", ClsSql.saveNullField(m.WDEND));
            sb.AppendFormat(",JWDLIST={0}", ClsSql.saveNullField(m.JWDLIST));
            sb.AppendFormat(",PLANAREA={0}", ClsSql.saveNullField(m.PLANAREA));
            sb.AppendFormat(",REALAREA={0}", ClsSql.saveNullField(m.REALAREA));
            sb.AppendFormat(",WORTH={0}", ClsSql.saveNullField(m.WORTH));
            sb.AppendFormat(",KINDTYPE={0}", ClsSql.saveNullField(m.KINDTYPE));
            sb.AppendFormat(",POSITION={0}", ClsSql.saveNullField(m.Position));
            sb.AppendFormat(",PRICE={0}", ClsSql.saveNullField(m.Price));
            sb.AppendFormat(",ALLEYWAYWIDETH={0}", ClsSql.saveNullField(m.AlleywayWideth));
            sb.AppendFormat(",TREETYPE={0}", ClsSql.saveNullField(m.TREETYPE));
            sb.AppendFormat(",ENTRYTIME={0}", ClsSql.saveNullField(m.ENTRYTIME));
            sb.AppendFormat(",BUILDDATEBEGIN={0}", ClsSql.saveNullField(m.BUILDDATEBEGIN));
            sb.AppendFormat(",BUILDDATEEND={0}", ClsSql.saveNullField(m.BUILDDATEEND));
            sb.AppendFormat(" where DC_UTILITY_ISOLATIONSTRIP_ID= '{0}'", ClsSql.EncodeSql(m.DC_UTILITY_ISOLATIONSTRIP_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.DC_UTILITY_ISOLATIONSTRIP_ID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdyunit(DC_SUPPLIESPROP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE DC_SUPPLIESPROP");
            sb.AppendFormat(" set ");
            sb.AppendFormat("DCSUPPROPUNIT={0}", ClsSql.saveNullField(m.DCSUPPROPUNIT));
            sb.AppendFormat(" where DC_SUPPLIESPROP_ID= '{0}'", ClsSql.EncodeSql(m.DC_SUPPLIESPROP_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.DC_SUPPLIESPROP_ID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(DC_UTILITY_FIRECHANNEL_Model m)
        {
            StringBuilder sb = new StringBuilder();

            //sb.AppendFormat("INSERT INTO  DC_UTILITY_FIRECHANNEL( NUMBER, NAME, BYORGNO, BUILDDATE, USESTATE, MANAGERSTATE,FIRECHANNELLEVELTYPE, FIRECHANNELUSERTYPE, LENGTH, JDBEGIN, WDBEGIN, JDEND, WDEND,JWDLIST)");
            sb.AppendFormat("INSERT INTO  DC_UTILITY_FIRECHANNEL( NUMBER, NAME, BYORGNO, BUILDDATE, USESTATE, MANAGERSTATE,FIRECHANNELLEVELTYPE, FIRECHANNELUSERTYPE, LENGTH, JDBEGIN, WDBEGIN, JDEND, WDEND,JWDLIST,WORTH,BUILDDATEBEGIN,BUILDDATEEND ) output inserted.DC_UTILITY_FIRECHANNEL_ID");
            sb.AppendFormat(" VALUES(");
            sb.AppendFormat("{0}", ClsSql.saveNullField(m.NUMBER));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.USESTATE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MANAGERSTATE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRECHANNELLEVELTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRECHANNELUSERTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.LENGTH));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JDBEGIN));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WDBEGIN));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JDEND));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WDEND));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JWDLIST));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WORTH));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATEBEGIN));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUILDDATEEND));
            sb.AppendFormat(")");
            try
            {
                string strid = DataBaseClass.ReturnSqlField(sb.ToString());
                if (string.IsNullOrEmpty(strid) == false)
                {
                    return(new Message(true, "添加成功!", strid));
                }
                else
                {
                    return(new Message(false, "添加失败!请检查输入框是否正确!", strid));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 模板修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Mdy(SendMessage_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE EM_MESSAGE");
            sb.AppendFormat(" set ");
            sb.AppendFormat("TMPCONTENT={0}", ClsSql.saveNullField(m.MessageContent));
            sb.AppendFormat(",ORDERBY={0}", ClsSql.saveNullField(m.ORDERBY));
            sb.AppendFormat(" where EM_MESSAGEID= '{0}'", ClsSql.EncodeSql(m.EM_MESSAGEID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.EM_MESSAGEID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(PEST_CONSULTATION_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE PEST_CONSULTATION SET ");
            sb.AppendFormat(" CONSULTITLE={0}", ClsSql.saveNullField(m.CONSULTITLE));
            sb.AppendFormat(",CONSULPHONE={0}", ClsSql.saveNullField(m.CONSULPHONE));
            sb.AppendFormat(",CONSULCONTENT={0}", ClsSql.saveNullField(m.CONSULCONTENT));
            sb.AppendFormat(" WHERE PEST_CONSULTATIONID= '{0}'", ClsSql.EncodeSql(m.PEST_CONSULTATIONID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.PEST_CONSULTATIONID));
            }
            else
            {
                return(new Message(false, "修改失败!", ""));
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(FIRELOST_LOSTTYPE_ATTACK_P6_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE FIRELOST_LOSTTYPE_ATTACK_P6 SET ");
            sb.AppendFormat(" P6NAME={0}", ClsSql.saveNullField(m.P6NAME));
            sb.AppendFormat(",LOSEMONEYCOUNT={0}", ClsSql.saveNullField(m.LOSEMONEYCOUNT));
            sb.AppendFormat(",MARK={0}", ClsSql.saveNullField(m.MARK));
            sb.AppendFormat(" WHERE P6ID= '{0}'", ClsSql.EncodeSql(m.P6ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.P6ID));
            }
            else
            {
                return(new Message(false, "修改失败!", ""));
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// 更新指定表中的经度纬度
        /// </summary>
        /// <param name="jd"></param>
        /// <param name="wd"></param>
        /// <param name="tablename"></param>
        /// <param name="id"></param>
        /// <param name="key">主键名</param>
        /// <returns></returns>
        public static Message updatePoint(string jd, string wd, string tablename, string id, string key)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE " + tablename + "");
            sb.AppendFormat(" set ");
            sb.AppendFormat("JD={0}", ClsSql.saveNullField(jd));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(wd));
            sb.AppendFormat(" where " + key + " = '{0}'", id);
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "保存成功!", ""));
            }
            else
            {
                return(new Message(false, "保存失败!", ""));
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyJWD(DC_UTILITY_MONITORINGSTATION_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE DC_UTILITY_MONITORINGSTATION");
            sb.AppendFormat(" set ");
            sb.AppendFormat("JD={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(" where DC_UTILITY_MONITORINGSTATION_ID= '{0}'", ClsSql.EncodeSql(m.DC_UTILITY_MONITORINGSTATION_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.DC_UTILITY_MONITORINGSTATION_ID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyTP(PEST_PESTINFOFILE_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE PEST_PESTINFOFILE SET ");
            sb.AppendFormat(" PESTFILETITLE={0}", ClsSql.saveNullField(m.PESTFILETITLE));
            sb.AppendFormat(",PESTFILETYPE={0}", ClsSql.saveNullField(m.PESTFILETYPE));
            sb.AppendFormat(",UID={0}", ClsSql.saveNullField(m.UID));
            sb.AppendFormat(" WHERE PESTFILEID= '{0}'", ClsSql.EncodeSql(m.PESTFILEID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败!", ""));
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// 模板添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Message Add(SendMessage_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO  EM_MESSAGE(  TMPCONTENT, ORDERBY)");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("{0}", ClsSql.saveNullField(m.MessageContent));
            //sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MessageContent));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ORDERBY));
            sb.AppendFormat(")");
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败!", ""));
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// 修改状态、发起人、发起时间
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyZT(PEST_REMOTEDIAGN_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE PEST_REMOTEDIAGN");
            sb.AppendFormat(" SET ");
            sb.AppendFormat(" DIAGNRESULT={0}", ClsSql.saveNullField(m.DIAGNRESULT));
            sb.AppendFormat(",DIAGNSPONSERUID={0}", ClsSql.saveNullField(m.DIAGNSPONSERUID));
            sb.AppendFormat(",DIAGNEXPERTS={0}", ClsSql.saveNullField(m.DIAGNEXPERTS));
            sb.AppendFormat(" WHERE PEST_REMOTEDIAGNID= '{0}'", ClsSql.EncodeSql(m.PEST_REMOTEDIAGNID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.PEST_REMOTEDIAGNID));
            }
            else
            {
                return(new Message(false, "修改失败!", ""));
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyCount(DC_EQUIP_NEW_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE DC_EQUIP_NEW");
            sb.AppendFormat(" set ");
            sb.AppendFormat(" WORTH={0}", ClsSql.saveNullField(m.WORTH));
            sb.AppendFormat(",EQUIPAMOUNT={0}", ClsSql.saveNullField(m.EQUIPAMOUNT));
            sb.AppendFormat(",REPID={0} ", ClsSql.saveNullField(m.REPID));
            sb.AppendFormat(" where DC_EQUIP_NEW_ID= '{0}'", ClsSql.EncodeSql(m.DC_EQUIP_NEW_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.DC_EQUIP_NEW_ID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyJWD(DC_EQUIP_NEW_Model m)
        {
            StringBuilder sb = new StringBuilder();

            //HID, HNAME, SN, PHONE, SEX, BIRTH, ONSTATE, BYORGNO
            sb.AppendFormat("UPDATE DC_EQUIP_NEW");
            sb.AppendFormat(" set ");
            sb.AppendFormat("JD={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(" where DC_EQUIP_NEW_ID= '{0}'", ClsSql.EncodeSql(m.DC_EQUIP_NEW_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(DC_EQUIP_NEW_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO  DC_EQUIP_NEW( EQUIPTYPE, NUMBER, NAME, BYORGNO, MODEL, BUYYEAR, USESTATE, STOREADDR, MARK, JD, WD,WORTH,EQUIPAMOUNT,REPID,DCSUPPROPUNIT,PRICE) output inserted.DC_EQUIP_NEW_ID");
            sb.AppendFormat(" VALUES(");
            sb.AppendFormat("{0}", ClsSql.saveNullField(m.EQUIPTYPE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NUMBER));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BYORGNO));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MODEL));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.BUYYEAR));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.USESTATE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.STOREADDR));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MARK));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WORTH));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.EQUIPAMOUNT));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.REPID));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.DCSUPPROPUNIT));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.PRICE));
            sb.AppendFormat(")");
            try
            {
                string strid = DataBaseClass.ReturnSqlField(sb.ToString());
                if (string.IsNullOrEmpty(strid) == false)
                {
                    return(new Message(true, "添加成功!", strid));
                }
                else
                {
                    return(new Message(false, "添加失败!请检查输入框是否正确!", strid));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(DC_RESOURCE_NEW_Model m)
        {
            StringBuilder sb = new StringBuilder();

            //HID, HNAME, SN, PHONE, SEX, BIRTH, ONSTATE, BYORGNO
            sb.AppendFormat("UPDATE DC_RESOURCE_NEW");
            sb.AppendFormat(" set ");
            sb.AppendFormat("RESOURCETYPE={0}", ClsSql.saveNullField(m.RESOURCETYPE));
            sb.AppendFormat(",NUMBER={0}", ClsSql.saveNullField(m.NUMBER));
            sb.AppendFormat(",NAME={0}", ClsSql.saveNullField(m.NAME));
            sb.AppendFormat(",ORGNOS={0}", ClsSql.saveNullField(m.ORGNOS));
            sb.AppendFormat(",KINDTYPE={0}", ClsSql.saveNullField(m.KINDTYPE));
            sb.AppendFormat(",AGETYPE={0}", ClsSql.saveNullField(m.AGETYPE));
            sb.AppendFormat(",ORIGINTYPE={0}", ClsSql.saveNullField(m.ORIGINTYPE));
            sb.AppendFormat(",AREA={0}", ClsSql.saveNullField(m.AREA));
            sb.AppendFormat(",BURNTYPE={0}", ClsSql.saveNullField(m.BURNTYPE));
            sb.AppendFormat(",TREETYPE={0}", ClsSql.saveNullField(m.TREETYPE));
            sb.AppendFormat(",ASPECT={0}", ClsSql.saveNullField(m.ASPECT));
            sb.AppendFormat(",ANGLE={0}", ClsSql.saveNullField(m.ANGLE));
            sb.AppendFormat(",MARK={0}", ClsSql.saveNullField(m.MARK));
            sb.AppendFormat(",JD={0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",WD={0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",POTHOOKLEADER={0}", ClsSql.saveNullField(m.POTHOOKLEADER));
            sb.AppendFormat(",POTHOOKLEADERJOB={0}", ClsSql.saveNullField(m.POTHOOKLEADERJOB));
            sb.AppendFormat(",POTHOOKLEADERTLEE={0}", ClsSql.saveNullField(m.POTHOOKLEADERTLEE));
            sb.AppendFormat(",DUTYPERSON={0}", ClsSql.saveNullField(m.DUTYPERSON));
            sb.AppendFormat(",DUTYPERSONTELL={0}", ClsSql.saveNullField(m.DUTYPERSONTELL));
            sb.AppendFormat(",JWDLIST={0}", ClsSql.saveNullField(m.JWDLIST));
            sb.AppendFormat(" where DC_RESOURCE_NEW_ID= '{0}'", ClsSql.EncodeSql(m.DC_RESOURCE_NEW_ID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", m.DC_RESOURCE_NEW_ID));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(T_SYS_ORGModel m)
        {
            if (isExists(new T_SYS_ORGSW {
                ORGNO = m.ORGNO,
            }) == true)
            {
                return(new Message(false, "添加失败,该组织机构码已存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO T_SYS_ORG(ORGNO, ORGNAME, ORGDUTY, LEADER, AREACODE, SYSFLAG,ORGJC,JD, WD,COMMANDNAME,WEATHERJC,POSTCODE,DUTYTELL,FAX,WXJC,ADDRESS )");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.ORGNO));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.ORGNAME));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.ORGDUTY));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.LEADER));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.AREACODE));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.SYSFLAG));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.ORGJC));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.JD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.COMMANDNAME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WEATHERJC));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.POSTCODE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.DUTYTELL));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FAX));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.WXJC));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ADDRESS));
            sb.AppendFormat(")");
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", m.returnUrl));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", m.returnUrl));
            }
        }
Exemplo n.º 30
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, "添加失败,请检查各输入框是否正确!", ""));
            }
        }