void fillForm(FormSeleccion Data) { if (Data != null) { DEmpleado Empleado = Data.empleado; DSeleccion Seleccion = Data.seleccion; txtNombre.Text = Empleado.nombre; txtApellido.Text = Empleado.apellido; string[] words = Empleado.cedula.Split('-'); cbTipoDocumento.SelectedIndex = words[0] == "D" ? 0 : words[0] == "P" ? 1 : -1; txtDNI.Text = words[1]; CbPaisNac.SelectedValue = Empleado.nacionalidad; CbFechaNac.SelectedDate = Empleado.fechaNacimiento; txtEmail.Text = Empleado.email; txtTelefono.Text = Empleado.telefono; txtDireccion.Text = Empleado.direccion; CbEstadoLegal.Text = Empleado.estadoLegal; CbDepartamento.SelectedValue = Empleado.idDepartamento; CbFechaApl.SelectedDate = Seleccion.fechaAplicacion; txtNombrePuesto.Text = Seleccion.nombrePuesto; txtURLCV.Text = Empleado.curriculum; } }
void fillData() { if (Validate()) { UForm = null; return; } /* EMPLEADO */ int idDepartamento = (int)CbDepartamento.SelectedValue; string nombre = txtNombre.Text; string apellido = txtApellido.Text; string DNI = txtDNI.Text; DateTime fechaNacimiento = CbFechaNac.SelectedDate ?? DateTime.Now; if (fechaNacimiento == DateTime.Now) { return; } string nacionalidad = (string)CbPaisNac.SelectedValue; string direccion = txtDireccion.Text; string email = txtEmail.Text; string telefono = txtTelefono.Text; string URLCV = txtURLCV.Text; string estadoLegal = CbEstadoLegal.Text; string nombrePuesto = txtNombrePuesto.Text; /* END EMPLEADO */ /* SELECCIÓN */ int idSeleccionador = Menu.ActUsuario.idUsuario; DateTime fechaAplicacion = CbFechaApl.SelectedDate ?? DateTime.Now; if (fechaAplicacion == DateTime.Now) { return; } /* END SELECCIÓN */ DEmpleado Empleado = new DEmpleado(DataFill.empleado.idEmpleado, idDepartamento, nombre, apellido, DNI, fechaNacimiento, nacionalidad, direccion, email, telefono, URLCV, estadoLegal, 0); DSeleccion Seleccion = new DSeleccion(DataFill.seleccion.idSeleccion, DataFill.empleado.idEmpleado, 0, 0, fechaAplicacion, 0, DateTime.Now, nombrePuesto); UForm = new FormSeleccion(Empleado, Seleccion); }
public SeleccionVista(DEmpleado empleado, DSeleccion seleccion) { InitializeComponent(); DataFill = new FormSeleccion(empleado, seleccion); }