private void Bt_ThuePhong_Click(object sender, RoutedEventArgs e) { var index = 0; if (LbDanhMucPhong.SelectedItems.Count > 0) { for (var lcount = 0; lcount <= LbDanhMucPhong.Items.Count - 1; lcount++) { if (LbDanhMucPhong.Items[lcount] == LbDanhMucPhong.SelectedItem) { index = lcount; break; } } } if (ListPhong[index].TinhTrang != "da thue") { var screen = new LapPhieuThuePhong(ListPhong[index]); screen.ShowDialog(); PhongBUS bus = new PhongBUS(); LoadData(bus.SelectAllPhong()); } else { MessageBox.Show("Phòng này đã được khách thuê vui lòng chọn phòng khác", "Phòng đã đươc thuê", MessageBoxButton.OK); } }
private void Bt_thuephong_Click(object sender, RoutedEventArgs e) { //Cập nhật lại tình trạng phòng PhongBUS phong_ = new PhongBUS(); phong_.updateTTPhongAsChuaThue(); //-- PhongDTO phong = new PhongDTO(); var screen = new LapPhieuThuePhong(phong); screen.ShowDialog(); }