Пример #1
0
        /// <summary>
        /// cập nhật db cuộc gọi nhỡ
        /// xóa trong g_ListCuocGoiLogInComing ds cuộc gọi đang theo doi
        /// </summary>
        /// <param name="ListInCom"></param>
        private void UpdateDataBase_And_DeleteCuocGoiNho()
        {
            List <int> ListCuocGoiCanXoaIndex = new List <int>();
            int        Index = -1;

            for (int i = 0; i < g_ListCuocGoiLogInComing.Count; i++)
            {
                Index++;
                DateTime ThoiGianKhongNhacMay = TaxiCapture.GetThongTinCuaCuocGoiNhoInCom(g_ListCuocGoiLogInComing[i].PhoneNumber, g_ListCuocGoiLogInComing[i].ThoiDiemGoiDen, g_FileInComPath);
                if (ThoiGianKhongNhacMay != DateTime.MinValue)  // có cuộc gọi nhỡ
                {
                    ListCuocGoiCanXoaIndex.Add(Index);
                    // cap nhat DB
                    if (!TaxiCapture.Update_DienThoai_CuocGoiNho(this.g_ConnecString, g_ListCuocGoiLogInComing[i].CuocGoiID, GetSoChuong(g_ListCuocGoiLogInComing[i].ThoiDiemGoiDen, ThoiGianKhongNhacMay), "gọi nhỡ", TrangThaiCuocGoiTaxi.TrangThaiKhac, TrangThaiLenhTaxi.KetThucCuaDienThoai))
                    {
                        LogError.WriteLogError("Loi luu xuong DB", new Exception("Loi luu cuoc goi nho"));
                    }
                }
            }

            /// xóa trong g_ListCuocGoiLogInComing
            /// ...
            if ((ListCuocGoiCanXoaIndex != null) && (ListCuocGoiCanXoaIndex.Count > 0))
            {
                foreach (int IndexXoa in ListCuocGoiCanXoaIndex)
                {
                    if ((IndexXoa >= 0) && (g_ListCuocGoiLogInComing.Count > 0))
                    {
                        g_ListCuocGoiLogInComing.RemoveAt(IndexXoa);
                    }
                }
                ListCuocGoiCanXoaIndex.Clear();
                ListCuocGoiCanXoaIndex = null;
            }
        }