Beispiel #1
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 #2
0
        public ActionResult SaveHotBrand(string ids)
        {
            HotBrandModel e = new HotBrandModel();

            e = ObjectUtil.Eval(e, Request.Params, "", "");
            if (string.IsNullOrEmpty(e.id))
            {
                e.id = e.createPk().ToString();
            }
            JsResultObject result = BaseZdBiz.SaveOrUpdate(e, "热门品牌");

            return(JsonText(result, JsonRequestBehavior.AllowGet));
        }