public async Task <MethodReturnResult> AddAsync(BaseAttributeCategory obj) { return(await Task.Run <MethodReturnResult>(() => { return base.Channel.Add(obj); })); }
/// <summary> /// 修改基础属性分类。 /// </summary> /// <param name="obj">基础属性分类数据。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Modify(BaseAttributeCategory obj) { MethodReturnResult result = new MethodReturnResult(); if (!this.BaseAttributeCategoryDataEngine.IsExists(obj.Key)) { result.Code = 1002; result.Message = String.Format(StringResource.BaseAttributeCategoryService_IsNotExists, obj.Key); return(result); } try { this.BaseAttributeCategoryDataEngine.Update(obj); } catch (Exception ex) { result.Code = 1000; result.Message = String.Format(StringResource.BaseAttributeCategoryService_OtherError, ex.Message); } return(result); }
/// <summary> /// 添加基础属性分类。 /// </summary> /// <param name="obj">基础属性分类数据。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Add(BaseAttributeCategory obj) { MethodReturnResult result = new MethodReturnResult(); if (this.BaseAttributeCategoryDataEngine.IsExists(obj.Key)) { result.Code = 1001; result.Message = String.Format(StringResource.BaseAttributeCategoryService_IsExists, obj.Key); return(result); } try { this.BaseAttributeCategoryDataEngine.Insert(obj); } catch (Exception ex) { result.Code = 1000; result.Message = String.Format(StringResource.BaseAttributeCategoryService_OtherError, ex.Message); result.Detail = ex.ToString(); } return(result); }
public async Task <ActionResult> Save(BaseAttributeCategoryViewModel model) { using (BaseAttributeCategoryServiceClient client = new BaseAttributeCategoryServiceClient()) { BaseAttributeCategory obj = new BaseAttributeCategory() { Key = model.Name, Description = model.Description, Editor = User.Identity.Name, EditTime = DateTime.Now, CreateTime = DateTime.Now, Creator = User.Identity.Name }; MethodReturnResult rst = await client.AddAsync(obj); if (rst.Code == 0) { rst.Message = string.Format(StringResource.BaseAttributeCategory_Save_Success , model.Name); } return(Json(rst)); } }
/// <summary> /// 添加基础数据分类。 /// </summary> /// <param name="obj">基础数据分类数据。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Add(BaseAttributeCategory obj) { return(base.Channel.Add(obj)); }
/// <summary> /// 修改基础数据分类。 /// </summary> /// <param name="obj">基础数据分类数据。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Modify(BaseAttributeCategory obj) { return(base.Channel.Modify(obj)); }