예제 #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();
 }
예제 #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);
        }
예제 #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));
        }
예제 #4
0
 public Task <int> CreateClaim(CreateClaimCommand command)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public async Task <ActionResult> Create([FromBody] CreateClaimCommand command)
 {
     return(CreatedAtAction(nameof(Get), new { claimId = await _mediator.Send(command) }));
 }
예제 #6
0
 public async Task <IActionResult> Post(CreateClaimCommand command)
 {
     return(Ok(await _mediator.Send(command)));
 }