public void LoadData() { //trThai = 1; //TrangThai(); LoaiPhongBUS lp = new LoaiPhongBUS(); cbo_loaiPhong.DataSource = lp.DanhSachLoaiPhong().FindAll(o => o.TINHTRANG == true); cbo_loaiPhong.ValueMember = "MALOAIPHONG"; cbo_loaiPhong.DisplayMember = "TENLOAIPHONG"; TinhTrangPhongBUS tt = new TinhTrangPhongBUS(); cbo_tinhtrang.DataSource = tt.DSTINHTRANGPHONG(); cbo_tinhtrang.ValueMember = "MATTR"; cbo_tinhtrang.DisplayMember = "TENTTR"; //load datagridviewcomboboxcolum truoc khi load ds . DataGridViewComboBoxColumn dgvcb_loaiphong = (DataGridViewComboBoxColumn)dgv_phong.Columns["colLOAIPHONG"]; dgvcb_loaiphong.DataSource = lp.DanhSachLoaiPhong().FindAll(o => o.TINHTRANG == true); dgvcb_loaiphong.ValueMember = "MALOAIPHONG"; dgvcb_loaiphong.DisplayMember = "TENLOAIPHONG"; DataGridViewComboBoxColumn dgvcb_tinhtrang = (DataGridViewComboBoxColumn)dgv_phong.Columns["colTINHTRANG"]; dgvcb_tinhtrang.DataSource = tt.DSTINHTRANGPHONG(); dgvcb_tinhtrang.ValueMember = "MATTR"; dgvcb_tinhtrang.DisplayMember = "TENTTR"; //DataGridViewCheckBoxColumn dgvckb = (DataGridViewCheckBoxColumn)dgv_sanpham.Columns["TinhTrang"]; PhongBUS b = new PhongBUS(); dgv_phong.DataSource = b.DanhSachPhong(); }
void HienThiLoaiPhong() { List <LoaiPhong> dsLoaiPhong = lpBus.DanhSachLoaiPhong(); string line; foreach (var item in dsLoaiPhong) { line = item.Maloaiphong; cbLoaiPhong.Items.Add(line); } }
private void loaddata() { lv_HoaDonChuaThanhToan.Items.Clear(); LoaiPhongBUS lp = new LoaiPhongBUS(); cbo_loaiPhong.DataSource = lp.DanhSachLoaiPhong().FindAll(o => o.TINHTRANG == true); cbo_loaiPhong.ValueMember = "MALOAIPHONG"; cbo_loaiPhong.DisplayMember = "TENLOAIPHONG"; cbo_loaiPhong.SelectedIndex = -1; khBUS = new KhachHangBUS(); nvBUS = new NhanVienBUS(); HoaDonBUS hdBus = new HoaDonBUS(); lsHoaDonHienHanh = hdBus.DanhSachHoaDon().FindAll(o => o.TINHTRANG == false); foreach (HoaDonDTO a in lsHoaDonHienHanh) { PhongBUS pBus = new PhongBUS(); PhongDTO pDTO = pBus.DanhSachPhong().Find(o => o.MAPHONG == a.MAPHONG); ListViewItem item = new ListViewItem(pDTO.TENPHONG); item.SubItems.Add(a.MAHD); item.SubItems.Add(a.MAPHONG); item.SubItems.Add(a.MANV); item.SubItems.Add(nvBUS.DanhSachNhanVien().Find(o => o.MANV.Trim() == a.MANV.Trim()).HOTENNV); item.SubItems.Add(a.MAKH); item.SubItems.Add(khBUS.DanhSachKhachHang().Find(o => o.MAKH.Trim() == a.MAKH.Trim()).TENKH); item.SubItems.Add(a.THOIGIANBATDAU.ToString("dd/MM/yyyy HH:mm")); item.SubItems.Add(a.THOIGIANKETTHUC.ToString("dd/MM/yyyy HH:mm")); item.SubItems.Add(a.TONGTHANHTOAN); item.SubItems.Add(a.THOIGIANBATDAU.ToString()); item.SubItems.Add(a.TINHTRANG?"1":"0"); item.SubItems.Add(a.GIAPHONG.ToString()); lv_HoaDonChuaThanhToan.Items.Add(item); } maHDmoi = DoAnQLKaraokeBUS.HoaDonBUS.MaHDmoi(); txt_maHD.Text = maHDmoi; }
private void lv_HoaDonChuaThanhToan_SelectedIndexChanged(object sender, EventArgs e) { btn_huyHD.Enabled = true; btn_capNhat.Enabled = true; pBUS = new PhongBUS(); lpBUS = new LoaiPhongBUS(); khBUS = new KhachHangBUS(); if (lv_HoaDonChuaThanhToan.SelectedItems.Count > 0) { ListViewItem a = lv_HoaDonChuaThanhToan.SelectedItems[0]; PhongDTO pDTO = pBUS.DanhSachPhong().Find(o => o.MAPHONG.Trim() == a.SubItems[2].Text.Trim()); LoaiPhongDTO lpDTO = lpBUS.DanhSachLoaiPhong().Find(o => o.MALOAIPHONG == pDTO.LOAIPHONG); KhachHangDTO khDTO = khBUS.DanhSachKhachHang().Find(o => o.MAKH.Trim() == a.SubItems[5].Text.Trim()); hdHienHanh = new HoaDonDTO() { MAHD = a.SubItems[1].Text, MAPHONG = a.SubItems[2].Text, MANV = a.SubItems[3].Text, NGUOILAPHD = a.SubItems[4].Text, MAKH = a.SubItems[5].Text, HOTENKH = a.SubItems[6].Text, THOIGIANBATDAU = DateTime.Parse(a.SubItems[7].Text), THOIGIANKETTHUC = DateTime.Parse(a.SubItems[8].Text), TONGTHANHTOAN = a.SubItems[9].Text, TINHTRANG = a.SubItems[10].Text == "1" ? true : false, GIAPHONG = a.SubItems[12].Text, TENPHONG = pDTO.TENPHONG, MALOAIPHONG = pDTO.LOAIPHONG, SDT = khDTO.SDT }; } Bind(); }
private void LoadData() { LoaiPhongBUS b = new LoaiPhongBUS(); dgv_loaiphong.DataSource = b.DanhSachLoaiPhong(); }