Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }