protected void Procesar(object sender, ImageClickEventArgs e)
    {
        ImageButton btnProcesar = ((ImageButton)sender);
        GridViewRow row         = btnProcesar.NamingContainer as GridViewRow;
        string      pk          = GridView1.DataKeys[row.RowIndex].Values[0].ToString();

        RadioButtonList rb        = (RadioButtonList)row.FindControl("rdoOpcion");
        TextBox         txtInicio = (TextBox)row.FindControl("txtInicio");
        TextBox         txtfin    = (TextBox)row.FindControl("txtfin");


        BL_RRHH_DESEMPENIO_ETAPAS obj = new BL_RRHH_DESEMPENIO_ETAPAS();
        DataTable dt     = new DataTable();
        int       Estado = 0;

        if (rb.SelectedValue == "CERRADO")
        {
            Estado = 0;
        }
        else
        {
            Estado = 1;
        }
        string a = txtInicio.Text.Trim();

        if (txtInicio.Text.Trim() == string.Empty || txtfin.Text.Trim() == string.Empty)
        {
            string cleanMessage = "Ingresar la fecha de inicio y fin de la etapa";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else if (txtInicio.Text.Trim() == "" || txtfin.Text.Trim() == "")
        {
            string cleanMessage = "Ingresar la fecha de inicio y fin de la etapa";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            DateTime inicio = Convert.ToDateTime(txtInicio.Text.Trim());
            DateTime final  = Convert.ToDateTime(txtfin.Text.Trim());

            if (inicio > final)
            {
                string cleanMessage = "La fecha de inicio no puede ser mayor a la fecha final";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
            else
            {
                dt = obj.uspUPD_RRHH_DESEMPENIO_ETAPAS(Convert.ToInt32(pk), inicio.ToString("dd/M/yyyy"), final.ToString("dd/M/yyyy"), Estado);
                string cleanMessage = "Actualización satisfactoria";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

                Listar();
            }
        }
    }
    protected void btnGenerar_Click(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        BE_RRHH_DESEMPENIO_ETAPAS oBESol = new BE_RRHH_DESEMPENIO_ETAPAS();

        oBESol.ANIO          = Convert.ToInt32(ddlanio.SelectedValue);
        oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString();

        int dtrpta = 0;

        dtrpta = new BL_RRHH_DESEMPENIO_ETAPAS().uspINS_RRHH_DESEMPENIO_ETAPAS(oBESol);
        Listar();
    }
    protected void Listar()
    {
        BL_RRHH_DESEMPENIO_ETAPAS obj = new BL_RRHH_DESEMPENIO_ETAPAS();
        DataTable dtResultado         = new DataTable();

        dtResultado = obj.uspSEL_RRHH_DESEMPENIO_ETAPAS_POR_ANIO(Convert.ToInt32(ddlanio.SelectedValue.ToString()), ddlcecos.SelectedValue.ToString());
        if (dtResultado.Rows.Count > 0)
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
    }
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        //if (CheckCompetencia.SelectedIndex != -1)
        int cantidad = 0;

        if (ddlestapas.SelectedIndex > -1)
        {
            foreach (ListItem li in ddlestapas.Items)
            {
                if (li.Selected)
                {
                    DataTable dt = new DataTable();
                    BE_RRHH_DESEMPENIO_ETAPAS oBESol = new BE_RRHH_DESEMPENIO_ETAPAS();
                    oBESol.ANIO          = Convert.ToInt32(ddlanio.SelectedValue);
                    oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString();
                    oBESol.CODIGO_ETAPA  = Convert.ToInt32(li.Value);
                    oBESol.CECOS         = ddlCentro.SelectedValue.ToString();
                    int dtrpta = 0;
                    dtrpta = new BL_RRHH_DESEMPENIO_ETAPAS().uspINS_RRHH_DESEMPENIO_ETAPAS_ID(oBESol);
                    if (dtrpta > 0)
                    {
                        cantidad++;
                    }
                }
            }

            if (cantidad > 0)
            {
                Listar();
                string cleanMessage = "Registro satisfactorio";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
            else
            {
                string cleanMessage = "Algunas etapas ya se encuetran registradas";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
        }
        else
        {
            string cleanMessage = "Debe seleccionar alguna etapa";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
Esempio n. 5
0
    protected void etapas()
    {
        BL_RRHH_DESEMPENIO_ETAPAS obj = new BL_RRHH_DESEMPENIO_ETAPAS();
        DataTable dtResultado         = new DataTable();

        if (Gerente == Session["IDE_USUARIO"].ToString())
        {
            Session["IP_CENTRO"] = string.Empty;
        }
        else
        {
            dtResultado = obj.uspSEL_RRHH_DESEMPENIO_ETAPA_PERSONA(anio, Session["IDE_USUARIO"].ToString(), Session["IP_CENTRO"].ToString());
        }


        if (dtResultado.Rows.Count > 0)
        {
            dlCustomers.DataSource = dtResultado;
            dlCustomers.DataBind();
        }
    }