protected void consultarEmpleadoLoad(string dni) { string cleanMessage = string.Empty; { BL_PERSONAL objPersona = new BL_PERSONAL(); DataTable dtResul = new DataTable(); int i = 0; int j = 0; char[] letras = dni.ToCharArray(); for (i = 0; i < dni.Length; i++) { if (letras[i] == '-') { j = i; break; } } if (j > 0) { // dtResul = objPersona.BuscarDNI(dni.Substring(0, j - 1)); dtResul = objPersona.BuscarDNIMOD(dni.Substring(0, j - 1)); } else { // dtResul = objPersona.BuscarDNI(dni); dtResul = objPersona.BuscarDNIMOD(dni); // RegistrarNuevoMOD(); } limpiar(); if (dtResul.Rows.Count > 0) { lblPersonal.Text = dtResul.Rows[0]["DES_NOMBRE"].ToString(); int idPersona = Convert.ToInt32(dtResul.Rows[0]["IDE_EMPLEADO"].ToString()); lblIdPersonal.Text = dtResul.Rows[0]["IDE_EMPLEADO"].ToString(); BL_PERSONAL obj = new BL_PERSONAL(); DataTable dtResultado = new DataTable(); dtResultado = obj.BuscarDNI_MOD(idPersona); if (dtResultado.Rows.Count > 0) { ModalRegistro.Show(); int EnProcesos = Convert.ToInt32(dtResultado.Rows[0]["EN_PROCESO"].ToString()); if (EnProcesos > 0) { btnAsignar.Visible = false; btnNo.Visible = false; btnCerrar.Visible = true; } else { btnAsignar.Visible = true; btnNo.Visible = true; btnCerrar.Visible = false; } gridPersonal.DataSource = dtResultado; gridPersonal.DataBind(); } else { // REGISTRO NUEVOS lblIde_MOD.Text = "0"; Estado(); PanelDatos.Visible = true; txtDNI.ReadOnly = true; txtNombre.ReadOnly = true; txtDNI.Text = dtResul.Rows[0]["DES_DNI"].ToString(); txtNombre.Text = dtResul.Rows[0]["DES_NOMBRE"].ToString(); lblIdPersonal.Text = dtResul.Rows[0]["IDE_EMPLEADO"].ToString(); txtDniBusqueda.Text = string.Empty; txtPersonal.Text = string.Empty; chkEstado.Checked = true; chkAtendido.Checked = false; //restricciones(); } } else { PanelDatos.Visible = false; txtDniBusqueda.Text = string.Empty; txtPersonal.Text = string.Empty; //cleanMessage = "No se registra informacion"; //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }