public void UpdateCategory(Entities.CategoryInfo model) { var category = DbFactory.Default.Get <Entities.CategoryInfo>().Where(p => p.Id == model.Id).FirstOrDefault(); category.Icon = model.Icon; category.Meta_Description = model.Meta_Description; category.Meta_Keywords = model.Meta_Keywords; category.Meta_Title = model.Meta_Title; category.Name = model.Name; category.RewriteName = model.RewriteName; category.TypeId = model.TypeId; category.CommisRate = model.CommisRate; category.SupportVirtualProduct = model.SupportVirtualProduct; DbFactory.Default.Update(category); Cache.Remove(CacheKeyCollection.Category); }
public CategoryModel(Entities.CategoryInfo m) : this() { this.Id = m.Id; this.Depth = m.Depth; this.DisplaySequence = m.DisplaySequence; this.HasChildren = m.HasChildren; this.Icon = m.Icon; this.Description = m.Meta_Description; this.Keywords = m.Meta_Keywords; this.Title = m.Meta_Title; this.Name = m.Name; this.ParentCategoryId = m.ParentCategoryId; this.RewriteName = m.RewriteName; this.Path = m.Path; this.TypeId = m.TypeId; this.CommisRate = m.CommisRate; this.IsShow = m.IsShow; this.SupportVirtualProduct = m.SupportVirtualProduct; }
public JsonResult UpdateName(string name, long id, int depth) { try { _iCategoryService.UpdateCategoryName(id, name); Entities.CategoryInfo temp = new Entities.CategoryInfo() { Id = id, Name = name, Depth = depth }; Task.Factory.StartNew(() => { _iSearchProductService.UpdateCategory(temp); }); } catch (Exception ex) { return(Json(new Result { success = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } return(Json(new Result { success = true }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 根据Category模型更新 /// </summary> /// <param name="model"></param> public static void UpdateCategory(Entities.CategoryInfo model) { _iCategoryService.UpdateCategory(model); }
/// <summary> /// 添加一个分类 /// </summary> /// <param name="model"></param> public static void AddCategory(Entities.CategoryInfo model) { _iCategoryService.AddCategory(model); }