コード例 #1
0
 public IHttpActionResult Create([FromBody] CreateApprovalProcDto ApprovalProc)
 {
     if (ApprovalProc == null)
     {
         return(BadRequest());
     }
     if (!ModelState.IsValid)
     {
         string errorMessage = new ModelStateError(_logger).OutputMessage(ModelState);
         return(BadRequest(errorMessage));
     }
     try
     {
         _ApprovalProcService.Create(ApprovalProc);
     }
     catch (LogicalException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch
     {
         return(BadRequest(AppSettings.INTERNAL_SERVER_ERROR_MESSAGE));
     }
     return(Ok());
 }
コード例 #2
0
        public void Create(CreateApprovalProcDto dto)
        {
            var approvalProc = new ApprovalProc
            {
                Title            = dto.Title,
                ParentId         = dto.ParentId,
                FirstPriorityId  = dto.FirstPriorityId,
                SecondPriorityId = dto.SecondPriorityId,
                ThirdPriorityId  = dto.ThirdPriorityId,
                ActiveState      = dto.ActiveState
            };

            _approvalProcRepository.Insert(approvalProc);
        }