private void gcUsuarios_DoubleClick(object sender, EventArgs e) { try { if (this.gridView1.GetSelectedRows().Count() == 0) { return; } Modelos.PersonaResponsivas ent = new Modelos.PersonaResponsivas(); foreach (int i in this.gridView1.GetSelectedRows()) { var dr1 = this.gridView1.GetRow(i); ent = (Modelos.PersonaResponsivas)dr1; } // imprime datos this.tbUsuarioSelec.Text = ent.nombre; this.tbPuestoSelec.Text = ent.sucursal; this.tbSucursalSelec.Text = ent.puesto; this._idPersona = ent.idPersona; } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Responsivas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void gcResponsables_DoubleClick(object sender, EventArgs e) { try { if (this.gridView1.GetSelectedRows().Count() == 0) { throw new Exception("No a seleccionado una persona"); } this._responsiva = new Modelos.PersonaResponsivas(); foreach (int i in this.gridView1.GetSelectedRows()) { var dr1 = this.gridView1.GetRow(i); this._responsiva = (Modelos.PersonaResponsivas)dr1; } int idPersona = this._responsiva.idPersona; this._activos = this._activosNegocio.getBuscaActivosPersona(idPersona, this.cbBajas.Checked, this.cbReparacion.Checked); this.tbRespDe.Text = this._responsiva.nombre; this.gcActivos.DataSource = this._activos; } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Reportes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void gcUsuarios_DoubleClick(object sender, EventArgs e) { try { if (this.gridView1.GetSelectedRows().Count() == 0) { return; } this._usuario = new Modelos.PersonaResponsivas(); foreach (int i in this.gridView1.GetSelectedRows()) { var dr1 = this.gridView1.GetRow(i); this._usuario = (Modelos.PersonaResponsivas)dr1; } this.tbUsuarioSeleccionado.Text = this._usuario.nombre; } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Traspasos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void gcUsuarios_DoubleClick(object sender, EventArgs e) { try { this._activos = null; this._responsiva = null; if (this.gridView1.GetSelectedRows().Count() == 0) { throw new Exception("No a seleccionado una persona"); } this._usuario = new Modelos.PersonaResponsivas(); foreach (int i in this.gridView1.GetSelectedRows()) { var dr1 = this.gridView1.GetRow(i); this._usuario = (Modelos.PersonaResponsivas)dr1; } // busca responsivas segun un usuario List <Modelos.Responsivas> responsivas = this._responsivasNegocio.buscaResponsiva(this._usuario.idPersona); if (responsivas.Count == 0) { this.gcResponsivas.DataSource = null; this.gcActivos.DataSource = null; throw new Exception("El usuario no tiene responsivas"); } this.tbUsuarioSeleccionado.Text = this._usuario.nombre; this.gcResponsivas.DataSource = responsivas; this.gcActivos.DataSource = null; } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Traspasos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { if (this.cmbSucursal.SelectedIndex == -1) { throw new Exception("Seleccione una sucursal"); } string responsable = this.tbResp.Text; int idSuc = (int)this.cmbSucursal.SelectedValue; List <Modelos.PersonaResponsivas> responsivas = this._responsivasNegocio.buscaResponsiva(responsable, idSuc); this._activos = null; this.tbRespDe.Text = string.Empty; this.gcActivos.DataSource = this._activos; this._responsiva = null; if (responsivas.Count == 0) { this.gcResponsables.DataSource = null; throw new Exception("Sin resultados"); } this.gcResponsables.DataSource = responsivas; } catch (Exception Ex) { MessageBox.Show(Ex.Message, "Reportes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }