示例#1
0
 //public List<string> missedItemsText { get; set; }
 public CallDetail()
 {
     systemData      = new CallSystemData();
     metaData        = new CallMetaData();
     customData      = new CallMetaData();
     callMissedItems = new List <QuestionDetails_v2>();
 }
示例#2
0
        public static CallSystemMetaData Create(IDataReader reader)
        {
            CallSystemMetaData callSystemMetaData = new CallSystemMetaData();

            while (reader.Read())
            {
                var metaDataItem   = CallMetaData.Create(reader);
                var systemDataItem = CallSystemData.Create(reader);

                callSystemMetaData.callDetails.Add(new CallDetail
                {
                    metaData   = metaDataItem,
                    systemData = systemDataItem
                });
            }
            return(callSystemMetaData);
        }
示例#3
0
        public static CallDetails Create(IDataReader reader)
        {
            List <CallDetail> calldetail = new List <CallDetail>();

            while (reader.Read())
            {
                var metaDataItem   = CallMetaData.Create(reader);
                var systemDataItem = CallSystemData.Create(reader);

                calldetail.Add(new CallDetail
                {
                    metaData   = metaDataItem,
                    systemData = systemDataItem
                });
            }

            long count = 0;

            if (reader.NextResult())
            {
                while (reader.Read())
                {
                    count = reader.Get <long>("callsCount");//long.Parse(reader.GetValue(reader.GetOrdinal("callsCount")).ToString());
                }
            }
            var questionDetails = new List <QuestionDetails_v2>();

            if (reader.NextResult())
            {
                try
                {
                    //Mapping for Question Details using factory method
                    questionDetails = QuestionDetails_v2.Create(reader);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            if (reader.NextResult())
            {
                DataTable table = new DataTable();
                table.Load(reader);

                var dynamicTable = table.ToDynamic();
                foreach (var call in calldetail)
                {
                    call.customData = dynamicTable.Where(m => m.callId == call.systemData.callId).First();
                }
            }

            foreach (var call in calldetail)
            {
                call.callMissedItems = (from a in questionDetails where a.callId == call.systemData.callId select a).ToList();
                //call.missedItemsText = (from a in questionDetails where a.callId == call.systemData.callId select a.questionShortName).ToList();
            }
            var CallDetailsLst = new CallDetails
            {
                itemsTotal = count,
                calls      = calldetail
            };

            return(CallDetailsLst);
        }