Ejemplo n.º 1
0
    protected void Listar()
    {
        lblRequ_Numero.Text      = Request.QueryString["Requ_Numero"].ToString();
        lblReqd_CodLinea.Text    = Request.QueryString["Reqd_CodLinea"].ToString();
        lblReqs_Correlativo.Text = Request.QueryString["Reqs_Correlativo"].ToString();
        BL_SOLPED obj         = new BL_SOLPED();
        DataTable dtResultado = new DataTable();

        dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER SOLPED", BL_Session.ID_EMPRESA.ToString());
        if (dtResultado.Rows.Count > 0)
        {
            BL_TBL_RequerimientoSubDetalle Xobj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dt = new DataTable();
            dt = Xobj.LISTAR_GRUPO_LEGAJOFILE(lblRequ_Numero.Text, lblReqd_CodLinea.Text, lblReqs_Correlativo.Text, 1);
            dt.Rows.Count.ToString();

            if (dt.Rows.Count > 0)
            {
                GridReq.DataSource = dt;
                GridReq.DataBind();
            }
            else
            {
                GridReq.DataSource = dt;
                GridReq.DataBind();
                string cleanMessage = "Falta adjuntar documentación de legajos";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
        }
        else
        {
            string cleanMessage = "No tiene permisos para realizar esta operación";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
    protected void Listar()
    {
        Reqs_ItemSecuencia = Request.QueryString["Reqs_ItemSecuencia"].ToString();

        BL_TBL_RequerimientoSubDetalle Xobj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dt = new DataTable();

        dt = Xobj.LISTAR_DATOS_EQUIPO(Reqs_ItemSecuencia);
        dt.Rows.Count.ToString();

        if (dt.Rows.Count > 0)
        {
            GridReq.DataSource = dt;
            GridReq.DataBind();
        }
        else
        {
            string cleanMessage = "Falta adjuntar documentación de legajos";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
Ejemplo n.º 3
0
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        string cleanMessage = string.Empty;

        if (txtSolped.Text.Trim() == string.Empty)
        {
            cleanMessage = "Ingresar N° SOLPED";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else if (txtSolped.Text.Trim().Length < 10)
        {
            cleanMessage = "Falta completar los 10 digitos requeridos para el N° SOLPED";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();


            string Requ_Numero      = string.Empty;
            string Reqd_CodLinea    = string.Empty;
            string Reqs_Correlativo = string.Empty;

            int CantidadPos = 0;
            int registros   = 0;
            foreach (GridViewRow row in GridReq.Rows)
            {
                Requ_Numero      = GridReq.DataKeys[row.RowIndex].Values[0].ToString(); // extrae key
                Reqd_CodLinea    = GridReq.DataKeys[row.RowIndex].Values[1].ToString(); // extrae key
                Reqs_Correlativo = GridReq.DataKeys[row.RowIndex].Values[2].ToString(); // extrae key

                TextBox txtPosAlquiler = ((TextBox)row.FindControl("txtPosAlquiler"));
                TextBox txtPosMov      = ((TextBox)row.FindControl("txtPosMov"));

                DropDownList ddlSubFamilia = ((DropDownList)row.FindControl("ddlSubFamilia"));
                DropDownList ddlMarca      = ((DropDownList)row.FindControl("ddlMarca"));
                DropDownList ddlModelo     = ((DropDownList)row.FindControl("ddlModelo"));
                TextBox      txtCapacidad  = ((TextBox)row.FindControl("txtCapacidad"));

                if (txtPosAlquiler.Text.Trim() == string.Empty)
                {
                    CantidadPos++;
                }


                else
                {
                    obj.UPD_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_SOLPED(
                        Requ_Numero, Reqd_CodLinea,
                        Reqs_Correlativo, txtSolped.Text.Trim(),
                        txtPosAlquiler.Text,
                        txtPosMov.Text,
                        ddlSubFamilia.SelectedValue.ToString(),
                        ddlMarca.SelectedValue.ToString(),
                        ddlModelo.SelectedValue.ToString(),
                        txtCapacidad.Text
                        );

                    if (Requ_Numero != string.Empty)
                    {
                        registros++;
                    }
                }
            }


            if (registros > 0)
            {
                string url     = URLSSK;
                string mensaje = "El Sistema de Equipos Menores SSK informa, se asignó el código Solped " + txtSolped.Text + " a los siguientes requerimientos del proyecto ";
                obj.USP_SEL_TBL_REQUERIMIENTO_CORREO_SOLPED_VARIOS(txtSolped.Text, mensaje, "ALQUILER CARE", url);

                txtSolped.Text = string.Empty;

                cleanMessage = "Registro satisfactorio";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
                BL_TBL_RequerimientoSubDetalle Xobj = new BL_TBL_RequerimientoSubDetalle();
                DataTable dt = new DataTable();
                dt = Xobj.LISTAR_GRUPO_LEGAJOFILE(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, 1);
                dt.Rows.Count.ToString();

                if (dt.Rows.Count > 0)
                {
                    GridReq.DataSource = dt;
                    GridReq.DataBind();
                }
            }
            if (CantidadPos > 0)
            {
                cleanMessage = "Completar todas las posiciones de alquiler";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
        }
    }