private void btnEliminar_Click(object sender, EventArgs e) { if (lst.SelectedItems.Count > 0) { if (opcion == "cliente" || opcion == "actual" || opcion == "lista_negra") { msg = new Msg(); msg.lblMsg.Text = $"¿Está seguro de que desea eliminar el registro? \nAdvertencia: Se eliminarán todos los datos asociados (reservaciones y vehículos). \n\nCliente a eliminar: \"{lst.SelectedItems[0].SubItems[2].Text}\" \nCédula: \"{lst.SelectedItems[0].SubItems[3].Text}\"."; DialogResult dlgres = msg.ShowDialog(); { if (dlgres == DialogResult.Yes) { EliminarCliente(lst.SelectedItems[0].SubItems[0].Text.ToString()); CargarListView("cliente"); OcultarListbox(); } else { return; } } } else // Habitacion { reservacion = new Reservacion(); reservacion.CargarReservacion(int.Parse(lst.SelectedItems[0].SubItems[2].Text.ToString()), "ocupada"); reservacion.ShowDialog(); //MessageBox.Show("De momento da error el método de Actualizar Colores porque Form1 no está activa. Verificar si sigue siendo el caso una vez que cambie Application.Run a Form1 nuevamente."); } } }
private void button1_Click(object sender, EventArgs e) { if (((Button)sender).BackColor == limpieza || ((Button)sender).BackColor == mantenimiento) { msg = new Msg(); msg.lblMsg.Text = "¿Desea cambiar el estado a disponible?"; msg.Text = $"Confirmación | Habitación {((Button)sender).Name.Remove(0, 6)}"; DialogResult dlgres = msg.ShowDialog(); { if (dlgres == DialogResult.Yes) { if (CambiarEstadoHabitacion(false, "disponible", ((Button)sender).Name.Remove(0, 6))) { ((Button)sender).BackColor = disponible; return; } } else { return; } } } if (((Button)sender).BackColor == disponible || (((Button)sender).BackColor == ocupada)) { ActivarTimerEspera(); int numeroHabitacion = int.Parse(((Button)sender).Name.Remove(0, 6));//Text); reservacion = new Reservacion(); reservacion.PanelCedula(false); if (((Button)sender).BackColor == ocupada) { if (!reservacion.HayReserva(numeroHabitacion)) // Aparece como ocupada pero NO tiene datos de reserva almacenados { CambiarEstadoHabitacion(false, "disponible", numeroHabitacion.ToString()); ActualizarColores(); return; } reservacion.CargarReservacion(numeroHabitacion, "ocupada"); } else if (((Button)sender).BackColor == disponible) { if (reservacion.HayReserva(numeroHabitacion)) // Aparece como disponible pero aún tiene datos de reserva almacenados { CambiarEstadoHabitacion(true, "disponible", numeroHabitacion.ToString()); } reservacion.CargarReservacion(numeroHabitacion, "disponible"); } reservacion.ShowDialog(); } }
private void listboxVehiculoHabitacion_MouseDoubleClick(object sender, MouseEventArgs e) { f1.ActivarTimerEspera(); Reservacion reservacion = new Reservacion(); reservacion.CargarReservacion(int.Parse(listboxVehiculoHabitacion.Text), "ocupada"); reservacion.ShowDialog(); }
private void listboxReservaciones_MouseDoubleClick(object sender, MouseEventArgs e) { f1.ActivarTimerEspera(); reservacion = new Reservacion(); reservacion.CargarReservacion(int.Parse(listboxReservaciones.Text), "ocupada"); reservacion.ShowDialog(); //this.Hide(); //MessageBox.Show("De momento da error el método de Actualizar Colores porque Form1 no está activa. Verificar si sigue siendo el caso una vez que cambie Application.Run a Form1 nuevamente."); }
private void btnNuevaReservacion_Click(object sender, EventArgs e) { f1.ActivarTimerEspera(); reservacion = new Reservacion(); reservacion.txtCedula.Text = txtCedula.Text.Trim(); reservacion.ShowDialog(); CargarCliente(idCliente); //Hide(); //MessageBox.Show("De momento da error el método de Actualizar Colores porque Form1 no está activa. Verificar si sigue siendo el caso una vez que cambie Application.Run a Form1 nuevamente."); }
private void button53_Click(object sender, EventArgs e) // Nueva reservación { ActivarTimerEspera(); foreach (Button b in tableLayoutPanel1.Controls) // Verifica si hay al menos una habitación disponible { if (b.BackColor == disponible) { reservacion = new Reservacion(); reservacion.ShowDialog(); return; } } MessageBox.Show("No hay ninguna habitación disponible.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void lst_MouseDoubleClick(object sender, MouseEventArgs e) { f1.ActivarTimerEspera(); if (opcion == "cliente" || opcion == "actual" || opcion == "buscar" || opcion == "lista_negra") { btnModificar_Click(null, null); } else // Habitacion { reservacion = new Reservacion(); reservacion.CargarReservacion(int.Parse(lst.SelectedItems[0].SubItems[2].Text.ToString()), "ocupada"); //this.Hide(); reservacion.ShowDialog(); CargarListView("habitacion"); //this.Show(); //MessageBox.Show("De momento da error el método de Actualizar Colores porque Form1 no está activa. Verificar si sigue siendo el caso una vez que cambie Application.Run a Form1 nuevamente."); } }