Exemplo n.º 1
0
        private static ICommunication fromAbandonedRecord(string[] record)
        {
            try
            {
                DateTime firstRingTime = DateTime.Parse(record[0]);

                int accountCode = ClosingReport.sentinel;
                int.TryParse(record[1], out accountCode);

                TimeSpan callDuration = TimeManagement.StampToSpan(record[2]);

                ICommunication comm = new Communication(
                    timeOfReceipt: firstRingTime,
                    groupId: accountCode,
                    direction: CommDirection.Inbound,
                    wasReceived: false,
                    timePendingResponse: null,
                    duration: callDuration
                    );

                ClosingReport.log.TraceEvent(TraceEventType.Information, 0, $"Parsed communication: {comm}");
                return(comm);
            }
            catch (Exception e)
            {
                throw new ParseException($"Unable to parse call from CVS row: {record}. Got error: {e.Message}");
            }
        }
Exemplo n.º 2
0
        private static ICommunication fromInboundRecord(string[] row)
        {
            try
            {
                DateTime firstRingTime   = DateTime.Parse(row[0]);
                string   telephoneNumber = row[1];
                TimeSpan callDuration    = TimeManagement.StampToSpan(row[2]);

                int agentId = ClosingReport.sentinel;
                int.TryParse(row[3], out agentId);

                int accountCode = ClosingReport.sentinel;
                int.TryParse(row[4], out accountCode);

                TimeSpan ringDuration = TimeManagement.StampToSpan(row[5]);

                ICommunication comm = new Communication(
                    timeOfReceipt: firstRingTime,
                    groupId: accountCode,
                    direction: CommDirection.Inbound,
                    wasReceived: true,
                    timePendingResponse: ringDuration,
                    duration: callDuration
                    );

                ClosingReport.log.TraceEvent(TraceEventType.Information, 0, $"Parsed communication: {comm}");
                return(comm);
            }
            catch (Exception e)
            {
                throw new ParseException($"Unable to parse communication from CVS row: {row}. Got error: {e.Message}");
            }
        }