コード例 #1
0
        public async Task <IActionResult> AccountingAccepted([FromBody] RejectionForm form)
        {
            try
            {
                VerifyUser();

                await _service.SendToPurchasingRejected(form.ids, form.Remark);

                return(NoContent());
            }
            catch (Exception e)
            {
                var result =
                    new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                    .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result));
            }
        }
コード例 #2
0
        public async Task <IActionResult> SendToPurchasingRejected([FromRoute] int id, [FromBody] RejectionForm form)
        {
            try
            {
                VerifyUser();

                await _service.SendToPurchasingRejected(id, form.Remark);

                var result = new ResultFormatter(ApiVersion, General.CREATED_STATUS_CODE, General.OK_MESSAGE).Ok();

                return(NoContent());
            }
            catch (Exception e)
            {
                var result =
                    new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                    .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result));
            }
        }