/// <summary> /// 编辑/新增题目 /// </summary> /// <param name="crmQpaperQuDto"></param> /// <returns></returns> public CrmQpaperQu SaveQpaperQuInfo(CrmQpaperQuDto crmQpaperQuDto, ref string msg) { try { CrmQpaperQu qu = null; if (CheckQuestion(crmQpaperQuDto.Id, crmQpaperQuDto.QU_NAME, crmQpaperQuDto.QU_SN, AbpSession.BG_NO, ref msg)) { if (string.IsNullOrEmpty(crmQpaperQuDto.Id)) { //新增 crmQpaperQuDto.Id = Guid.NewGuid().ToString("N"); _initHelper.InitAdd(crmQpaperQuDto, AbpSession.USR_ID, AbpSession.ORG_NO, AbpSession.BG_NO); qu = _crmQpaperQuRepository.Insert(crmQpaperQuDto.ToEntity()); } else { //修改 _initHelper.InitUpdate(crmQpaperQuDto, AbpSession.USR_ID); qu = _crmQpaperQuRepository.Update(crmQpaperQuDto.ToEntity()); } } return(qu); } catch (Exception ex) { throw ex; } }
public ActionResult SaveQpaperQuInfo([FromBody] CrmQpaperQuDto crmQpaperQuDto) { try { string msg = ""; var result = _crmQpaperQuService.SaveQpaperQuInfo(crmQpaperQuDto, ref msg); if (result == null) { return(Fail("保存失败:" + msg)); } return(Success("保存成功", result)); } catch (global::System.Exception ex) { return(Fail("保存失败:" + ex.Message)); } }