private void frmAgregarCasoPrueba_Load(object sender, EventArgs e) { UsuarioPruebaNegocio UPNegocio = new UsuarioPruebaNegocio(); SiniestroPruebaNegocio SPNegocio = new SiniestroPruebaNegocio(); try { cmbUsuario.DataSource = UPNegocio.listarUsuariosP(testLocal); cmbDatoPrueba.DataSource = SPNegocio.listarSiniestroP(testLocal); cmbUsuario.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cmbDatoPrueba.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cargarGrillaCasosP(); //VERIFICA SI ESTA FINALIZADO PARA ESCONDER BOTONES Y FRIZAR CAMPOS if (testLocal.Finalizado == true) { btnAgregarCaso.Visible = false; btnEliminarCaso.Visible = false; btnModificarCaso.Visible = false; } } catch (Exception ex) { throw ex; } }
private void frm_ModificarCasoPrueba_Load(object sender, EventArgs e) { UsuarioPruebaNegocio UPNegocio = new UsuarioPruebaNegocio(); SiniestroPruebaNegocio SPNegocio = new SiniestroPruebaNegocio(); try { cmbUsuario.DataSource = UPNegocio.listarUsuariosP(testLocal); cmbDatoPrueba.DataSource = SPNegocio.listarSiniestroP(testLocal); cmbUsuario.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cmbDatoPrueba.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; if (cpLocal != null) { txbDescripcion.Text = cpLocal.Descripcion; txbDetalle.Text = cpLocal.Observaciones; txbDetalleFalla.Text = cpLocal.TextoFalla; ckbResultado.Checked = cpLocal.Resultado; cmbDatoPrueba.SelectedIndex = cmbDatoPrueba.FindString(cpLocal.Siniestro.NroSiniestro); cmbUsuario.SelectedIndex = cmbUsuario.FindString(cpLocal.Usuario.Nombre); cmbUsuario.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cmbDatoPrueba.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; } } catch (Exception ex) { throw ex; } }
private void cargarGrillaUsuariosP() { UsuarioPruebaNegocio UPnegocio = new UsuarioPruebaNegocio(); try { //DATAGRIDVIEW USUARIO PRUEBA listadoUP = UPnegocio.listarUsuariosP(testLocal); dgvUsuariosPrueba.DataSource = listadoUP; dgvUsuariosPrueba.Columns["ID"].Visible = false; dgvUsuariosPrueba.Columns["Test"].Visible = false; dgvUsuariosPrueba.Columns["Nombre"].DisplayIndex = 0; dgvUsuariosPrueba.Columns["Apellido"].DisplayIndex = 1; dgvUsuariosPrueba.Columns["Documento"].DisplayIndex = 2; dgvUsuariosPrueba.Columns["Documento"].Width = 80; dgvUsuariosPrueba.ReadOnly = true; dgvUsuariosPrueba.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgvUsuariosPrueba.MultiSelect = false; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }