Ejemplo n.º 1
0
        }// icprn

        public string ToReportStringFormat()
        {
            // seqNum, siteName, type, discMessage, discCode, APartyNum, BPartyNum,APartyType,BPartyType,APartyDigits,BPartyDigits,
            // SeizeTime, AnswerTime, DisconnectTime, CallDuration, CellId, OMSISDN,
            string comma    = ",";
            char   zero_pad = Convert.ToChar("0");

            // only convert the fields being used in our report
            StringBuilder sb = new StringBuilder();

            sb.Append(SequenceNumber + ",");
            string recordType = String.Empty;
            int    theType    = Convert.ToInt32(Type);

            switch (theType)
            {
            case (int)OmcCdrEnums.RecordType.Call_Record:
                recordType = OmcCdrEnums.RecordType.Call_Record.ToString();
                break;

            case (int)OmcCdrEnums.RecordType.SMS_Record:
                recordType = OmcCdrEnums.RecordType.SMS_Record.ToString();
                break;
            }

            // vessel id
            CiberDbMgr cDb      = new CiberDbMgr();
            string     siteName = cDb.GetSiteNameForCellId(CellId);

            sb.Append(siteName + comma);
            sb.Append(recordType + comma);

            DisconnectCodeMgr dMgr     = new DisconnectCodeMgr();
            string            dMessage = dMgr.GetDisconnectMessage(DisconnectCode);

            sb.Append(dMessage + comma);
            sb.Append(DisconnectCode + comma);

            sb.Append(A_Party_Num + comma);
            sb.Append(B_Party_Num + comma);
            string atype = dMgr.GetPartyType(A_Party_Type);
            string btype = dMgr.GetPartyType(B_Party_Type);

            sb.Append(atype + comma);
            sb.Append(btype + comma);
            sb.Append(A_Party_Digits + comma);
            sb.Append(B_Party_Digits + comma);
            sb.Append(Seize.ToString("s") + comma);
            sb.Append(Answer.ToString("s") + comma);
            sb.Append(Disconnect.ToString("s") + comma);

            // call duration

            TimeSpan callDuration  = Disconnect.Subtract(Seize);
            string   airChargeTime = callDuration.Hours.ToString().PadLeft(2, zero_pad) + ":" + callDuration.Minutes.ToString().PadLeft(2, zero_pad) + ":" + callDuration.Seconds.ToString("D2");

            sb.Append(airChargeTime + comma);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public string ToReportStringFormat()
        {
            // seqNum, siteName, type, discMessage, discCode, APartyNum, BPartyNum,APartyType,BPartyType,APartyDigits,BPartyDigits,
            // SeizeTime, AnswerTime, DisconnectTime, CallDuration, CellId, OMSISDN,
            string comma = ",";
            char zero_pad = Convert.ToChar("0");

            // only convert the fields being used in our report
            StringBuilder sb = new StringBuilder();

            sb.Append(SequenceNumber + ",");
            string recordType = String.Empty;
            int theType = Convert.ToInt32(Type);

            switch ( theType )
            {
                case (int) OmcCdrEnums.RecordType.Call_Record:
                    recordType = OmcCdrEnums.RecordType.Call_Record.ToString();
                    break;
                case (int) OmcCdrEnums.RecordType.SMS_Record:
                    recordType = OmcCdrEnums.RecordType.SMS_Record.ToString();
                    break;
            }

            // vessel id
            CiberDbMgr cDb = new CiberDbMgr();
            string siteName = cDb.GetSiteNameForCellId(CellId);
            sb.Append(siteName + comma);
            sb.Append(recordType + comma);

            DisconnectCodeMgr dMgr = new DisconnectCodeMgr();
            string dMessage = dMgr.GetDisconnectMessage(DisconnectCode);
            sb.Append(dMessage + comma);
            sb.Append(DisconnectCode + comma);

            sb.Append(A_Party_Num + comma );
            sb.Append(B_Party_Num + comma );
            string atype = dMgr.GetPartyType(A_Party_Type);
            string btype = dMgr.GetPartyType(B_Party_Type);
            sb.Append(atype + comma );
            sb.Append(btype + comma);
            sb.Append(A_Party_Digits + comma );
            sb.Append(B_Party_Digits + comma );
            sb.Append(Seize.ToString("s") + comma);
            sb.Append(Answer.ToString("s") + comma);
            sb.Append( Disconnect.ToString("s") + comma );

            // call duration

            TimeSpan callDuration = Disconnect.Subtract( Seize );
            string airChargeTime = callDuration.Hours.ToString().PadLeft(2, zero_pad) + ":" + callDuration.Minutes.ToString().PadLeft(2, zero_pad) + ":" + callDuration.Seconds.ToString("D2") ;
            sb.Append(airChargeTime + comma);

            return sb.ToString();
        }