예제 #1
0
 public Task <ActionResult <Voucher> > PatchVoucherCancel(int id, [FromBody] VouchersCancelRequest request)
 {
     if (request != null && request.DplNote != null && _authData.GetUserRole() == UserRole.DplEmployee)
     {
         request.DplNote.UserId = _authData.GetUserId();
     }
     return(this._vouchersService.Cancel(id, request).Convert <Voucher>(this));
 }
예제 #2
0
        public async Task <IWrappedResponse> Cancel(int id, VouchersCancelRequest request)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.Vouchers.Cancel.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Vouchers.Cancel.MainRule((id, request)))
                      .Then(CancelAction);

            return(await cmd.Execute());
        }