예제 #1
0
 public Task <ActionResult <Voucher> > Post([FromBody] VouchersCreateRequest request)
 {
     if (request != null && request.DplNote != null && _authData.GetUserRole() == UserRole.DplEmployee)
     {
         request.DplNote.UserId = _authData.GetUserId();
     }
     return(this._vouchersService.Create(request).Convert <Voucher>(this));
 }
예제 #2
0
        public async Task <IWrappedResponse> Create(VouchersCreateRequest request)
        {
            // Use ServiceCommand to create typically execution pattern
            var cmd = ServiceCommand <PostingRequest, Rules.Vouchers.Create.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Vouchers.Create.MainRule(request))
                      .Then(CreateAction);

            return(await cmd.Execute());
        }
예제 #3
0
 public MainRule(VouchersCreateRequest request)
 {
     // Create Context
     Context = new ContextModel(request, this);
 }