示例#1
0
        private string KiemTraXeNhanDaNhanCuoc(long IDCuocKhach, string strXeNhan)
        {
            if (strXeNhan.Length <= 0)
            {
                return(strXeNhan);
            }
            DieuHanhTaxi objDHTaxi             = new DieuHanhTaxi();
            string       strDSXeNhanDaNhanDiem = "";

            string[] arrTaxi      = strXeNhan.Split(".".ToCharArray());
            string   SQLCondition = " AND  (len(XeNhan)>0) AND (ID <> " + IDCuocKhach.ToString() + " ) ";

            List <DieuHanhTaxi> lstDienThoai = objDHTaxi.FT_GetAllOf_DienThoai(SQLCondition);

            if (lstDienThoai != null && lstDienThoai.Count > 0)
            {
                for (int i = 0; i < arrTaxi.Length; i++)
                {
                    if (KiemTraXeCoTrongCuocKhachHienTai(lstDienThoai, arrTaxi[i]))
                    {
                        strDSXeNhanDaNhanDiem += arrTaxi[i].ToString() + ".";
                    }
                }
            }
            return(strDSXeNhanDaNhanDiem);
        }
 /// <summary>
 /// tim dia chi cua cuoc goi gan day nhat
 /// -- uu tien tim trong cuoc goi hien tai
 /// -- tim theo cuoc goi da ket thuc trong ngay
 /// </summary>
 private string GetDiaChiCuaCuocGoiGanNhatTrongNgay(string PhoneNumber)
 {
     try
     {
         string strDiaChi = "";
         List <DieuHanhTaxi> lstDienThoai = new List <DieuHanhTaxi>();
         //Lay danh sach cac cuoc goi con hoat dong (chua ket thuc)
         DieuHanhTaxi objDHTaxi    = new DieuHanhTaxi();
         string       SQLCondition = " ORDER BY ThoiDiemGoi DESC";
         lstDienThoai = objDHTaxi.FT_GetAllOf_DienThoai(SQLCondition);
         if (lstDienThoai != null)
         {
             if (lstDienThoai.Count > 0)
             {
                 foreach (DieuHanhTaxi objDHTX in lstDienThoai)
                 {
                     if (objDHTX.PhoneNumber != null)
                     {
                         if (objDHTX.PhoneNumber.Contains(PhoneNumber))
                         {
                             strDiaChi = objDHTX.DiaChiDonKhach;
                             break;
                         }
                     }
                 }
             }
         }
         lstDienThoai.Clear();
         lstDienThoai = null;
         // lay trong da ket thuc trong ngay
         return(strDiaChi);
     }
     catch (Exception ex)
     {
         return(string.Empty);
     }
 }
示例#3
0
 /// <summary>
 /// tim dia chi cua cuoc goi gan day nhat
 /// -- uu tien tim trong cuoc goi hien tai
 /// -- tim theo cuoc goi da ket thuc trong ngay
 /// </summary>
 private string GetDiaChiCuaCuocGoiGanNhatTrongNgay(string phoneNumber)
 {
     try
     {
         string strDiaChi = "";
         //Lay danh sach cac cuoc goi con hoat dong (chua ket thuc)
         DieuHanhTaxi        objDHTaxi    = new DieuHanhTaxi();
         const string        sqlCondition = " ORDER BY ThoiDiemGoi DESC";
         List <DieuHanhTaxi> lstDienThoai = objDHTaxi.FT_GetAllOf_DienThoai(sqlCondition);
         if (lstDienThoai != null)
         {
             if (lstDienThoai.Count > 0)
             {
                 foreach (DieuHanhTaxi objDieuHanhTaxi in lstDienThoai)
                 {
                     if (objDieuHanhTaxi.PhoneNumber != null)
                     {
                         if (objDieuHanhTaxi.PhoneNumber.Contains(phoneNumber))
                         {
                             strDiaChi = objDieuHanhTaxi.DiaChiDonKhach;
                             break;
                         }
                     }
                 }
             }
         }
         if (lstDienThoai != null)
         {
             lstDienThoai.Clear();
         }
         return(strDiaChi);
     }
     catch
     {
         return(string.Empty);
     }
 }