Ejemplo n.º 1
0
        /// <summary>
        /// 更新一个品牌
        /// </summary>
        /// <param name="brand"></param>
        /// <returns></returns>
        public static bool UpdateBrand(BrandModel brand)
        {
            string sqlCmd = String.Format(UpdateBrandSqlCmdTemplate, brand.BrandName, brand.Status, brand.BrandLogo, brand.OrderNum, brand.C1SysNo, brand.C2SysNo, brand.C3SysNo, brand.IsRecommend, brand.IsPromoted, brand.RecommendOrderNum, brand.PromotionOrderNum, brand.BrandSysNo);

            try
            {
                if (new SqlDBHelper().ExecuteNonQuery(sqlCmd) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得品牌信息
        /// </summary>
        /// <param name="brandId"></param>
        /// <returns></returns>
        public static BrandModel GetBrandById(string brandId)
        {
            DataTable  data  = new SqlDBHelper().ExecuteQuery(String.Format(GetSingleBrandsSqlCmdTemplate, brandId));
            BrandModel brand = new BrandModel()
            {
                BrandName         = data.Rows[0]["BrandName"].ToString().Trim(),
                BrandSysNo        = int.Parse(data.Rows[0]["BrandSysNo"].ToString().Trim()),
                BrandLogo         = data.Rows[0]["BrandIcon"].ToString().Trim(),
                Status            = int.Parse(data.Rows[0]["Status"].ToString().Trim()),
                OrderNum          = int.Parse(data.Rows[0]["OrderNum"].ToString().Trim()),
                C1SysNo           = int.Parse(data.Rows[0]["C1SysNo"].ToString().Trim()),
                C2SysNo           = int.Parse(data.Rows[0]["C2SysNo"].ToString().Trim()),
                C3SysNo           = int.Parse(data.Rows[0]["C3SysNo"].ToString().Trim()),
                IsRecommend       = int.Parse(data.Rows[0]["IsRecommend"].ToString().Trim()),
                IsPromoted        = int.Parse(data.Rows[0]["IsPromoted"].ToString().Trim()),
                PromotionOrderNum = int.Parse(data.Rows[0]["PromotionOrderNum"].ToString().Trim()),
                RecommendOrderNum = int.Parse(data.Rows[0]["RecommendOrderNum"].ToString().Trim()),
            };

            return(brand);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获得商品的品牌
 /// </summary>
 /// <returns></returns>
 public static BrandModel GetProductBrand(string productSysNo)
 {
     DataTable data = new SqlDBHelper().ExecuteQuery(String.Format(GetProductBrandSqlCmdTemplate, productSysNo));
     if (data.Rows.Count > 0)
     {
         BrandModel brand = new BrandModel()
         {
             BrandName = data.Rows[0]["BrandName"].ToString().Trim(),
             BrandSysNo = int.Parse(data.Rows[0]["BrandSysNo"].ToString().Trim()),
             BrandLogo = data.Rows[0]["BrandIcon"].ToString().Trim(),
         };
         return brand;
     }
     else
     {
         BrandModel brand = new BrandModel()
         {
             BrandName = String.Empty,
             BrandSysNo = 0,
             BrandLogo = String.Empty,
         };
         return brand;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新一个品牌
 /// </summary>
 /// <param name="brand"></param>
 /// <returns></returns>
 public static bool UpdateBrand(BrandModel brand)
 {
     string sqlCmd = String.Format(UpdateBrandSqlCmdTemplate, brand.BrandName, brand.Status, brand.BrandLogo, brand.OrderNum, brand.C1SysNo, brand.C2SysNo, brand.C3SysNo, brand.IsRecommend, brand.IsPromoted, brand.RecommendOrderNum, brand.PromotionOrderNum, brand.BrandSysNo);
     try
     {
         if (new SqlDBHelper().ExecuteNonQuery(sqlCmd) > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 获得品牌信息
 /// </summary>
 /// <param name="brandId"></param>
 /// <returns></returns>
 public static BrandModel GetBrandById(string brandId)
 {
     DataTable data = new SqlDBHelper().ExecuteQuery(String.Format(GetSingleBrandsSqlCmdTemplate, brandId));
     BrandModel brand = new BrandModel()
     {
         BrandName = data.Rows[0]["BrandName"].ToString().Trim(),
         BrandSysNo = int.Parse(data.Rows[0]["BrandSysNo"].ToString().Trim()),
         BrandLogo = data.Rows[0]["BrandIcon"].ToString().Trim(),
         Status = int.Parse(data.Rows[0]["Status"].ToString().Trim()),
         OrderNum = int.Parse(data.Rows[0]["OrderNum"].ToString().Trim()),
         C1SysNo = int.Parse(data.Rows[0]["C1SysNo"].ToString().Trim()),
         C2SysNo = int.Parse(data.Rows[0]["C2SysNo"].ToString().Trim()),
         C3SysNo = int.Parse(data.Rows[0]["C3SysNo"].ToString().Trim()),
         IsRecommend = int.Parse(data.Rows[0]["IsRecommend"].ToString().Trim()),
         IsPromoted = int.Parse(data.Rows[0]["IsPromoted"].ToString().Trim()),
         PromotionOrderNum = int.Parse(data.Rows[0]["PromotionOrderNum"].ToString().Trim()),
         RecommendOrderNum = int.Parse(data.Rows[0]["RecommendOrderNum"].ToString().Trim()),
     };
     return brand;
 }