/// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddCopy(XHD.Model.ecs_goods_gallery model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into scm_goods_gallery(");
            strSql.Append("goods_id,img_url,img_desc,thumb_url,img_original,file_ip)");
            strSql.Append(" values (");
            strSql.Append("@goods_id,@img_url,@img_desc,@thumb_url,@img_original,@file_ip)");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@goods_id",     MySqlDbType.Int16,     8),
                new MySqlParameter("@img_url",      MySqlDbType.VarChar, 255),
                new MySqlParameter("@img_desc",     MySqlDbType.VarChar, 255),
                new MySqlParameter("@thumb_url",    MySqlDbType.VarChar, 255),
                new MySqlParameter("@img_original", MySqlDbType.VarChar, 255),
                new MySqlParameter("@file_ip",      MySqlDbType.VarChar, 200)
            };
            parameters[0].Value = model.goods_id;
            parameters[1].Value = model.img_url;
            parameters[2].Value = model.img_desc;
            parameters[3].Value = model.thumb_url;
            parameters[4].Value = model.img_original;
            parameters[5].Value = model.file_ip;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public XHD.Model.ecs_goods_gallery DataRowToModel(DataRow row)
 {
     XHD.Model.ecs_goods_gallery model = new XHD.Model.ecs_goods_gallery();
     if (row != null)
     {
         //model.img_id=row["img_id"].ToString();
         //model.goods_id=row["goods_id"].ToString();
         if (row["img_url"] != null)
         {
             model.img_url = row["img_url"].ToString();
         }
         if (row["img_desc"] != null)
         {
             model.img_desc = row["img_desc"].ToString();
         }
         if (row["thumb_url"] != null)
         {
             model.thumb_url = row["thumb_url"].ToString();
         }
         if (row["img_original"] != null)
         {
             model.img_original = row["img_original"].ToString();
         }
         if (row["file_ip"] != null)
         {
             model.file_ip = row["file_ip"].ToString();
         }
     }
     return(model);
 }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(XHD.Model.ecs_goods_gallery model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ecs_goods_gallery set ");
            strSql.Append("goods_id=@goods_id,");
            strSql.Append("img_url=@img_url,");
            strSql.Append("img_desc=@img_desc,");
            strSql.Append("thumb_url=@thumb_url,");
            strSql.Append("img_original=@img_original,");
            strSql.Append("file_ip=@file_ip");
            strSql.Append(" where img_id=@img_id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@goods_id",     MySqlDbType.Int16,     8),
                new MySqlParameter("@img_url",      MySqlDbType.VarChar, 255),
                new MySqlParameter("@img_desc",     MySqlDbType.VarChar, 255),
                new MySqlParameter("@thumb_url",    MySqlDbType.VarChar, 255),
                new MySqlParameter("@img_original", MySqlDbType.VarChar, 255),
                new MySqlParameter("@file_ip",      MySqlDbType.VarChar, 200),
                new MySqlParameter("@img_id",       MySqlDbType.Int16, 8)
            };
            parameters[0].Value = model.goods_id;
            parameters[1].Value = model.img_url;
            parameters[2].Value = model.img_desc;
            parameters[3].Value = model.thumb_url;
            parameters[4].Value = model.img_original;
            parameters[5].Value = model.file_ip;
            parameters[6].Value = model.img_id;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public XHD.Model.ecs_goods_gallery GetModel(int img_id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select img_id,goods_id,img_url,img_desc,thumb_url,img_original from ecs_goods_gallery,file_ip ");
            strSql.Append(" where img_id=@img_id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@img_id", MySqlDbType.Int16)
            };
            parameters[0].Value = img_id;

            XHD.Model.ecs_goods_gallery model = new XHD.Model.ecs_goods_gallery();
            DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }