public void HandleRespond(RespondEventArgs e) { var currentConnection = _connections.FirstOrDefault(c => c.TargetNumber == e.ResponderNumber); if (currentConnection == null) { return; } var callerContract = PhoneOperator.Clients .SelectMany(c => c.Contracts) .First(c => c.PhoneNumber == currentConnection.CallerNumber); var targetContract = PhoneOperator.Clients .SelectMany(c => c.Contracts) .First(c => c.PhoneNumber == currentConnection.TargetNumber); ICallRecord callRecord = new CallRecordModel(callerContract.PhoneNumber, targetContract.PhoneNumber, DateTime.Now, currentConnection.Id); callerContract.CallHistory.Add(callRecord); targetContract.CallHistory.Add(callRecord); }
private void Respond(object sender, RespondEventArgs e) { RespondEvent?.Invoke(this, e); }
private void HandleRespond(object sender, RespondEventArgs e) { _callHandler.HandleRespond(e); }