public async Task <IActionResult> ClientPropertyDelete(ClientPropertiesDto clientProperty) { await _clientService.DeleteClientPropertyAsync(clientProperty); SuccessNotification(_localizer["SuccessDeleteClientProperty"], _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ClientProperties), new { Id = clientProperty.ClientId })); }
public virtual async Task <int> DeleteClientPropertyAsync(ClientPropertiesDto clientProperty) { var clientPropertyEntity = clientProperty.ToEntity(); var deleted = await ClientRepository.DeleteClientPropertyAsync(clientPropertyEntity); await AuditEventLogger.LogEventAsync(new ClientPropertyDeletedEvent(clientProperty)); return(deleted); }
public virtual async Task <int> AddClientPropertyAsync(ClientPropertiesDto clientProperties) { var clientProperty = clientProperties.ToEntity(); var saved = await ClientRepository.AddClientPropertyAsync(clientProperties.ClientId, clientProperty); await AuditEventLogger.LogEventAsync(new ClientPropertyAddedEvent(clientProperties)); return(saved); }
public async Task <IActionResult> DeleteProperty(int propertyId) { var clientProperty = new ClientPropertiesDto { ClientPropertyId = propertyId }; await _clientService.GetClientPropertyAsync(clientProperty.ClientPropertyId); await _clientService.DeleteClientPropertyAsync(clientProperty); return(Ok()); }
public async Task <IActionResult> ClientProperties(ClientPropertiesDto clientProperty) { if (!ModelState.IsValid) { return(Success(clientProperty)); } await _clientService.AddClientPropertyAsync(clientProperty); return(Success(new { Id = clientProperty.ClientId })); }
public async Task <IActionResult> ClientProperties(ClientPropertiesDto clientProperty) { if (!ModelState.IsValid) { return(View(clientProperty)); } await _clientService.AddClientPropertyAsync(clientProperty); SuccessNotification(string.Format(_localizer["SuccessAddClientProperty"], clientProperty.ClientId, clientProperty.ClientName), _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ClientProperties), new { Id = clientProperty.ClientId })); }
public async Task <IActionResult> ClientPropertyDelete(ClientPropertiesDto clientProperty) { if (await IsUserManagerOrAdmin(clientProperty.ClientId)) { await _clientService.DeleteClientPropertyAsync(clientProperty); SuccessNotification(_localizer["SuccessDeleteClientProperty"], _localizer["SuccessTitle"]); } else { UnauthorizedNotification(); } return(RedirectToAction(nameof(ClientProperties), new { Id = clientProperty.ClientId })); }
public static ClientProperty ToEntity(this ClientPropertiesDto clientProperties, IMapper mapper) { return(mapper.Map <ClientProperty>(clientProperties)); }
public async Task <int> DeleteClientPropertyAsync(ClientPropertiesDto clientProperty) { var clientPropertyEntity = clientProperty.ToEntity(); return(await _clientRepository.DeleteClientPropertyAsync(clientPropertyEntity)); }
public async Task <int> AddClientPropertyAsync(ClientPropertiesDto clientProperties) { var clientProperty = clientProperties.ToEntity(); return(await _clientRepository.AddClientPropertyAsync(clientProperties.ClientId, clientProperty)); }
public ClientPropertiesRequestedEvent(ClientPropertiesDto clientProperties) { ClientProperties = clientProperties; }
public ClientPropertyAddedEvent(ClientPropertiesDto clientProperties) { ClientProperties = clientProperties; }
public ClientPropertyDeletedEvent(ClientPropertiesDto clientProperty) { ClientProperty = clientProperty; }