public async Task <bool> CreateOrUpdateAgentSupplier(AgentSupplier agentSupplier, int?modifiedBy = null) { var exists = await _agentSupplierService.ExistsAsync(agentSupplier); if (exists) { var oldAgentSupplier = await _agentSupplierService.GetAsync(agentSupplier.ID); await _statusLogService.LogStatusAsync(oldAgentSupplier, agentSupplier, nameof(agentSupplier.IsActive), agentSupplier.Remark, (int)modifiedBy); return(await _agentSupplierService.UpdateAsync(agentSupplier)); } var result = await _agentSupplierService.CreateAsync(agentSupplier); return(result); }
public async Task <bool> InsertOrUpdateAgentSupplier([FromBody] AgentSupplier agentSupplier) { var result = await _service.CreateOrUpdateAgentSupplier(agentSupplier, this.HttpContext.GetUserID()); return(result); }