/// <summary> /// tra ve dia chi cua so dien thoai /// </summary> /// <param name="PhoneNumber"></param> /// <returns></returns> public static string GetDanhBa(string PhoneNumber) { DataTable dt = new DataTable(); dt = new Data.DanhBaKhachAo().GetDanhBaKhachAo(PhoneNumber); if (dt.Rows.Count > 0) { return(dt.Rows[0]["Address"].ToString()); } dt.Dispose(); dt = null; return(string.Empty); }
public static List <DanhBaKhachAo> GetDanhSachKhachAo() { List <DanhBaKhachAo> listKhachAo = new List <DanhBaKhachAo>(); DataTable dt = new DataTable(); dt = new Data.DanhBaKhachAo().GetDanhBaKhachAo(string.Empty); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { DanhBaKhachAo objKhachao = new DanhBaKhachAo(); objKhachao.PhoneNumber = dr["PhoneNumber"].ToString(); objKhachao.Name = dr["Name"].ToString(); objKhachao.Address = dr["Address"].ToString(); listKhachAo.Add(objKhachao); } } dt.Dispose(); dt = null; return(listKhachAo); }
public static List <DanhBaKhachAo> GetKhachAos(string strSQL) { List <DanhBaKhachAo> lstKhachAo = new List <DanhBaKhachAo>(); DataTable dt = new DataTable(); dt = new Data.DanhBaKhachAo().GetKhachAos(strSQL); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { DanhBaKhachAo objKhachAo = new DanhBaKhachAo(); objKhachAo.PhoneNumber = StringTools.TrimSpace(dr["PhoneNumber"].ToString()); objKhachAo.Name = StringTools.TrimSpace(dr["Name"].ToString()); objKhachAo.Address = StringTools.TrimSpace(dr["Address"].ToString()); lstKhachAo.Add(objKhachAo); } } dt.Dispose(); dt = null; return(lstKhachAo); }