예제 #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
파일: Station.cs 프로젝트: Dloz/EpamTasks
 private void HandleRespond(object sender, RespondEventArgs e)
 {
     _callHandler.HandleRespond(e);
 }