public BuscarReparacion(ref TextBox txt, ref Omega3.Modelo.Reparacion reparacion, Button boton, Button mano) { InitializeComponent(); //reparacion = new Modelo.Reparacion(); this.txt = txt; this.reparacion = reparacion; this.boton = boton; this.mano = mano; }
private void crear_Click(object sender, EventArgs e) { Omega3.Modelo.Reparacion a = new Omega3.Modelo.Reparacion(); if (txt_problema.Text.Trim() != "" && txt_maquina.Text.Trim() != "" && fecha_entrada.Value <= fecha_salida.Value && txt_cliente.Text.Trim() != "") { a.documento = long.Parse(txt_cliente.Text); a.problema = txt_problema.Text; a.fecha_entrada = fecha_entrada.Value; a.fecha_salida = fecha_salida.Value; a.id_motor = txt_numero_serie.Text; a.maquina = txt_maquina.Text; Omega3.Controlador.ControlReparaciones.AgregarReparacion(a); MessageBox.Show("SE AGREGO CORRECTAMENTE"); limpiarcampos(); } else { MessageBox.Show("Compruebe uno de los siguientes errores:\n 1)Hay campos incompletos \n 2)La fecha de salida no puede ser anterior a la fecha actual"); } }