Exemplo n.º 1
0
        /// <summary>
        /// lấy nhưng cuộc gọi đã có duration, và cập nhật BD
        /// </summary>
        private void XacDinhCuocGoiCoDuration_VOC()
        {
            try
            {
                List <int> ListInDexDurationXoa = new List <int>();
                int        index = -1;
                if ((g_ListCuocGoiLogInComing == null) || (g_ListCuocGoiLogInComing.Count <= 0))
                {
                    return;
                }
                for (int i = 0; i < g_ListCuocGoiLogInComing.Count; i++)
                {
                    index++;
                    DateTime Duration;
                    string   FileAmThanh;
                    DateTime ThoiDiemBatDauNghe;
                    TimeSpan timeSpan = DateTime.Now - g_ListCuocGoiLogInComing[i].ThoiDiemGoiDen;
                    if (timeSpan.TotalSeconds > 5)     // nhung cuoc cach thoi gian nghe may it nhat 5 giay thi moi xu ly
                    {
                        bool bOK = TaxiCapture.GetThongTinCuaCuocGoiDaNgheMayCo_Duration_VOC(g_ListCuocGoiLogInComing[i].PhoneNumber, g_ListCuocGoiLogInComing[i].ThoiDiemGoiDen, g_FileVOCPath, out ThoiDiemBatDauNghe, out Duration, out FileAmThanh);

                        if (bOK)
                        {
                            CapNhatDuratoin_FileAmThanh_LogInComing(g_ConnecString, g_ListCuocGoiLogInComing[i].PhoneNumber, g_ListCuocGoiLogInComing[i].ThoiDiemNgheMay, GetSoChuong(g_ListCuocGoiLogInComing[i].ThoiDiemGoiDen, ThoiDiemBatDauNghe), Duration, FileAmThanh);
                            ListInDexDurationXoa.Add(index);
                        }
                    }
                }

                if ((ListInDexDurationXoa != null) && (ListInDexDurationXoa.Count > 0))
                {
                    foreach (int indexXoa in ListInDexDurationXoa)
                    {
                        if ((indexXoa >= 0) && (g_ListCuocGoiLogInComing.Count > 0))
                        {
                            g_ListCuocGoiLogInComing.RemoveAt(indexXoa);
                        }
                    }
                    ListInDexDurationXoa.Clear();
                    ListInDexDurationXoa = null;
                }
            }
            catch (Exception ex)
            {
                LogError.WriteLogError("Loi  XacDinhCuocGoiCoDuration_VOC ", ex);
            }
        }