Пример #1
0
        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);
        }
Пример #2
0
 private void Respond(object sender, RespondEventArgs e)
 {
     RespondEvent?.Invoke(this, e);
 }
Пример #3
0
 private void HandleRespond(object sender, RespondEventArgs e)
 {
     _callHandler.HandleRespond(e);
 }