示例#1
0
    protected void Proyectos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = obj.USP_SEL_TBL_ARRIENDO_CC("RESPONSABLE ALQUILER", Session["IDE_USUARIO"].ToString(), BL_Session.CENTRO_COSTO);
        if (dtResultado.Rows.Count > 0)
        {
            ddlcentro.DataSource     = dtResultado;
            ddlcentro.DataTextField  = "Proy_Nombre";
            ddlcentro.DataValueField = "Proy_Codigo";
            ddlcentro.DataBind();

            if (dtResultado.Rows.Count > 1)
            {
                ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", ""));
            }

            //Proveedor();
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }
        else
        {
            string cleanMessage = "No cuenta con permisos";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
    protected void Buscarrequerimientos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        if (txtPdc.Text != string.Empty)
        {
            string Estado = string.Empty;
            Estado = ddlEstado.SelectedValue.ToString();

            if (ddlEstado.SelectedIndex == 0)
            {
                Estado = string.Empty;
            }
            dtResultado = obj.USP_SEL_TBL_REQUERIMIENTO_PDC_AMPLIAR("", txtPdc.Text.Trim(), "1", Estado);//1 los equipos ampliados
            if (dtResultado.Rows.Count > 0)
            {
                btnAgregar.Visible   = true;
                GridView1.DataSource = dtResultado;
                GridView1.DataBind();
            }
            else
            {
                btnAgregar.Visible = false;
                //string cleanMessage = "No exisen requerimientos con solicitud de ampliación ";
                //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
                GridView1.DataSource = dtResultado;
                GridView1.DataBind();
            }
        }
    }
示例#3
0
    protected void datos()
    {
        CleanControl(this.Controls);
        Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
        Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
        Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();
        BL_TBL_RequerimientoSubDetalle Obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = Obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_ID(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo);
        if (dtResultado.Rows.Count > 0)
        {
            try
            {
                txtPdc.Text      = dtResultado.Rows[0]["D_PDC"].ToString();
                txtFechaPDC.Text = dtResultado.Rows[0]["D_PDC_FECHA"].ToString();
                txtmonto.Text    = dtResultado.Rows[0]["D_PDC_MONTO_TOTAL"].ToString();

                ddlMoneda.SelectedValue = dtResultado.Rows[0]["D_PDC_MONEDA"].ToString();
            }
            catch (Exception ex)
            {
            }
        }
    }
示例#4
0
    protected void VerdetallePrecio(object sender, EventArgs e)

    {
        ImageButton btnSelect = ((ImageButton)sender);

        GridViewRow grdrow = (GridViewRow)((ImageButton)sender).NamingContainer;


        string _Requ_Numero      = GridView2.DataKeys[grdrow.RowIndex].Values["Requ_Numero"].ToString();
        string _Reqd_CodLinea    = GridView2.DataKeys[grdrow.RowIndex].Values["Reqd_CodLinea"].ToString();
        string _Reqs_Correlativo = GridView2.DataKeys[grdrow.RowIndex].Values["Reqs_Correlativo"].ToString();


        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();


        dtResultado = obj.uspSEL_TBL_REQUERIMIENTOSUBDETALLE_PDC_HISTORIAL(_Requ_Numero, _Reqd_CodLinea, _Reqs_Correlativo);
        if (dtResultado.Rows.Count > 0)
        {
            GridView3.DataSource = dtResultado;
            GridView3.DataBind();
        }
        else
        {
            GridView3.DataSource = dtResultado;
            GridView3.DataBind();
        }
        ModalRegistro.Show();
    }
示例#5
0
    protected void Buscarrequerimientos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        string Estado = string.Empty;

        Estado = ddlEstado.SelectedValue.ToString();

        if (ddlEstado.SelectedIndex == 0)
        {
            Estado = string.Empty;
        }


        dtResultado = obj.USP_SEL_TBL_REQUERIMIENTO_PDC_AMPLIAR(BL_Session.CENTRO_COSTO.ToString(), txtPdc.Text, "1", Estado);    //1 los equipos ampliados
        if (dtResultado.Rows.Count > 0)
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            string cleanMessage = "No exisen requerimientos con solicitud de ampliación ";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        string cleanMessage = string.Empty;

        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        Reqs_ItemSecuencia = Request.QueryString["Reqs_ItemSecuencia"].ToString();
        foreach (GridViewRow row in GridReq.Rows)
        {
            DropDownList ddlSubFamilia = ((DropDownList)row.FindControl("ddlSubFamilia"));
            DropDownList ddlMarca      = ((DropDownList)row.FindControl("ddlMarca"));
            DropDownList ddlModelo     = ((DropDownList)row.FindControl("ddlModelo"));
            TextBox      txtCapacidad  = ((TextBox)row.FindControl("txtCapacidad"));


            obj.UPD_SEL_TBL_REQUERIMIENTO_EQUIPO_OBRA(
                Reqs_ItemSecuencia,
                ddlSubFamilia.SelectedValue.ToString(),
                ddlMarca.SelectedValue.ToString(),
                ddlModelo.SelectedValue.ToString(),
                txtCapacidad.Text
                );
        }
        cleanMessage = "Actualización satisfactoria";
        ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
    }
    protected void Eliminar(object sender, EventArgs e)
    {
        String path = Server.MapPath(FolderAlquiler);


        ImageButton btnEliminar            = ((ImageButton)sender);
        GridViewRow grdrow                 = (GridViewRow)((ImageButton)sender).NamingContainer;
        string      IDE_FILE               = GridView1.DataKeys[grdrow.RowIndex].Values["ide_LegajoFile"].ToString();
        string      Archivo                = GridView1.DataKeys[grdrow.RowIndex].Values["FILE_ARCHIVO"].ToString();
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado              = new DataTable();

        try
        {
            if (File.Exists(path + Archivo))
            {
                File.Delete(path + Archivo);
            }
        }
        catch (Exception ex)
        {
        }

        //dtResultado = obj.uspDEL_TBL_REQUERIMIENTOSUBDETALLE_LEGAJOFILE(Convert.ToInt32(IDE_FILE));

        file();
    }
    protected void ConsultarPermisos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = obj.USP_SEL_TBL_VALORIZACION_CC("ALQUILER VALORIZACION", Session["IDE_USUARIO"].ToString());
        if (dtResultado.Rows.Count > 0)
        {
            btnBuscar.Visible = true;

            btnGuardar.Visible   = true;
            btnCerrar.Visible    = true;
            btnValorizar.Visible = true;
            btnTarifas.Visible   = true;
            btnImprimir.Visible  = true;
        }
        else
        {
            btnImprimir.Visible  = false;
            btnValorizar.Visible = false;
            btnTarifas.Visible   = false;
            btnBuscar.Visible    = false;

            btnGuardar.Visible = false;
            btnCerrar.Visible  = false;

            string cleanMessage = "No cuenta con permisos";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
示例#9
0
    protected void btnImprimir_Click(object sender, ImageClickEventArgs e)
    {
        string estado = string.Empty;

        if (ddlEstado.SelectedIndex == 0)
        {
            estado = string.Empty;
        }
        else
        {
            estado = ddlEstado.SelectedValue.ToString();
        }

        string Centro = string.Empty;

        if (ddlcentro.SelectedIndex == 0)
        {
            Centro = string.Empty;
        }
        else
        {
            Centro = ddlcentro.SelectedValue.ToString();
        }

        estado = ddlEstado.SelectedValue.ToString();
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultadoeExcel        = new DataTable();



        TextBox txtRequerimientosa_H = (TextBox)GridView1.HeaderRow.FindControl("txtRequerimientosa_H");
        TextBox txtFamilia_H         = (TextBox)GridView1.HeaderRow.FindControl("txtFamilia_H");
        TextBox txtSUBFAMILIA_H      = (TextBox)GridView1.HeaderRow.FindControl("txtSUBFAMILIA_H");
        TextBox txtSOLPED_H          = (TextBox)GridView1.HeaderRow.FindControl("txtSOLPED_H");
        TextBox txtPDC_H             = (TextBox)GridView1.HeaderRow.FindControl("txtGPO_H");
        TextBox txtGPO_H             = (TextBox)GridView1.HeaderRow.FindControl("txtPDC_H");



        dtResultadoeExcel = obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR("", estado, ddlanio.SelectedValue.ToString(), Centro,
                                                                       txtRequerimientosa_H.Text.Trim(), txtFamilia_H.Text.Trim(), txtSUBFAMILIA_H.Text.Trim(),
                                                                       txtSOLPED_H.Text.Trim(),
                                                                       txtPDC_H.Text.Trim(), txtGPO_H.Text.Trim(), "1", "");

        if (dtResultadoeExcel.Rows.Count > 0)
        {
            //ExcelHelper.ToExcel(dtResultadoeExcel, "CJI3_" + ddlEstados.SelectedItem + ".xls", Page.Response);

            gvExcel.DataSource = dtResultadoeExcel;
            gvExcel.DataBind();



            GridViewExportUtil.Export("ARRIENDOS_" + DateTime.Now + ".xls", gvExcel);
            return;
        }
        else
        {
        }
    }
    protected void Buscarrequerimientos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();
        string    Estado      = string.Empty;

        Estado = ddlEstado.SelectedValue.ToString();

        if (ddlEstado.SelectedIndex == 0)
        {
            Estado = string.Empty;
        }

        /**
         * @FLG_BORRADOR_AMPLIACION: para listar todos aquellos que han sido indicados como ampliacion (aprobados y rechazados)
         * @FLG_AMPLIACION: solo los requermientos aprobados como ampliacion
         *
         * **/
        dtResultado = obj.USP_SEL_TBL_REQUERIMIENTO_PDC_AMPLIAR("", txtPdc.Text, "1", Estado);//1 los equipos ampliados
        if (dtResultado.Rows.Count > 0)
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            string cleanMessage = "No exisen requerimientos con solicitud de ampliación ";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
示例#11
0
    protected void EnviarSOL_PDC(object sender, EventArgs e)
    {
        ImageButton btnLegajo = ((ImageButton)sender);

        GridViewRow grdrow = (GridViewRow)((ImageButton)sender).NamingContainer;

        string Requ_Numero      = GridView1.DataKeys[grdrow.RowIndex].Values["Requ_Numero"].ToString();
        string Reqd_CodLinea    = GridView1.DataKeys[grdrow.RowIndex].Values["Reqd_CodLinea"].ToString();
        string Reqs_Correlativo = GridView1.DataKeys[grdrow.RowIndex].Values["Reqs_Correlativo"].ToString();
        string SOLPED           = GridView1.DataKeys[grdrow.RowIndex].Values["D_SOLPED"].ToString();

        string url = URLSSK + "OPERACIONES/UrlPDC_EM?Usuario=" + Session["IDE_USUARIO"].ToString() + "&Requ_Numero=" + Requ_Numero.Trim() + "&Reqd_CodLinea=" + Reqd_CodLinea.Trim() + "&Reqs_Correlativo=" + Reqs_Correlativo;

        string cleanMessage = string.Empty;

        if (SOLPED.Length < 1)
        {
            cleanMessage = "Falta generar SOLPED";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }

        else
        {
            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();
            string    mensaje     = "El Sistema de Equipos Menores SSK informa, se requiere la emisión de Pedido (PDC), según la SOLPED  N° " + SOLPED + ", del proyecto ";
            obj.USP_SEL_TBL_REQUERIMIENTO_CORREO_SOLPED_VARIOS(SOLPED, mensaje, "ALQUILER EQ MAYORES (PDC)", url);

            cleanMessage = "Envio satisfactorio";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

            filtros();
        }
    }
示例#12
0
    protected void Proyectos()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        //dtResultado = obj.USP_SEL_TBL_VALORIZACION_CC_CONSOLIDADO("ALQUILER VALORIZACION", Session["IDE_USUARIO"].ToString(), Convert.ToInt32(ddlanio.SelectedValue), Convert.ToInt32(ddlMes.SelectedValue));
        dtResultado = obj.USP_SEL_TBL_VALORIZACION_CC("ALQUILER VALORIZACION", Session["IDE_USUARIO"].ToString());

        if (dtResultado.Rows.Count > 0)
        {
            //Panel1.Visible = true;
            ddlcentro.DataSource     = dtResultado;
            ddlcentro.DataTextField  = "Proy_Nombre";
            ddlcentro.DataValueField = "Proy_Codigo";
            ddlcentro.DataBind();
            if (dtResultado.Rows.Count > 1)
            {
                ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", ""));
            }
            rpt_cuadro();
        }
        else
        {
            //Panel1.Visible = false;
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
    protected void Proveedor()
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        string Centro = string.Empty;

        if (ddlcentro.SelectedIndex == 0)
        {
            Centro = string.Empty;
        }
        else
        {
            Centro = ddlcentro.SelectedValue.ToString();
        }

        dtResultado = obj.USP_SEL_TBL_VAL_PROVEEDOR_CONSOLIDADO(Centro, ddlanio.SelectedValue.ToString(), ddlMes.SelectedValue.ToString());
        if (dtResultado.Rows.Count > 0)
        {
            ddlProveedor.DataSource     = dtResultado;
            ddlProveedor.DataTextField  = "Proveedor";
            ddlProveedor.DataValueField = "Prov_RUC";
            ddlProveedor.DataBind();
            ddlProveedor.Items.Insert(0, new ListItem("--- TODOS ---", ""));
        }
        else
        {
            ddlProveedor.DataSource = dtResultado;
            ddlProveedor.DataBind();
            ddlProveedor.Items.Insert(0, new ListItem("--- TODOS ---", ""));
        }

        rpt_cuadro();
    }
示例#14
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);
        }
    }
示例#15
0
    protected void btnAsociar_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage = string.Empty;

        if (ddlRequerimiento.SelectedValue == string.Empty)
        {
            cleanMessage = "Ingresar Nro de requerimiento";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else if (txtFinSalida.Text.Trim() == string.Empty)
        {
            cleanMessage = "Ingresar fecha fin de contrato";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else if (GridView1.Rows.Count == 0)
        {
            cleanMessage = "No existen documentos registrados";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
            Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
            Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();
            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();


            dtResultado = obj.uspREGISTRAR_LEGAJOFILE(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, 1, ddlRequerimiento.SelectedValue.ToString(), txtFinSalida.Text.Trim());
            GrupoFile();
        }
    }
    protected void btnSave_Click(object sender, ImageClickEventArgs e)
    {
        Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
        Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
        Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();
        idValor          = Request.QueryString["idValor"].ToString();
        Proyecto         = Request.QueryString["Proyecto"].ToString();

        string cleanMessage = string.Empty;


        string CODIGO = string.IsNullOrEmpty(idValor) ? "0" : idValor;
        string PRECIO = string.IsNullOrEmpty(txtPrecio.Text) ? "0" : txtPrecio.Text;

        if (txtPrecio.Text.Trim() == string.Empty)
        {
            cleanMessage = "Ingresar tarifa";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }
        else
        {
            //verificamos fecha de registro
            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dt = new DataTable();
            dt = obj.USP_TBL_VALORIZACION_FECHA_TARIFA(Requ_Numero,
                                                       Reqd_CodLinea,
                                                       Reqs_Correlativo,
                                                       txtInicio.Text.Trim());
            if (dt.Rows[0]["ESTADO"].ToString() == "0")
            {
                cleanMessage = dt.Rows[0]["MSG"].ToString();
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
            else
            {
                DataTable dtResultado = new DataTable();

                dtResultado = obj.uspINS_valorizar_ValorPeriodo(
                    Convert.ToInt32(CODIGO),
                    Requ_Numero,
                    Reqd_CodLinea,
                    Reqs_Correlativo,
                    txtInicio.Text.Trim(),
                    PRECIO,
                    Session["IDE_USUARIO"].ToString(),
                    Proyecto

                    );
                if (dtResultado.Rows.Count > 0)
                {
                    txtInicio.Text = string.Empty;
                    Listar();
                    cleanMessage = "Registro satisfactorio";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
                }
            }
        }
    }
示例#17
0
    protected void btn_Click(object sender, EventArgs e)
    {
        string cleanMessage      = string.Empty;
        string _Requ_Numero      = string.Empty;
        string _Reqd_CodLinea    = string.Empty;
        string _Reqs_Correlativo = string.Empty;

        Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
        Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
        Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();

        try
        {
            int intContador = 0;
            foreach (GridViewRow row in GridView1.Rows)
            {
                RadioButtonList rb = (RadioButtonList)row.FindControl("rdoOpcion");
                TextBox         txtObservaciones = (TextBox)row.FindControl("txtObservaciones");
                _Requ_Numero      = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); // extrae key
                _Reqd_CodLinea    = GridView1.DataKeys[row.RowIndex].Values[1].ToString(); // extrae key
                _Reqs_Correlativo = GridView1.DataKeys[row.RowIndex].Values[2].ToString(); // extrae key

                BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
                DataTable dtResultado = new DataTable();

                if (rb.SelectedValue == "I+")
                {
                    intContador++;
                }
                dtResultado = obj.USP_SEL_PROCESAR_REGULARIZACION(_Requ_Numero, _Reqd_CodLinea, _Reqs_Correlativo, rb.SelectedValue, Session["IDE_USUARIO"].ToString(), txtObservaciones.Text.Trim(), 1);
            }

            // correo para los encargos del sig
            BL_TBL_RequerimientoSubDetalle xobj = new BL_TBL_RequerimientoSubDetalle();
            string url     = URLSSK;
            string mensaje = "El Sistema de Equipos Menores SSK informa que se realizó la revisión del proceso de REGULARIZACIÓN de la lista de equipos para el proyecto ";
            xobj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_CORREO(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, mensaje, "ALQUILER CARE SOLPED", url);


            cleanMessage = "Se actualizo el estado de los equipos correctamente.";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

            // correo solicitando mas informacion
            if (intContador > 0)
            {
                cleanMessage = "Se ha notificado a los responsables de OT sobre el envio de más información";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

                mensaje = "El Sistema de Equipos Menores SSK informa que se realizó la revisión del proceso de REGULARIZACIÓN, la cual se solicita el envio de más información de la lista de equipos para el proyecto ";
                xobj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_REG_INFORMACION(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, mensaje, "ALQUILER CARE (OT)", url);
            }


            Listar();
        }
        catch (Exception ex)
        {
        }
    }
示例#18
0
    private DataTable GetDataSubFamilia(string Fami_Codigo)
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dt = new DataTable();

        dt = obj.SP_BUSCAR_TBL_SubFamilia(Fami_Codigo);
        return(dt);
    }
示例#19
0
    private DataTable GetDataModeo(string Marc_Codigo, string Mode_Codigo)
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dt = new DataTable();

        dt = obj.SP_BUSCAR_TBL_Modelo(Marc_Codigo, Mode_Codigo);
        return(dt);
    }
示例#20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string ruta = Server.MapPath(FolderAlquiler);
            BL_TBL_RequerimientoSubDetalle objx = new BL_TBL_RequerimientoSubDetalle();
            DataTable dt = new DataTable();
            dt = objx.SP_LISTAR_ARCHIVOS_PDC_TODOS("");
            for (int j = 0; j < dt.Rows.Count; j++)
            {
                ////**********************************************************
                //******** CREAR DIRECTORIO PROYECTO ******************************
                string Proyecto       = dt.Rows[j]["PROYECTO"].ToString();
                string PDC            = dt.Rows[j]["PDC"].ToString();
                string DIRECTORIO_PDC = dt.Rows[j]["DIRECTORIO"].ToString();
                string rutaOBRA       = FolderFTP + Proyecto.Substring(0, 5);



                // Si el directorio no existe, crearlo
                if (!Directory.Exists(rutaOBRA))//directorio OBRA
                {
                    Directory.CreateDirectory(rutaOBRA);
                }

                //DIRECTORIO  SAT
                string rutaSAT = Path.Combine(rutaOBRA, "SAT");
                if (!Directory.Exists(rutaSAT))//directorio final
                {
                    Directory.CreateDirectory(rutaSAT);
                }


                //DIRECTORIO  CODIGO DE PDC
                string rutaPDC_CODIGO = Path.Combine(rutaSAT, DIRECTORIO_PDC);
                if (!Directory.Exists(rutaPDC_CODIGO))//directorio final
                {
                    Directory.CreateDirectory(rutaPDC_CODIGO);
                }

                BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
                DataTable dtResultado = new DataTable();
                dtResultado = obj.SP_LISTAR_ARCHIVOS_PDC(PDC);
                for (int i = 0; i < dtResultado.Rows.Count; i++)
                {
                    string adjunto = dtResultado.Rows[i]["ARCHIVO"].ToString();
                    if (File.Exists(Path.Combine(ruta, adjunto)))
                    {
                        File.Copy(Path.Combine(ruta, adjunto), Path.Combine(rutaPDC_CODIGO, adjunto), true);
                    }
                }
            }
            string cleanMessage = "Registro exitoso.";

            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
示例#21
0
    protected void datos()
    {
        CleanControl(this.Controls);
        Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
        Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
        Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();
        BL_TBL_RequerimientoSubDetalle Obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = Obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_ID(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo);
        if (dtResultado.Rows.Count > 0)
        {
            try
            {
                txtFechaLegajo.Text           = dtResultado.Rows[0]["D_DOCUMENTO_FECHA"].ToString();
                ddldocumento.SelectedValue    = dtResultado.Rows[0]["D_DOCUMENTO_TIPO"].ToString();
                ddlMovilizacion.SelectedValue = dtResultado.Rows[0]["D_DOC_MOVILIZACION"].ToString();



                ddlAtencion.SelectedValue = dtResultado.Rows[0]["D_ATENCION_TIPO"].ToString();
                txtComentarios.Text       = dtResultado.Rows[0]["D_ATENCION_COMENTARIOS"].ToString();
                txtFinSalida.Text         = dtResultado.Rows[0]["D_FECHA_SALE_OBRA"].ToString();
                //CheckOperario.Checked = Convert.ToBoolean( dtResultado.Rows[0]["FLG_OPERARIO"].ToString());

                ddlOperario.SelectedValue = dtResultado.Rows[0]["FLG_OPERARIO"].ToString();


                ddlProveedor.SelectedValue = dtResultado.Rows[0]["D_Prov_RUC"].ToString();
                ddlProveedor.Text          = dtResultado.Rows[0]["Proveedor"].ToString();

                if (dtResultado.Rows[0]["PROCESO_BOTON"].ToString() == "1")
                {
                    btnCargar.Visible = true;
                    btnFile.Visible   = true;
                    foreach (GridViewRow row in GridView1.Rows)
                    {
                        ImageButton btnEliminar = (ImageButton)row.FindControl("btnEliminar");
                        btnEliminar.Visible = true;
                    }
                }
                else
                {
                    btnCargar.Visible = false;
                    btnFile.Visible   = false;
                    foreach (GridViewRow row in GridView1.Rows)
                    {
                        ImageButton btnEliminar = (ImageButton)row.FindControl("btnEliminar");
                        btnEliminar.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
示例#22
0
    protected void Listar(string txtRequerimientosa_H,
                          string txtFamilia_H,
                          string txtSUBFAMILIA_H,
                          string txtSOLPED_H,
                          string txtPDC_H,
                          string txtGPO_H,
                          string txtOR_H)
    {
        string estado = string.Empty;

        if (ddlEstado.SelectedIndex == 0)
        {
            estado = string.Empty;
        }
        else
        {
            estado = ddlEstado.SelectedValue.ToString();
        }

        string Centro = string.Empty;

        //if (ddlcentro.SelectedIndex == 0)
        //{
        //    Centro = string.Empty;
        //}
        //else
        //{
        //    Centro = ddlcentro.SelectedValue.ToString();
        //}
        Centro = BL_Session.CENTRO_COSTO.ToString();



        estado = ddlEstado.SelectedValue.ToString();
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MENOR("", estado, ddlanio.SelectedValue.ToString(), Centro,
                                                                 txtRequerimientosa_H,
                                                                 txtFamilia_H,
                                                                 txtSUBFAMILIA_H,
                                                                 txtSOLPED_H,
                                                                 txtPDC_H,
                                                                 txtGPO_H, "", txtOR_H);
        if (dtResultado.Rows.Count > 0)
        {
            lblCantidad.Text     = "Cantidad : " + dtResultado.Rows.Count.ToString();
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
示例#23
0
    private DataTable GetDataMarca(string marca)
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dt = new DataTable();

        dt = obj.SP_BUSCAR_TBL_MARCA(marca);
        int x = dt.Rows.Count;

        return(dt);
    }
    protected void Anular_requerimiento(object sender, ImageClickEventArgs e)
    {
        ImageButton btnAnular = ((ImageButton)sender);
        GridViewRow row       = btnAnular.NamingContainer as GridViewRow;

        string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString();

        Session["IDE_ASIGNACION"] = GridView1.DataKeys[row.RowIndex].Values[0].ToString();
        string CODIGO_CARE_PADRE = GridView1.DataKeys[row.RowIndex].Values[1].ToString();
        string cleanMessage;
        int    Contador = 0;

        //REVISAMOS SI EXISTE ATENCION EL MOBILE
        BL_MOBILE objMB = new BL_MOBILE();
        DataTable dtMB  = new DataTable();

        dtMB = objMB.usp_RequerimientoListado_codigoCare(CODIGO_CARE_PADRE);
        if (dtMB.Rows.Count > 0)
        {
            //    IdEstadoRequerimiento
            //1   Pendiente
            //2   Aprobado
            string IdEstadoRequerimiento = dtMB.Rows[0]["IdEstadoRequerimiento"].ToString();
            if (IdEstadoRequerimiento.Trim() != "1")
            {
                Contador++;
            }
        }


        BL_TBL_RequerimientoSubDetalle objcare = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtcare = new DataTable();

        dtcare = objcare.uspTBL_RequerimientoDetalle_EstadoAtencion(CODIGO_CARE_PADRE);
        if (dtcare.Rows.Count > 0)
        {   //Reqd_flagTemporal 0 es pendiente
            string Reqd_flagTemporal = dtcare.Rows[0]["Reqd_flagTemporal"].ToString();
            if (Reqd_flagTemporal == "1")
            {
                Contador++;
            }
        }


        if (Contador > 0)
        {
            cleanMessage = "No se puede realizar esta operación, requerimiento atendido";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            Anular(pk);
        }
    }
    protected void filtros(string txtRequerimientosa_H, string txtPDC_H)
    {
        string Centro   = string.Empty;
        int    contarCC = Convert.ToInt32(ddlcentro.Items.Count.ToString());

        if (contarCC <= 1)
        {
            Centro = ddlcentro.SelectedValue.ToString();
        }
        else
        {
            if (ddlcentro.SelectedIndex == 0)
            {
                Centro = string.Empty;
            }
            else
            {
                Centro = ddlcentro.SelectedValue.ToString();
            }
        }


        string ESTADO = "0";

        if (ddlEstado.SelectedIndex == 0)
        {
            ESTADO = string.Empty;
        }
        else
        {
            ESTADO = ddlEstado.SelectedValue.ToString();
        }

        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        dtResultado = obj.USP_SEL_TBL_VALORIZACION_EQUIPO_MENOR_TODO(Centro, "", ESTADO, txtPDC_H, txtRequerimientosa_H);
        if (dtResultado.Rows.Count > 0)
        {
            lblCantidad.Text     = "Cantidad : " + dtResultado.Rows.Count.ToString();
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            lblCantidad.Text     = "Cantidad : " + dtResultado.Rows.Count.ToString();
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }


        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
示例#26
0
    protected void EnviarSAP(object sender, EventArgs e)
    {
        ImageButton btnSOLPED = ((ImageButton)sender);

        GridViewRow grdrow = (GridViewRow)((ImageButton)sender).NamingContainer;

        string Requ_Numero       = GridView1.DataKeys[grdrow.RowIndex].Values["Requ_Numero"].ToString();
        string Reqd_CodLinea     = GridView1.DataKeys[grdrow.RowIndex].Values["Reqd_CodLinea"].ToString();
        string Reqs_Correlativo  = GridView1.DataKeys[grdrow.RowIndex].Values["Reqs_Correlativo"].ToString();
        string CANTIDAD_LEGAJO   = GridView1.DataKeys[grdrow.RowIndex].Values["CANTIDAD_LEGAJO"].ToString();
        string D_FLG_APRUEBA_CGO = GridView1.DataKeys[grdrow.RowIndex].Values["D_FLG_APRUEBA_CGO"].ToString();


        string url = URLSSK;

        string ADJUNTO = string.IsNullOrEmpty(CANTIDAD_LEGAJO) ? "0" : CANTIDAD_LEGAJO;

        if (Convert.ToInt32(ADJUNTO) == 0)
        {
            string cleanMessage = "Falta agregar documentos";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }
        else
        {
            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();

            if (D_FLG_APRUEBA_CGO == "1")
            {
                //solicitar regularizacion

                string mensaje = "El Sistema de Equipos Menores SSK informa, se solicita la aprobación de esta lista de equipos por concepto de REGULARIZACIÓN para el proyecto ";
                obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_CORREO(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, mensaje, "ALQUILER REGULARIZACION", url);


                string cleanMessage = "Envio satisfactorio";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
            else
            {
                string mensaje = "El Sistema de Equipos Menores SSK informa, solicita la emisión SOLPED en SAP según la lista de equipos para el proyecto ";
                obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_CORREO(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo, mensaje, "ALQUILER CARE SOLPED", url);

                string cleanMessage = "Envio satisfactorio";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }



            filtros();
        }
    }
    protected void Listar(string requerimiento, string descripcion, string PDC)
    {
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        string proveedor = string.Empty;

        if (ddlProveedor.SelectedIndex == 0)
        {
            proveedor = string.Empty;
        }
        else
        {
            proveedor = ddlProveedor.SelectedValue.ToString();
        }

        string Centro   = string.Empty;
        int    contarCC = Convert.ToInt32(ddlcentro.Items.Count.ToString());

        if (contarCC <= 1)
        {
            Centro = ddlcentro.SelectedValue.ToString();
        }
        else
        {
            if (ddlcentro.SelectedIndex == 0)
            {
                Centro = string.Empty;
            }
            else
            {
                Centro = ddlcentro.SelectedValue.ToString();
            }
        }

        dtResultado = obj.USP_SEL_TBL_VALORIZACION_EQUIPO_MENOR_V2(Centro, proveedor, ddlanio.SelectedValue.ToString(), ddlMes.SelectedValue.ToString(), PDC, requerimiento);
        if (dtResultado.Rows.Count > 0)
        {
            lblCantidad.Text     = "Cantidad : " + dtResultado.Rows.Count.ToString();
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
            btnExportar.Visible = true;
        }
        else
        {
            btnExportar.Visible  = false;
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }

        ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
    }
示例#28
0
    protected void Listar()
    {
        Requ_Numero      = Request.QueryString["Requ_Numero"].ToString();
        Reqd_CodLinea    = Request.QueryString["Reqd_CodLinea"].ToString();
        Reqs_Correlativo = Request.QueryString["Reqs_Correlativo"].ToString();
        Reqs_Regularizar = Request.QueryString["Reqs_Regularizar"];
        BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
        DataTable dtResultado = new DataTable();

        int PENDIENTES = 0;

        dtResultado = obj.USP_SEL_TBL_REQUERIMIENTO_EQUIPO_MAYOR_REGULARIZACION(Requ_Numero, Reqd_CodLinea, Reqs_Correlativo);
        if (dtResultado.Rows.Count > 0)
        {
            PENDIENTES = Convert.ToInt32(dtResultado.Rows[0]["PENDIENTES"].ToString());
        }


        if (PENDIENTES == 0)
        {
            btn.Visible = false;
        }
        else
        {
            //btn.Visible = true;


            if (Reqs_Regularizar == "1")// respuestas
            {
                btn.Visible         = false;
                btnRespnder.Visible = true;
            }
            else
            {
                btn.Visible         = true;
                btnRespnder.Visible = false;
            }
        }


        if (dtResultado.Rows.Count > 0)
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSource = dtResultado;
            GridView1.DataBind();
        }
    }
    protected void btnReg_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage = string.Empty;
        int    intContador  = 0;


        foreach (GridViewRow Fila in GridView1.Rows)
        {
            CheckBox ChkBoxCell = ((CheckBox)Fila.FindControl("chkSelect"));
            if (ChkBoxCell.Checked == true)
            {
                intContador += 1;
            }
        }

        if (intContador == 0)
        {
            cleanMessage = "Debe seleccionar al menos un registro.";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }

        foreach (GridViewRow row in GridView1.Rows)
        {
            //TextBox txt;
            string   Reqs_ItemSecuencia = GridView1.DataKeys[row.RowIndex].Values["Reqs_ItemSecuencia"].ToString(); // extrae key
            CheckBox ChkBoxCell         = ((CheckBox)row.FindControl("chkSelect"));

            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();

            if (ChkBoxCell.Checked)
            {
                dtResultado = obj.USP_UPDATE_REGULARIZACION_EQUIPO_MENOR(Reqs_ItemSecuencia, "2");
            }
            else
            {
                dtResultado = obj.USP_UPDATE_REGULARIZACION_EQUIPO_MENOR(Reqs_ItemSecuencia, "1");
            }
            ChkBoxCell = null;
        }

        if (intContador > 0)
        {
            //Listar("", "", "", "", "", "", "");
            //ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
            cleanMessage = "Actualización satisfactoria";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }
    }
    protected void btnAsignar_Click(object sender, ImageClickEventArgs e)
    {
        string requerimientos     = string.Empty;
        string Reqs_ItemSecuencia = string.Empty;
        string cleanMessage       = string.Empty;
        int    intContador        = 0;


        foreach (GridViewRow Fila in GridView1.Rows)
        {
            CheckBox ChkBoxCell = ((CheckBox)Fila.FindControl("CheckAsignar"));
            if (ChkBoxCell.Checked == true)
            {
                intContador += 1;
            }
        }

        if (intContador == 0)
        {
            cleanMessage = "Debe seleccionar al menos un requerimiento.";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }

        foreach (GridViewRow row in GridView1.Rows)
        {
            //TextBox txt;
            Reqs_ItemSecuencia = GridView1.DataKeys[row.RowIndex].Values["Reqs_ItemSecuencia"].ToString(); // extrae key
            CheckBox ChkBoxCell = ((CheckBox)row.FindControl("CheckAsignar"));

            BL_TBL_RequerimientoSubDetalle obj = new BL_TBL_RequerimientoSubDetalle();
            DataTable dtResultado = new DataTable();

            if (ChkBoxCell.Checked)
            {
                requerimientos += Reqs_ItemSecuencia + ",";
            }

            ChkBoxCell = null;
        }

        if (intContador > 0)
        {
            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "popupAsignar('" + requerimientos + "'," + 500 + "," + 320 + ");", true);

            ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true);
        }
    }