//按ID获取标签 public ActionResult GetLabelById(int id) { ProductLabelService labelDal = new ProductLabelService(); SWfsProductLabel obj = labelDal.GetLabelById(id); return(Json(obj, JsonRequestBehavior.AllowGet)); }
//修改标签 public int EditeLabel(SWfsProductLabel obj) { //验证是否存在重复标签 return(DapperUtil.UpdatePartialColumns <SWfsProductLabel>(new { LabelId = obj.LabelId, LabelName = obj.LabelName, LabelType = obj.LabelType, LabelNickName = obj.LabelNickName }) ? 1 : 0); }
//添加标签 obj 赋值 字段 ParentNo LabelName LabelType 即可 public int AddProductLabel(SWfsProductLabel obj) { //查询同级标签类 中最大的 标签编号 obj.LabelNo = CreateLabelNo(obj.ParentNo); return(DapperUtil.Insert <SWfsProductLabel>(obj, true)); }