/// <summary> /// 保存工作分组 /// </summary> /// <param name="jobGroupInfo">工作分组对象</param> /// <returns>执行结果</returns> public Result <JobGroupDto> SaveJobGroup(JobGroupCmdDto jobGroupInfo) { using (var businessWork = WorkFactory.Create()) { if (jobGroupInfo == null) { return(Result <JobGroupDto> .FailedResult("分组信息不完整")); } var jobGroup = jobGroupInfo.MapTo <JobGroup>(); JobGroupDomainService.SaveJobGroup(jobGroup); var commitResult = businessWork.Commit(); Result <JobGroupDto> result = null; if (commitResult.ExecutedSuccess) { result = Result <JobGroupDto> .SuccessResult("保存成功"); result.Data = jobGroup.MapTo <JobGroupDto>(); } else { result = Result <JobGroupDto> .FailedResult("保存失败"); } return(result); } }
/// <summary> /// 保存工作分组 /// </summary> /// <param name="jobGroup">工作分组对象</param> /// <returns>执行结果</returns> public Result <JobGroupDto> SaveJobGroup(JobGroupCmdDto jobGroup) { return(jobGroupBusiness.SaveJobGroup(jobGroup)); }