Пример #1
0
 /// <summary>
 /// 增删改
 /// </summary>
 /// <param name="m">参见模型PEST_COLLECT_DATAUPLOAD_Model</param>
 /// <returns>参见模型Message</returns>
 public static Message Manager(PEST_COLLECT_DATAUPLOAD_Model m)
 {
     if (m.opMethod == "Add")
     {
         Message msg = BaseDT.PEST_COLLECT_DATAUPLOAD.Add(m);
         if (msg.Success == false)
         {
             return(new Message(msg.Success, msg.Msg, ""));
         }
         return(new Message(msg.Success, msg.Msg, msg.Url));
     }
     if (m.opMethod == "Mdy")
     {
         Message msg = BaseDT.PEST_COLLECT_DATAUPLOAD.Mdy(m);
         if (msg.Success == false)
         {
             return(new Message(msg.Success, msg.Msg, ""));
         }
         return(new Message(msg.Success, msg.Msg, msg.Url));
     }
     if (m.opMethod == "MdyTP")
     {
         Message msg = BaseDT.PEST_COLLECT_DATAUPLOAD.MdyTP(m);
         if (msg.Success == false)
         {
             return(new Message(msg.Success, msg.Msg, ""));
         }
         return(new Message(msg.Success, msg.Msg, msg.Url));
     }
     if (m.opMethod == "Del")
     {
         return(BaseDT.PEST_COLLECT_DATAUPLOAD.Del(m));
     }
     return(new Message(false, "无效操作", m.returnUrl));
 }
Пример #2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Del(PEST_COLLECT_DATAUPLOAD_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete PEST_COLLECT_DATAUPLOAD");
            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, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
Пример #3
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, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Пример #4
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="sw"></param>
        /// <returns></returns>
        public static IEnumerable <PEST_COLLECT_DATAUPLOAD_Model> getModelList(PEST_COLLECT_DATAUPLOAD_SW sw)
        {
            var       result = new List <PEST_COLLECT_DATAUPLOAD_Model>();
            DataTable dt     = BaseDT.PEST_COLLECT_DATAUPLOAD.getDT(sw);//列表

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PEST_COLLECT_DATAUPLOAD_Model m = new PEST_COLLECT_DATAUPLOAD_Model();
                m.PESTCOLLDATAUPLOADID = dt.Rows[i]["PESTCOLLDATAUPLOADID"].ToString();
                m.PESTCOLLDATAID       = dt.Rows[i]["PESTCOLLDATAID"].ToString();
                m.UPLOADNAME           = dt.Rows[i]["UPLOADNAME"].ToString();
                m.UPLOADDESCRIBE       = dt.Rows[i]["UPLOADDESCRIBE"].ToString();
                m.UPLOADURL            = dt.Rows[i]["UPLOADURL"].ToString();
                m.UPLOADTYPE           = dt.Rows[i]["UPLOADTYPE"].ToString();
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Пример #5
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(PEST_COLLECT_DATAUPLOAD_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO  PEST_COLLECT_DATAUPLOAD(PESTCOLLDATAID,UPLOADNAME, UPLOADDESCRIBE, UPLOADURL,UPLOADTYPE)");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.PESTCOLLDATAID));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.UPLOADNAME));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.UPLOADDESCRIBE));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.UPLOADURL));
            sb.AppendFormat(",{0})", ClsSql.saveNullField(m.UPLOADTYPE));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败!", ""));
            }
        }