public void UpdateClientTPLStatus(int clientId, TplStatus status, int internalUserId) { var clientTpl = _databaseContext.Clients.Include(c => c.ClientDetails).ThenInclude(t => t.TPLDetails).Where(x => x.ClientId == clientId).FirstOrDefault().ClientDetails.TPLDetails; if (clientTpl == null) { _databaseContext.Clients.Include(c => c.ClientDetails).ThenInclude(t => t.TPLDetails).Where(x => x.ClientId == clientId).FirstOrDefault().ClientDetails.TPLDetails = new Entities.TPLDetails() { TPLTermId = 0, Status = status }; } else { clientTpl.Status = status; } _databaseContext.SaveChanges(); }
public void UpdateClientTPLStatus(int clientId, TplStatus status, int internalUserId) { _clientDal.UpdateClientTPLStatus(clientId, status, internalUserId); }
public IActionResult UpdateClientLiabilityStatus([FromRoute] int clientId, [FromBody] TplStatus status) { _clientService.UpdateClientTPLStatus(clientId, status, User.GetInternalUserId()); return(Ok()); }