Ejemplo n.º 1
0
        public Report GetReport(int telephoneNumber)
        {
            var calls = Memory.GetInformationList().
                        Where(x => x.Number == telephoneNumber || x.TargetNumber == telephoneNumber).ToList();
            var report = new Report();

            foreach (var call in calls)
            {
                TypeOfCall callType;
                int        number;
                if (call.Number == telephoneNumber)
                {
                    callType = TypeOfCall.OutgoingCall;
                    number   = call.TargetNumber;
                }
                else
                {
                    callType = TypeOfCall.IncomingCall;
                    number   = call.Number;
                }
                var record = new RecordOfReport(callType, number, call.StartOfCall, new DateTime((call.EndOfCall - call.StartOfCall).Ticks), call.CostOfCall);
                // TimeSpan.FromTicks((call.EndCall - call.BeginCall).Ticks) .TotalMinutes
                report.AddRecordOfReport(record);
            }
            return(report);
        }
Ejemplo n.º 2
0
 public void AddRecordOfReport(RecordOfReport record)
 {
     Records.Add(record);
 }