private void clientesToolStripMenuItem_Click(object sender, EventArgs e) { RegistroClientes r = new RegistroClientes(); r.MdiParent = this; r.Show(); }
private void ActualizaListaClientes(int numRow, RegistroClientes clientes) { int numRecorridos = clientes.Count; // Crea y actualiza filas for (int i = numRow; i < numRecorridos; ++i) { if (this.grdListaClientes.Rows.Count <= i) { this.grdListaClientes.Rows.Add(); } this.ActualizaFilaDeListaClientes(i, clientes); } // Eliminar filas sobrantes int numExtra = this.grdListaClientes.Rows.Count - numRecorridos; for (; numExtra > 0; --numExtra) { this.grdListaClientes.Rows.RemoveAt(numRecorridos); } return; }
public MainWindow() { //Creacion ventana principal this.Build(); this.reservas = RegistroReservas.RecuperarXml("registro_reservas.xml"); this.habitaciones = RegistroHabitaciones.RecuperaXml(); this.clientes = RegistroClientes.RecuperaXml(); this.ActualizaListaReservas(0); //System.IO.File.Copy(sourceFile, destFile, true); // string path = Path.GetDirectoryName(Application.ExecutablePath) + "\\" + reserva.IdReserva + ".txt"; // File.WriteAllText(@path, reserva.GenerarFactura()); this.BusquedasView = new BusquedasHotel.View.MainWindow(); this.pnlBusquedasPpal = this.BusquedasView.BuildPpal(); this.pnlBusquedasDisponibilidad = this.BusquedasView.BuildPanelListaDisponibilidad(); //this.pnlBusquedasPpal = this.BusquedasView.devolverPanelPpal(); //this.pnlBusquedasDisponibilidad = this.BusquedasView.devolverPanelDisponibilidad(); //Integracion CLIENTES this.ClienteView = new Gestión_Hotel.UI.MainWindowViewClientes(); this.pnlClientes = this.ClienteView.BuildGUI(); this.ClienteCore = new Gestión_Hotel.UI.MainWindowCore(this.ClienteView); //Integracion HABITACIONES this.HabitacionView = new Habitaciones.UI.MainWindowView(); this.pnlHabitaciones = this.HabitacionView.BuildGUI(); this.HabitacionCore = new Habitaciones.UI.MainWindowCore(this.HabitacionView); //Operaciones CLIENTES this.OpConsultarClientes.Click += (sender, e) => this.mostrarClientes(); this.OpInsertarCliente.Click += (sender, e) => this.insertarCliente(); //Operaciones HABITACIONES this.OpConsultarHabitaciones.Click += (sender, e) => this.mostrarHabitaciones(); this.OpInsertarHabitacion.Click += (sender, e) => this.insertarHabitacion(); //Operaciones RESERVASS this.OpConsultarReservas.Click += (sender, e) => this.mostrarReservas(); this.OpGraficos.Click += (sender, e) => this.generarGrafico(); this.OpAltaReserva.Click += (sender, e) => this.AltaReserva(); //Operaciones BUSQUEDAS this.OpReservasPendientes.Click += (sender, e) => this.reservasPendientes(); this.OpDisponibilidad.Click += (sender, e) => this.disponibilidad(); this.OpOcupacion.Click += (sender, e) => this.ocupacion(); this.OpFiltroHabitacion.Click += (sender, e) => this.filtrarPorHabitacion(); this.OpFiltroPersona.Click += (sender, e) => this.filtrarPorPersona(); this.FormClosed += (sender, e) => this.OnQuit(); }
public MainWindow() { //this.Build(); this.BuildPpal(); this.BuildDisponibilidad(); //this.reservas=this.generarDatosAleatorios(); this.reservas = RegistroReservas.RecuperarXml(); this.regHabitaciones = RegistroHabitaciones.RecuperaXml(); this.clientes = RegistroClientes.RecuperaXml(); Console.WriteLine("Datos aleatorios"); //this.PendientesHotel5Dias(); this.habitacionesDisponibles = new List <Habitacion>(); //this.reservasPorHabitacion = this.FiltrarPorHabitacion(300); }
void EliminarCliente() { string DNI = (string)this.MainWindowViewClientes.GrdListaClientes.CurrentRow.Cells[2].Value; DialogResult result; string title = "Eliminar Cliente"; string mensaje = "Estás seguro de querer borrar al cliente " + DNI + "? "; MessageBoxButtons buttons = MessageBoxButtons.YesNo; result = MessageBox.Show(mensaje, title, buttons); if (result == DialogResult.Yes) { RegistroClientes.Remove(RegistroClientes.getUsuario(DNI)); this.ActualizaClientes(); } }
public DlgAltaReserva(RegistroHabitaciones hab, Reserva r, RegistroClientes c) { this.reservaModificar = r; this.Build(); this.habitaciones = hab; this.clientes = c; this.ActualizaListaClientes(0, this.clientes); this.grdLista.SelectionChanged += (sender, e) => this.FilaSeleccionada(); this.grdListaClientes.SelectionChanged += (sender, e) => this.FilaSeleccionadaClientes(); if (reservaModificar != null) { this.edTarifa.Value = (decimal)this.reservaModificar.TarifaDia; var lista = new List <Habitacion>(); lista.Add(this.reservaModificar.Habitacion); ActualizaListaHabitaciones(0, lista); var listaClientes = new RegistroClientes(); listaClientes.Add(this.reservaModificar.Cliente); ActualizaListaClientes(0, listaClientes); } }
private void ActualizaFilaDeListaClientes(int rowIndex, RegistroClientes clientes) { if (rowIndex < 0 || rowIndex > this.grdListaClientes.Rows.Count) { throw new System.ArgumentOutOfRangeException( "fila fuera de rango: " + nameof(rowIndex)); } DataGridViewRow row = this.grdListaClientes.Rows[rowIndex]; Cliente cliente = clientes[rowIndex]; // Assign data row.Cells[0].Value = cliente.Dni; row.Cells[1].Value = cliente.Nombre; // Assign tooltip text foreach (DataGridViewCell cell in row.Cells) { cell.ToolTipText = cliente.ToString(); } this.FilaSeleccionadaClientes(); return; }
private void clientesToolStripMenuItem_Click_1(object sender, EventArgs e) { RegistroClientes rc = new RegistroClientes(); rc.Show(); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { RegistroClientes rc = new RegistroClientes(); rc.Show(); }
private void RegistroClientes_Click(object sender, RoutedEventArgs e) { RegistroClientes registroCliente = new RegistroClientes(); registroCliente.Show(); }