private void btnAñadir_Click(object sender, EventArgs e) { bool testeo = true; string errores = string.Empty; if (tbLote.Text == "<Sin Seleccionar>") { errores += "Seleccione un Lote\n"; testeo = false; } if (tbVeh.Text == "<Sin Seleccionar>") { errores += "Seleccione un Vehiculo\n"; testeo = false; } if (tbTarifa.Text == "<Sin Seleccionar>") { errores += "Seleccione una Tarifa para continuar \n"; testeo = false; } if (testeo) { if (cbSalidaDefinida.Checked) { misAlquileres.grabarAlquilerDias(idVeh, idTar, idLote, dtpSalida.Value, cbPago.Checked); clsLote misLotes = new clsLote("Lotes", "C:\\Sistema de Cochera\\Lotes"); misLotes.setOcupado(this.idLote); MessageBox.Show("Nuevo alquiler generado \n Patente:" + this.patenteVeh + "\n Lote:" + this.nombreLote + "\n Tarifa:" + this.nombreTarifa, "Alquiler Guardado!"); this.Close(); } else { misAlquileres.grabarAlquilerIndefinido(idVeh, idTar, idLote); MessageBox.Show("Nuevo alquiler generado \n Patente:" + this.patenteVeh + "\n Lote:" + this.nombreLote + "\n Tarifa:" + this.nombreTarifa, "Alquiler Guardado!"); padre.setVistas(); this.Close(); } } else { MessageBox.Show(errores, "Complete los siguientes datos"); } }
public FrmAlquiler(clsDueño dueño, clsVehiculo vehs, clsLote lotes, clsTarifa tarf, clsAlquiler alq) { misDueños = dueño; misVehiculos = vehs; misLotes = lotes; misTarifas = tarf; misAlquileres = alq; misFacturas = new clsFactura(); miConversor = new clsConversor(alq, vehs, tarf, dueño, lotes); InitializeComponent(); dgvAlquileres.ReadOnly = true; dgvAlquileres.RowHeadersVisible = false; dgvAlquileres.SelectionMode = DataGridViewSelectionMode.FullRowSelect; }
private void FrmInicio_Load(object sender, EventArgs e) { this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MaximizeBox = false; //CONSTRUIR ó BUSCAR archivos misDueños = new clsDueño("Inquilinos", "C:\\Sistema de Cochera\\Inquilinos"); misVehiculos = new clsVehiculo("Vehiculos", "C:\\Sistema de Cochera\\Vehiculos"); misTarifas = new clsTarifa("Tarifas", "C:\\Sistema de Cochera\\Tarifas"); misLotes = new clsLote("Lotes", "C:\\Sistema de Cochera\\Lotes"); misAlquileres = new clsAlquiler("Alquileres", "C:\\Sistema de Cochera\\Alquileres"); misFacturas = new clsFactura("Facturas", "C:\\Sistema de Cochera\\Facturas"); //genera el conversor miConversor = new clsConversor(misAlquileres, misVehiculos, misTarifas, misDueños, misLotes); //configura grilla: setVistas(); }
public FrmLotes(clsLote l) { misLotes = l; InitializeComponent(); }