예제 #1
0
        public static List <BangGiaInNhanh> DocConDungTheoIdHangKH(int idHangKH)
        {
            var giayLogic = new BangGiaInNhanhLogic();
            List <BangGiaInNhanh> nguon = null;

            try
            {
                nguon = giayLogic.LayTatCa().Where(x => (x.IdHangKhachHang == idHangKH) && (x.KhongSuDung == false)).Select(x => new BangGiaInNhanh
                {
                    ID              = x.ID,
                    TenBangGia      = x.TenBangGia,
                    MoTa            = x.MoTa,
                    DaySoLuong      = x.DaySoLuong,
                    DayGia          = x.DayGia,
                    KhongSuDung     = x.KhongSuDung,
                    IdHangKhachHang = x.IdHangKhachHang,
                    SoTrangToiDa    = x.SoTrangToiDa,
                    NoiDungBangGia  = x.NoiDungBangGia,
                    GiaTheoKhoang   = x.GiaTheoKhoang,
                    ThuTu           = x.ThuTu
                }).OrderBy(x => x.ThuTu).ToList();
            }
            catch { }
            return(nguon);
        }
        //==
        #region Các hàm static
        public static List <BangGiaInNhanh> LayTatCa()
        {
            var giayLogic = new BangGiaInNhanhLogic();
            List <BangGiaInNhanh> nguon = null;

            try
            {
                nguon = giayLogic.LayTatCa().Where(x => x.KhongSuDung == false).Select(x => new BangGiaInNhanh
                {
                    ID          = x.ID,
                    TenBangGia  = x.TenBangGia,
                    MoTa        = x.MoTa,
                    DaySoLuong  = x.DaySoLuong,
                    DayGia      = x.DayGia,
                    KhongSuDung = x.KhongSuDung,
                    ThuTu       = x.ThuTu
                }).OrderBy(x => x.ThuTu).ToList();
            }
            catch { }
            return(nguon);
        }