public async Task UpdateDependentAsync(UpdateDependentModel dependentToUpdate)
        {
            var response = await _client.PutAsJsonAsync("api/EmployeeBenefits/UpdateDependet", dependentToUpdate);

            if (!response.IsSuccessStatusCode)
            {
                //todo: log errors
            }
        }
Exemple #2
0
        public async Task <IActionResult> UpdateDependetAsync(UpdateDependentModel dependent)
        {
            try
            {
                await new DependentOrchestration().UpdateDependetAsync(_dependentRepository, dependent).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.InnerException));
            }

            return(Ok());
        }
        public async Task <IActionResult> UpdateDependet(UpdateDependentModel dependent)
        {
            try
            {
                await new DependentTransactions().UpdateDependentAsync(_updateDependentCommand, _getEmployeeDependentQuery, dependent).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.InnerException));
            }

            return(Ok());
        }
Exemple #4
0
        public async Task UpdateDependentAsync(IUpdateCommandNoResult <Dependent> updateDependentCommand, IQuery <Dependent, Guid> getDependentQuery,
                                               UpdateDependentModel dependentModel)
        {
            var dependentToUpdate = await getDependentQuery.ExecuteQueryAsync(dependentModel.Id);

            dependentToUpdate.FirstName = dependentModel.FirstName;
            dependentToUpdate.LastName  = dependentModel.LastName;
            dependentToUpdate.Ssn       = dependentModel.Ssn;
            dependentToUpdate.Dob       = dependentModel.Dob;
            dependentToUpdate.UpdatedOn = DateTime.Now;

            //  todo: apply error checking before executing command
            await updateDependentCommand.ExecuteAsync(dependentToUpdate);
        }
Exemple #5
0
        public async Task UpdateDependentAsync(UpdateDependentModel dependentToUpdate)
        {
            try
            {
                var response = await _client.PutAsJsonAsync("api/Dependents/UpdateDependet", dependentToUpdate);

                if (response.IsSuccessStatusCode)
                {
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                // add log
                throw;
            }
        }
 public async Task UpdateDependetAsync(IDependentRepository dependetRepository, UpdateDependentModel dependetToUpdate)
 {
     //todo: add logs and error checking
     await dependetRepository.UpdateDependentAsync(dependetToUpdate);
 }