Ejemplo n.º 1
0
        /// <summary>
        /// Tra ve danh sach buu dien
        /// </summary>
        /// <returns></returns>
        public static List <DanhBaCongTy> GetDanhBa_BuuDien_5()
        {
            DataTable           dt = new Data.DanhBa().GetDanhBa_BuuDien_5();
            List <DanhBaCongTy> lstDanhBaCongTy = new List <DanhBaCongTy>();

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    DanhBaCongTy objDanhBaCongTy = new DanhBaCongTy()
                    {
                        Name        = item["Name"] != null && item["Name"].ToString() != "" ? MaHoaDuLieu.GiaiMa(item["Name"].ToString()) : "",
                        Address     = item["Address"] != null && item["Address"].ToString() != "" ? MaHoaDuLieu.GiaiMa(item["Address"].ToString()) : "",
                        PhoneNumber = item["PhoneNumber"].ToString()
                    };
                    lstDanhBaCongTy.Add(objDanhBaCongTy);
                }
            }
            dt.Dispose();
            return(lstDanhBaCongTy);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// tra ve dia chi cua so dien thoai
        /// </summary>
        /// <param name="PhoneNumber"></param>
        /// <returns></returns>
        public static string  GetDanhBa(string PhoneNumber)
        {
            if (!DanhBa.IsDienThoaiDiDong(PhoneNumber))
            {
                if (DanhBa.IsDienThoaiCoDinh(PhoneNumber))
                {
                    DataTable dt = new DataTable();

                    dt = new Data.DanhBa().GetDanhBa(PhoneNumber.Substring(PhoneNumber.Length - 8, 8));
                    string strDiaChi = "";
                    if (dt.Rows.Count > 0) // Co dia chi
                    {
                        strDiaChi = string.Format("[{0}]{1}", MaHoaDuLieu.GiaiMa(dt.Rows[0]["Name"].ToString()), MaHoaDuLieu.GiaiMa(dt.Rows[0]["Address"].ToString()));
                    }
                    dt.Dispose();
                    dt = null;

                    return(strDiaChi);
                }
            }
            return(string.Empty);
        }