private void cmdAceptar2_Click(object sender, RoutedEventArgs e) { Globales.strNombreFP = NOMBRE_GENERAL + ".cmdAceptar2_Click()"; Globales.bolActivaMotoP = true; if (string.IsNullOrWhiteSpace(Globales.InfoCheckOut)) { Globales.MessageBoxMit("Debe seleccionar una operación."); cmdAceptar2.IsEnabled = false; return; } HotelCheck info = (HotelCheck)MSFlexGrid1.SelectedItem; if (info == null) { Globales.MessageBoxMit("Debe seleccionar una operación."); cmdAceptar2.IsEnabled = false; return; } // Guarda Info de CheckIn Globales.InfoCheckOut = info.sReferencia + "|" + info.sImporte + "|" + info.sFecha + "|" + info.sOperacion + "|" + info.sCcname; frmProcesaCheckout frmout = new frmProcesaCheckout(); frmout.abrir = abrir; frmout.abriendo = abriendo; frmout.cierra = cierra; abrir(frmout); Globales.InfoCheckOut = ""; }
private void escogerTransaccion(object sender, SelectionChangedEventArgs e) { DataGrid tablita = sender as DataGrid; HotelCheck datos = tablita.SelectedItem as HotelCheck; Globales.InfoCheckOut = datos.sOperacion; cmdAceptar2.IsEnabled = true; }
public void GetCheapestHotel() { HotelReservation hotelReservation1 = new HotelReservation("LakeWood", 30000, "10Sep2020", "11Sep2020"); HotelReservation hotelReservation2 = new HotelReservation("BridgeWood", 10000, "10Sep2020", "11Sep2020"); HotelReservation hotelReservation3 = new HotelReservation("RidgeWood", 20000, "10Sep2020", "11Sep2020"); HotelCheck hotelCheck = new HotelCheck(); hotelCheck.hotelList.Add(hotelReservation1); hotelCheck.hotelList.Add(hotelReservation2); hotelCheck.hotelList.Add(hotelReservation3); string cheapestHotel = hotelCheck.findCheapestHotel(); Assert.AreEqual("BridgeWood", cheapestHotel); }