public BaseResponse <BaseTree> GetBaseTreeById(string id) { var info = BaseTree.GetBaseTreeById(id); info.GetBaseTreeChilderns(); return(BaseResponse.getResult(info)); }
public BaseResponse <BaseTree> EditBaseTree(BaseTreeAttr condtion) { BaseTree t; var thisUser = UserManager.getUserById(User.Identity.Name); string msg = "{0}基本树项目,[{1}]"; if (string.IsNullOrEmpty(condtion.id)) { //新增 t = BaseTree.CreateBaseTree(condtion); //日志 msg = string.Format(msg, "新增", condtion.text); UserLog.create(msg, "基本树维护", thisUser, t); return(BaseResponse.getResult(t, "新增成功")); } else { //编辑 var info = BaseTree.GetBaseTreeById(condtion.id); t = info.EditBaseTree(condtion); //日志 msg = string.Format(msg, "编辑", condtion.text); UserLog.create(msg, "基本树维护", thisUser, t); return(BaseResponse.getResult(info, "保存成功")); } }
public BaseResponse DelBaseTree(string id) { var thisUser = UserManager.getUserById(User.Identity.Name); var info = BaseTree.GetBaseTreeById(id); info.DelBaseTree(); UserLog.create(string.Format("物理删除基本树项目:{0}", info.text), "基本树维护", thisUser); return(BaseResponse.getResult("删除成功")); }