protected void RegistrarMOD()
    {
        string cleanMessage = string.Empty;
        BE_MOD oBEPersonal  = new BE_MOD();

        oBEPersonal = f_CapturarDatos();
        int rpta;

        rpta = new BL_PERSONAL().Mant_Insert_Operarios_Mod(oBEPersonal);

        if (rpta > 0)
        {
            // consultarEmpleado(txtDNI.Text);
            cleanMessage = "Registro Satisfactorio";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            lblIde_MOD.Text = rpta.ToString();
            BL_PERSONAL obj         = new BL_PERSONAL();
            DataTable   dtResultado = new DataTable();
            dtResultado = obj.BuscarDNI_MOD(Convert.ToInt32(lblIde_MOD.Text));
            Estado();
            PanelDatos.Visible = true;
            txtDNI.ReadOnly    = true;
            txtNombre.ReadOnly = true;
            //Response.Redirect("frmRequerimiento.aspx");//?id=123
        }
    }
    protected void RegistrarNuevoMOD()
    {
        string cleanMessage = string.Empty;
        int    rpta;

        string requerimiento = Convert.ToString(Session["ID_DETALLE_REQUERIMIENTO_PERSONAL"]);
        string dni           = Convert.ToString(Session["DES_DNI"]);

        rpta = new BL_PERSONAL().Mant_Insert_OperariosNuevosMod(requerimiento, dni);

        if (rpta > 0)
        {
            // consultarEmpleado(txtDNI.Text);
            cleanMessage = "Registro Satisfactorio";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            lblIde_MOD.Text = rpta.ToString();
            BL_PERSONAL obj         = new BL_PERSONAL();
            DataTable   dtResultado = new DataTable();
            dtResultado = obj.BuscarDNI_MOD(Convert.ToInt32(lblIde_MOD.Text));
            Estado();
            PanelDatos.Visible = true;
            txtDNI.ReadOnly    = true;
            txtNombre.ReadOnly = true;
        }
    }
示例#3
0
    protected void BuscaPersonalInicio(string Nombre)
    {
        {
            BL_PERSONAL obj         = new BL_PERSONAL();
            DataTable   dtResultado = new DataTable();
            //dtResultado = obj.BuscarDNI(Nombre);
            dtResultado = obj.BuscarDNI_MOD(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();
                cargos();
                string x = dtResultado.Rows[0]["DES_CARGO"].ToString();
                ddlCargos.SelectedValue = dtResultado.Rows[0]["DES_CARGO"].ToString();


                ddlEspecialidad.SelectedValue = dtResultado.Rows[0]["DES_ESPECIALIDAD"].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 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);
            }
        }
    }