Exemplo n.º 1
0
 void Claim_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     CreateClaimCommand.RaiseCanExecuteChanged();
     ConfirmClaimCommand.RaiseCanExecuteChanged();
     DeleteClaimCommand.RaiseCanExecuteChanged();
     UnConfirmClaimCommand.RaiseCanExecuteChanged();
     RejectClaimCommand.RaiseCanExecuteChanged();
     UnRejectClaimCommand.RaiseCanExecuteChanged();
     CloseClaimCommand.RaiseCanExecuteChanged();
     UnCloseClaimCommand.RaiseCanExecuteChanged();
     MakeProblemCommand.RaiseCanExecuteChanged();
     ResolvProblemClaimCommand.RaiseCanExecuteChanged();
     AnnulateClaimCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 2
0
        public async Task CreateClaims(Model.UserClaim claim)
        {
            var claimObj = claim.MapToClaimDataModel();
            await unitOfWork.ClaimRepository.Create(claimObj);

            await unitOfWork.Complete();

            var createTransferCommand = new CreateClaimCommand(
                claimObj.ClaimId.ToString(),
                claimObj.DateOfAccident ?? DateTime.Now,
                claimObj.FirstName
                );

            await _bus.SendCommand(createTransferCommand);
        }
Exemplo n.º 3
0
        public IActionResult Post([FromBody] CreateClaimCommand command)
        {
            if (command == null)
            {
                return(BadRequest());
            }

            ////VAlidation
            //if (command. == string.Empty || command.LastName == string.Empty)
            //{
            //    ModelState.AddModelError("Name/FirstName", "The name or first name shouldn't be empty");
            //}

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var   createdClaimId = (_mediator.Send(command)).Result.Data;
            Claim createdClaim   = GetClaimById(createdClaimId);

            return(Created("Claim", createdClaim));
        }
Exemplo n.º 4
0
 public Task <int> CreateClaim(CreateClaimCommand command)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public async Task <ActionResult> Create([FromBody] CreateClaimCommand command)
 {
     return(CreatedAtAction(nameof(Get), new { claimId = await _mediator.Send(command) }));
 }
Exemplo n.º 6
0
 public async Task <IActionResult> Post(CreateClaimCommand command)
 {
     return(Ok(await _mediator.Send(command)));
 }