Ejemplo n.º 1
0
        public static GoodsBrandInfo GetGoodsBrandInfoEntity(IDataReader reader)
        {
            if (reader.Read())
            {
                GoodsBrandInfo model = new GoodsBrandInfo();

                model.id = TypeConverter.ObjectToInt(reader["id"].ToString(), 0);
                model.bname = reader["bname"].ToString();
                model.spell = reader["spell"].ToString();
                model.website = reader["website"].ToString();
                model.bcompany = reader["bcompany"].ToString();
                model.order = TypeConverter.ObjectToInt(reader["order"], 0);
                model.logo = reader["logo"].ToString();
                model.img = reader["img"].ToString();
                model.keyword = reader["keyword"].ToString();
                model.shortdesc = reader["shortdesc"].ToString();
                model.detaildesc = reader["detaildesc"].ToString();
                model.status = TypeConverter.ObjectToInt(reader["status"], 0);
                model.relateclass = reader["relateclass"].ToString();

                reader.Close();
                return model;
            }
            return null;
        }
 /// <summary>
 /// 加载活动实体信息
 /// </summary>
 /// <returns></returns>
 private GoodsBrandInfo LoadGoodsBrandInfo()
 {
     GoodsBrandInfo brandinfo = new GoodsBrandInfo();
     brandinfo.id = bid;
     brandinfo.bname = brandname.Text.Trim();
     brandinfo.spell = brandspell.Text.Trim();
     brandinfo.website = brandwebsite.Text.Trim();
     brandinfo.bcompany = Utils.RemoveHtml(brandcompany.Text.Trim());
     brandinfo.order = TypeConverter.ObjectToInt(brandorder.Text.Trim(), 0);
     brandinfo.logo = brandlogo.Text.Trim();
     brandinfo.img = brandimg.Text.Trim();
     brandinfo.keyword = Utils.RemoveHtml(seokeyword.Text.Trim());
     brandinfo.shortdesc = Utils.RemoveHtml(brandshortdesc.Text.Trim());
     brandinfo.detaildesc = Utils.RemoveUnsafeHtml(branddesc.Text.Trim());
     brandinfo.relateclass = brandclass.SelectedValue;
     brandinfo.status = TypeConverter.StrToInt(brandstatus.SelectedValue, 0);
     return brandinfo;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建品牌
 /// </summary>
 public int CreateGoodsBrandInfo(GoodsBrandInfo ginfo)
 {
     DbParameter[] parms = {
                             DbHelper.MakeInParam("@bname", (DbType)SqlDbType.NVarChar,100, ginfo.bname),
                             DbHelper.MakeInParam("@spell", (DbType)SqlDbType.VarChar,100, ginfo.spell),
                             DbHelper.MakeInParam("@website", (DbType)SqlDbType.VarChar,200, ginfo.website),
                             DbHelper.MakeInParam("@bcompany", (DbType)SqlDbType.VarChar,200, ginfo.bcompany),
                             DbHelper.MakeInParam("@order", (DbType)SqlDbType.Int,4, ginfo.order),
                             DbHelper.MakeInParam("@logo", (DbType)SqlDbType.NVarChar,100, ginfo.logo),
                             DbHelper.MakeInParam("@img", (DbType)SqlDbType.VarChar,200, ginfo.img),
                             DbHelper.MakeInParam("@keyword", (DbType)SqlDbType.VarChar,500, ginfo.keyword),
                             DbHelper.MakeInParam("@shortdesc", (DbType)SqlDbType.VarChar,500, ginfo.shortdesc),
                             DbHelper.MakeInParam("@detaildesc", (DbType)SqlDbType.Text,0, ginfo.detaildesc),
                             DbHelper.MakeInParam("@status", (DbType)SqlDbType.Int,4, ginfo.status),
                             DbHelper.MakeInParam("@relateclass", (DbType)SqlDbType.VarChar,200, ginfo.relateclass)
                           };
     string commandText = String.Format("INSERT INTO [{0}goodsbrand] ([bname],[spell],[website],[bcompany],[order],[logo],[img],[keyword],[shortdesc],[detaildesc],[status],[relateclass]) VALUES (@bname,@spell,@website,@bcompany,@order,@logo,@img,@keyword,@shortdesc,@detaildesc,@status,@relateclass);SELECT SCOPE_IDENTITY() AS id", BaseConfigs.GetTablePrefix);
     return TypeConverter.ObjectToInt(DbHelper.ExecuteScalar(CommandType.Text, commandText, parms), -1);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 创建商品品牌
 /// </summary>
 public override int CreateGoodsBrand(GoodsBrandInfo ginfo)
 {
     return TaoBaos.CreateGoodsBrand(ginfo);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新品牌信息
 /// </summary>
 public override void UpdateGoodsBrand(GoodsBrandInfo ginfo)
 {
     TaoBaos.UpdateGoodsBrand(ginfo);
 }
Ejemplo n.º 6
0
        public static List<GoodsBrandInfo> GetGoodsBrandListEntity(IDataReader reader)
        {
            List<GoodsBrandInfo> ginfolist = new List<GoodsBrandInfo>();
            while (reader.Read())
            {
                GoodsBrandInfo model = new GoodsBrandInfo();

                model.id = TypeConverter.ObjectToInt(reader["id"].ToString(), 0);
                model.bname = reader["bname"].ToString();
                model.spell = reader["spell"].ToString();
                model.website = reader["website"].ToString();
                model.bcompany = reader["bcompany"].ToString();
                model.order = TypeConverter.ObjectToInt(reader["order"], 0);
                model.logo = reader["logo"].ToString();
                model.img = reader["img"].ToString();
                model.keyword = reader["keyword"].ToString();
                model.shortdesc = reader["shortdesc"].ToString();
                model.detaildesc = reader["detaildesc"].ToString();
                model.status = TypeConverter.ObjectToInt(reader["status"], 0);
                model.relateclass = reader["relateclass"].ToString();
                ginfolist.Add(model);
            }
            reader.Close();
            return ginfolist;
        }
Ejemplo n.º 7
0
        public static List<GoodsBrandInfo> GetGoodsBrandListEntity(DataTable dt)
        {
            List<GoodsBrandInfo> ginfolist = new List<GoodsBrandInfo>();
            foreach (DataRow dr in dt.Rows)
            {
                GoodsBrandInfo model = new GoodsBrandInfo();

                model.id = TypeConverter.ObjectToInt(dr["id"].ToString(), 0);
                model.bname = dr["bname"].ToString();
                model.spell = dr["spell"].ToString();
                model.website = dr["website"].ToString();
                model.bcompany = dr["bcompany"].ToString();
                model.order = TypeConverter.ObjectToInt(dr["order"], 0);
                model.logo = dr["logo"].ToString();
                model.img = dr["img"].ToString();
                model.keyword = dr["keyword"].ToString();
                model.shortdesc = dr["shortdesc"].ToString();
                model.detaildesc = dr["detaildesc"].ToString();
                model.status = TypeConverter.ObjectToInt(dr["status"], 0);
                model.relateclass = dr["relateclass"].ToString();
                ginfolist.Add(model);
            }
            return ginfolist;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 更新品牌信息
 /// </summary>
 public void UpdateGoodsBrand(GoodsBrandInfo ginfo)
 {
     DbParameter[] parms = {
                             DbHelper.MakeInParam("@id",(DbType)SqlDbType.Int,4,ginfo.id),
                             DbHelper.MakeInParam("@bname", (DbType)SqlDbType.NVarChar,100, ginfo.bname),
                             DbHelper.MakeInParam("@spell", (DbType)SqlDbType.VarChar,100, ginfo.spell),
                             DbHelper.MakeInParam("@website", (DbType)SqlDbType.VarChar,200, ginfo.website),
                             DbHelper.MakeInParam("@bcompany", (DbType)SqlDbType.VarChar,200, ginfo.bcompany),
                             DbHelper.MakeInParam("@order", (DbType)SqlDbType.Int,4, ginfo.order),
                             DbHelper.MakeInParam("@logo", (DbType)SqlDbType.NVarChar,100, ginfo.logo),
                             DbHelper.MakeInParam("@img", (DbType)SqlDbType.VarChar,200, ginfo.img),
                             DbHelper.MakeInParam("@keyword", (DbType)SqlDbType.VarChar,500, ginfo.keyword),
                             DbHelper.MakeInParam("@shortdesc", (DbType)SqlDbType.VarChar,500, ginfo.shortdesc),
                             DbHelper.MakeInParam("@detaildesc", (DbType)SqlDbType.Text,0, ginfo.detaildesc),
                             DbHelper.MakeInParam("@status", (DbType)SqlDbType.Int,4, ginfo.status),
                             DbHelper.MakeInParam("@relateclass", (DbType)SqlDbType.VarChar,200, ginfo.relateclass)
                           };
     string commandText = String.Format("Update [{0}goodsbrand] SET [bname] = @bname,[spell] = @spell,[website] = @website,[bcompany] = @bcompany,[order] = @order,[logo] = @logo,[img] = @img,[keyword] = @keyword,[shortdesc] = @shortdesc,[detaildesc] = @detaildesc,[status] = @status,[relateclass] = @relateclass WHERE [id]=@id ", BaseConfigs.GetTablePrefix);
     DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
 private void InitializeComponent()
 {
     UpdateBrandInfo.Click += new EventHandler(UpdateBrandInfo_Click);
     brandclass.BuildTree(tpb.GetAllCategoryList(), "name", "cid");
     ginfo = tpb.GetGoodsBrandInfo(bid);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 创建商品品牌
 /// </summary>
 public abstract int CreateGoodsBrand(GoodsBrandInfo ginfo);
Ejemplo n.º 11
0
 /// <summary>
 /// 更新品牌信息
 /// </summary>
 public abstract void UpdateGoodsBrand(GoodsBrandInfo ginfo);
Ejemplo n.º 12
0
 /// <summary>
 /// 更新品牌信息
 /// </summary>
 public static void UpdateGoodsBrand(GoodsBrandInfo ginfo)
 {
     Data.DbProvider.GetInstance().UpdateGoodsBrand(ginfo);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 创建商品品牌
 /// </summary>
 public static int CreateGoodsBrand(GoodsBrandInfo ginfo)
 {
     return Data.DbProvider.GetInstance().CreateGoodsBrandInfo(ginfo);
 }