private void btnInsertRentRoom_Click(object sender, RoutedEventArgs e) { var screen = new RentRoomInfoWindow(RentRoomInfoWindow.ADDACTION); this.IsEnabled = false; screen.ShowDialog(); LoadDuLieu(); this.IsEnabled = true; }
private void dgRentRoom_MouseDoubleClick(object sender, MouseButtonEventArgs e) { RentRoom rr = dgRentRoom.SelectedItem as RentRoom; if (rr != null) { var screen = new RentRoomInfoWindow(RentRoomInfoWindow.INFOACTION, rr); this.IsEnabled = false; screen.ShowDialog(); this.IsEnabled = true; } LoadDuLieu(); }
private void btnRent_Click(object sender, RoutedEventArgs e) { using (var db = new RoomManagerEntities2()) { this.IsEnabled = false; var creen = new ConfirmWindow($"Ban Co Chac Muon Rent Room {item.Id}"); creen.ShowDialog(); if (creen.DialogResult == true) { var result = db.Rooms.FirstOrDefault(b => b.IdCategory == item.Id && b.Status == 1); if (result != null) { this.IsEnabled = false; var Rentscreen = new RentRoomInfoWindow(RentRoomInfoWindow.ADDACTION, null, result.Id); this.IsEnabled = false; if (Rentscreen.ShowDialog() == true) { MessageBox.Show(" Rent Room Successfull"); } else { MessageBox.Show(" Rent Room Fail"); } this.IsEnabled = true; } else { MessageBox.Show(" not room available"); } } this.IsEnabled = true; } }