public void DatosAsignarPermiso() { try { DataTable codigo = N_Usuarios.Consulta_Id(this.dgv_Usuarios.CurrentRow.Cells[0].Value.ToString()); if (codigo.Rows.Count == 0) { MessageBox.Show("ERROR", "SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Frm_Asignacion_Funciones frm = Frm_Asignacion_Funciones.Get_instancias(); string co = codigo.Rows[0][0].ToString(); //codigo string nom = codigo.Rows[0][2].ToString(); //nombre frm.txt_Codigo.Text = co.Trim(); frm.txt_nombre.Text = nom.Trim(); frm.ShowDialog(); } } catch (Exception e) { MessageBox.Show("No hay ningun dato"); } }
public void Datos() { DataTable Datos = N_Usuarios.Consulta_Id(this.dgv_Usuarios.CurrentRow.Cells["CODIGO"].Value.ToString()); if (Datos.Rows.Count < 1) { MessageBox.Show("ERROR", "SISTEMA MERCENARIOS", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Usuarios_Datos frm = Usuarios_Datos.Get_instancia(); frm.txt_Codigo.Text = Datos.Rows[0][0].ToString(); if (Datos.Rows[0][1].ToString() == "V") { frm.cb_Estado.Text = "Valido"; } else { frm.cb_Estado.Text = "Anulado"; } frm.txt_nombre.Text = Datos.Rows[0][2].ToString(); frm.txt_usuario.Text = Datos.Rows[0][3].ToString(); frm.txt_clave.Text = Capa_Datos.D_Seguridad.descomprimir(Datos.Rows[0][4].ToString()); frm.txt_observaciones.Text = Datos.Rows[0][5].ToString().Trim(); if (Program.isnuevoUsuario == true || Program.ismodificarUsuario == true) { frm.btn_Guardar.Enabled = true; frm.btn_Cancelar.Enabled = true; } else { frm.btn_Guardar.Enabled = false; frm.btn_Cancelar.Enabled = false; } frm.ShowDialog(); } }