/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(WechatBuilder.Model.wx_shop_catalog_attribute model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update wx_shop_catalog_attribute set ");
            strSql.Append("wid=@wid,");
            strSql.Append("catalogId=@catalogId,");
            strSql.Append("aName=@aName,");
            strSql.Append("aType=@aType,");
            strSql.Append("aValue=@aValue,");
            strSql.Append("createDate=@createDate,");
            strSql.Append("sort_id=@sort_id");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wid",        SqlDbType.Int,          4),
                new SqlParameter("@catalogId",  SqlDbType.Int,          4),
                new SqlParameter("@aName",      SqlDbType.VarChar,    100),
                new SqlParameter("@aType",      SqlDbType.Int,          4),
                new SqlParameter("@aValue",     SqlDbType.VarChar,   2000),
                new SqlParameter("@createDate", SqlDbType.DateTime),
                new SqlParameter("@sort_id",    SqlDbType.Int,          4),
                new SqlParameter("@id",         SqlDbType.Int, 4)
            };
            parameters[0].Value = model.wid;
            parameters[1].Value = model.catalogId;
            parameters[2].Value = model.aName;
            parameters[3].Value = model.aType;
            parameters[4].Value = model.aValue;
            parameters[5].Value = model.createDate;
            parameters[6].Value = model.sort_id;
            parameters[7].Value = model.id;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public WechatBuilder.Model.wx_shop_catalog_attribute DataRowToModel(DataRow row)
 {
     WechatBuilder.Model.wx_shop_catalog_attribute model = new WechatBuilder.Model.wx_shop_catalog_attribute();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["wid"] != null && row["wid"].ToString() != "")
         {
             model.wid = int.Parse(row["wid"].ToString());
         }
         if (row["catalogId"] != null && row["catalogId"].ToString() != "")
         {
             model.catalogId = int.Parse(row["catalogId"].ToString());
         }
         if (row["aName"] != null)
         {
             model.aName = row["aName"].ToString();
         }
         if (row["aType"] != null && row["aType"].ToString() != "")
         {
             model.aType = int.Parse(row["aType"].ToString());
         }
         if (row["aValue"] != null)
         {
             model.aValue = row["aValue"].ToString();
         }
         if (row["createDate"] != null && row["createDate"].ToString() != "")
         {
             model.createDate = DateTime.Parse(row["createDate"].ToString());
         }
         if (row["sort_id"] != null && row["sort_id"].ToString() != "")
         {
             model.sort_id = int.Parse(row["sort_id"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WechatBuilder.Model.wx_shop_catalog_attribute model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into wx_shop_catalog_attribute(");
            strSql.Append("wid,catalogId,aName,aType,aValue,createDate,sort_id)");
            strSql.Append(" values (");
            strSql.Append("@wid,@catalogId,@aName,@aType,@aValue,@createDate,@sort_id)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wid",        SqlDbType.Int,          4),
                new SqlParameter("@catalogId",  SqlDbType.Int,          4),
                new SqlParameter("@aName",      SqlDbType.VarChar,    100),
                new SqlParameter("@aType",      SqlDbType.Int,          4),
                new SqlParameter("@aValue",     SqlDbType.VarChar,   2000),
                new SqlParameter("@createDate", SqlDbType.DateTime),
                new SqlParameter("@sort_id",    SqlDbType.Int, 4)
            };
            parameters[0].Value = model.wid;
            parameters[1].Value = model.catalogId;
            parameters[2].Value = model.aName;
            parameters[3].Value = model.aType;
            parameters[4].Value = model.aValue;
            parameters[5].Value = model.createDate;
            parameters[6].Value = model.sort_id;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public WechatBuilder.Model.wx_shop_catalog_attribute GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,wid,catalogId,aName,aType,aValue,createDate,sort_id from wx_shop_catalog_attribute ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            WechatBuilder.Model.wx_shop_catalog_attribute model = new WechatBuilder.Model.wx_shop_catalog_attribute();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public WechatBuilder.Model.wx_shop_catalog_attribute DataRowToModel(DataRow row)
		{
			WechatBuilder.Model.wx_shop_catalog_attribute model=new WechatBuilder.Model.wx_shop_catalog_attribute();
			if (row != null)
			{
				if(row["id"]!=null && row["id"].ToString()!="")
				{
					model.id=int.Parse(row["id"].ToString());
				}
				if(row["wid"]!=null && row["wid"].ToString()!="")
				{
					model.wid=int.Parse(row["wid"].ToString());
				}
				if(row["catalogId"]!=null && row["catalogId"].ToString()!="")
				{
					model.catalogId=int.Parse(row["catalogId"].ToString());
				}
				if(row["aName"]!=null)
				{
					model.aName=row["aName"].ToString();
				}
				if(row["aType"]!=null && row["aType"].ToString()!="")
				{
					model.aType=int.Parse(row["aType"].ToString());
				}
				if(row["aValue"]!=null)
				{
					model.aValue=row["aValue"].ToString();
				}
				if(row["createDate"]!=null && row["createDate"].ToString()!="")
				{
					model.createDate=DateTime.Parse(row["createDate"].ToString());
				}
				if(row["sort_id"]!=null && row["sort_id"].ToString()!="")
				{
					model.sort_id=int.Parse(row["sort_id"].ToString());
				}
			}
			return model;
		}
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public WechatBuilder.Model.wx_shop_catalog_attribute GetModel(int id)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select  top 1 id,wid,catalogId,aName,aType,aValue,createDate,sort_id from wx_shop_catalog_attribute ");
			strSql.Append(" where id=@id");
			SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
			parameters[0].Value = id;

			WechatBuilder.Model.wx_shop_catalog_attribute model=new WechatBuilder.Model.wx_shop_catalog_attribute();
			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}