protected void btnAsignar_Click(object sender, EventArgs e) { lblIde_MOD.Text = "0"; limpiar(); PanelDatos.Visible = true; BL_PERSONAL objPersona = new BL_PERSONAL(); DataTable dtResul = new DataTable(); chkEstado.Checked = true; string Personal = gridPersonal.DataKeys[0].Values[0].ToString(); dtResul = objPersona.BuscarDNI(Personal.Substring(0, 8)); PanelDatos.Visible = true; txtDNI.ReadOnly = true; txtDNI.Text = dtResul.Rows[0]["DES_DNI"].ToString(); txtNombre.Text = dtResul.Rows[0]["DES_NOMBRE"].ToString(); txtDniBusqueda.Text = string.Empty; txtPersonal.Text = string.Empty; Estado(); EstadosProcesos_controles(0); }
protected void BuscaPersonalInicio(string Nombre) { { BL_PERSONAL obj = new BL_PERSONAL(); DataTable dtResultado = new DataTable(); dtResultado = obj.BuscarDNI(Nombre); if (dtResultado.Rows.Count > 0) { txtDNI.ReadOnly = true; lblCodigoPersonal.Text = dtResultado.Rows[0]["IDE_EMPLEADO"].ToString(); txtDNI.Text = dtResultado.Rows[0]["DES_DNI"].ToString(); txtNombre.Text = dtResultado.Rows[0]["DES_NOMBRE"].ToString(); txtApePat.Text = dtResultado.Rows[0]["DES_APEPAT"].ToString(); txtApeMat.Text = dtResultado.Rows[0]["DES_APEMAT"].ToString(); txtFono.Text = dtResultado.Rows[0]["DES_TELEFONO"].ToString(); txtCorreo.Text = dtResultado.Rows[0]["DES_CORREO"].ToString(); txtDireccion.Text = dtResultado.Rows[0]["DES_DIRECCION"].ToString(); txtNacimiento.Text = dtResultado.Rows[0]["FEC_FECHA_NACIMIENTO"].ToString(); // txtIngreso.Text = dtResultado.Rows[0]["FEC_FECHA_INGRESO"].ToString(); ddlCivil.SelectedValue = dtResultado.Rows[0]["DES_ESTADO_CIVIL"].ToString(); ParametrosCivil(); ddlDocumento.SelectedValue = dtResultado.Rows[0]["DES_TIPO_DOCUMENTO"].ToString(); ddlCargos.SelectedValue = dtResultado.Rows[0]["DES_CARGO"].ToString(); TipoDocumento(); if (dtResultado.Rows[0]["FOTO"] != DBNull.Value) { byte[] imageBuffer = (byte[])dtResultado.Rows[0]["FOTO"]; if (imageBuffer != null) { System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBuffer); ImgFoto.ImageUrl = "~/HandlerFoto.ashx?ID=" + Nombre; // dtResultado.Rows[0]["icodpersonal"]; } } } } }
protected void consultarEmpleado(string dni) { string cleanMessage = string.Empty; if (dni == string.Empty) { cleanMessage = "Ingresar Nombre o DNI a consultar"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { 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)); } else { dtResul = objPersona.BuscarDNI(dni); } 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_MOI(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_MOI.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); } } }