public ActionResult Save()
        {
            BrandModel brand = new BrandModel();
            brand.status = BaseModel.STATUS_ACTIVATE;

            brand = ObjectUtil.Eval(brand, Request.Params, "", "");
            if (string.IsNullOrEmpty(brand.brandID))
            {
                brand.brandID = brand.createPk().ToString();
            }
            JsResultObject result = BaseZdBiz.SaveOrUpdate(brand, "连锁品牌");
            return JsonText(result, JsonRequestBehavior.AllowGet);
        }
Beispiel #2
0
        public JsResultObject setHotBrand(BrandModel brand, int priorityLevel, string remark)
        {
            JsResultObject re = new JsResultObject();
            HotBrandModel hotBrand = new HotBrandModel();
            hotBrand.id = brand.brandID;
            hotBrand.name = brand.brandName;
             hotBrand.priorityLevel = priorityLevel;
             hotBrand.remark = remark;

            try
            {
                this.OpenSession();
                ITransaction itx = this.session.BeginTransaction();
                SaveOrUpdate(hotBrand, "");
                itx.Commit();
                this.CloseSession();
                re.title = "操作成功";
                re.msg = string.Format("{0} 推荐成功", brand.brandName);
            }
            catch (Exception ex)
            {
                re.title = "操作失败";
                re.code = JsResultObject.CODE_ERROR;
                re.msg = string.Format("失败原因:{0}", ex.Message);
            }
            return re;
        }
Beispiel #3
0
 public void ImportBrandList()
 {
     IList<ELongBrandAdapter> brands = ELongStaticClient.GetBrandList();
     this.OpenSession();
     ITransaction tx = this.session.BeginTransaction();
     foreach (ELongBrandAdapter brand in brands)
     {
         BrandModel temp = new BrandModel();
         temp.from(brand);
         //System.Console.WriteLine(string.Format("{0}:{1}:{2}:{3}", temp.brandID, temp.brandNameLong, temp.groupID, temp.lastChangetime.ToString()));
         this.session.SaveOrUpdate(temp);
     }
     tx.Commit();
 }