Esempio n. 1
0
 public MainRule(LoadCarrierReceiptsCreateRequest request, IRule parentRule = null)
 {
     // Create Context
     Context        = new ContextModel(request, this);
     ParentRule     = parentRule;
     ValidEvaluate += OnValidEvaluate;
 }
Esempio n. 2
0
 public Task <ActionResult <LoadCarrierReceipt> > Post([FromBody] LoadCarrierReceiptsCreateRequest request)
 {
     if (request != null && request.DplNote != null && _authData.GetUserRole() == UserRole.DplEmployee)
     {
         request.DplNote.UserId = _authData.GetUserId();
     }
     return(this._loadCarrierReceiptsService.Create(request).Convert <LoadCarrierReceipt>(this));
 }
        public async Task <IWrappedResponse> Create(LoadCarrierReceiptsCreateRequest request)
        {
            var cmd = ServiceCommand <Contracts.Models.LoadCarrierReceipt, Rules.LoadCarrierReceipts.Create.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.LoadCarrierReceipts.Create.MainRule(request))
                      .Then(CreateAction);

            var result = cmd.Execute();

            return(await result);
        }