Ejemplo n.º 1
0
        public List <eLoaiPhong> getDOnGia(double min, double max)
        {
            var ls = (from x in db.LoaiPhongs where Convert.ToDecimal(min) < x.donGia && x.donGia <= Convert.ToDecimal(max) select x).ToList();
            List <eLoaiPhong> list = new List <eLoaiPhong>();

            foreach (var item in ls)
            {
                eLoaiPhong lp = new eLoaiPhong();
                lp.MaLoaiPhong  = item.maLoaiPhong.Trim();
                lp.TenLoaiPhong = item.tenLoaiPhong.Trim();
                lp.DonGia       = Convert.ToDouble(item.donGia);
                lp.SoNguoi      = Convert.ToInt32(item.soNguoiToiDa);
                list.Add(lp);
            }
            return(list);
        }
Ejemplo n.º 2
0
        public List <eLoaiPhong> getalllp()
        {
            var ls = (from x in db.LoaiPhongs select x).ToList();
            List <eLoaiPhong> list = new List <eLoaiPhong>();

            foreach (var item in ls)
            {
                eLoaiPhong lp = new eLoaiPhong();
                lp.MaLoaiPhong  = item.maLoaiPhong.Trim();
                lp.TenLoaiPhong = item.tenLoaiPhong.Trim();
                lp.DonGia       = Convert.ToDouble(item.donGia);
                lp.SoNguoi      = Convert.ToInt32(item.soNguoiToiDa);
                list.Add(lp);
            }
            return(list);
        }