示例#1
0
    private void ObtenerDatosHito()
    {
        try
        {
            HITOPSP o = HITOPSP.Obtener(sTipoHito, nIdHito);

            txtIdHito.Text      = o.idhito.ToString();
            txtDesHito.Text     = o.deshito;
            txtDescripcion.Text = o.deshitolong;
            cboModo.Text        = o.modo;
            cboEstado.Text      = o.estado.ToString();
            txtAgrHito.Text     = flAgregacion(sTipoHito, o.margen);
            hdnOrden.Text       = o.orden.ToString();
            if (o.hitoPE)
            {
                chkPE.Checked = true;
                cboModo.Text  = "0";
            }
            else
            {
                chkPE.Checked = false;
            }
            //if (o.hitoPE) cboModo.Text = "3";
            //else cboModo.Text = o.modo;

            if (o.alerta)
            {
                chkAlerta.Checked = true;
            }
            if (o.ciclico)
            {
                chkCiclico.Checked = true;
            }
            if (sTipoHito == "HF")
            {
                if (o.fecha.Year > 1900)
                {
                    txtValFecha.Text = o.fecha.ToShortDateString();
                }
            }
            else
            {
                txtValFecha.Text = "";
            }
            //o.cod_une = nIdCR;
            o.num_proyecto = nIdPE;
            //Estado del proyecto económico
            this.hdnEstProy.Value = o.t301_estado;
            //Modo de acceso
            this.hdnModoAcceso.Value = PROYECTOSUBNODO.getAcceso(null, o.t305_idproyectosubnodo, int.Parse(Session["UsuarioActual"].ToString()));
        }
        catch (Exception ex)
        {
            sErrores += Errores.mostrarError("Error al obtener los datos del hito", ex);
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }

            sErrores = "";
            sLectura = "false";
            string sEstado = Request.QueryString["Est"].ToString();
            this.hdnEstProy.Value = sEstado;
            nPSN = int.Parse(Request.QueryString["nPSN"].ToString());
            this.hdnIdProyectoSubNodo.Value = nPSN.ToString();
            try
            {
                ////18/10/2016 Por petición de Yolanda los proyectos cerrados no permiten añadir documentos
                //if (sEstado == "C" || sEstado == "H")
                //    this.hdnModoAcceso.Value = "R";
                //else
                this.hdnModoAcceso.Value = PROYECTOSUBNODO.getAcceso(null, nPSN, int.Parse(Session["UsuarioActual"].ToString()));

                div1.InnerHtml = Utilidades.ObtenerDocumentos("PSN", nPSN, this.hdnModoAcceso.Value, sEstado);

                string   strTabla2 = ObtenerListaDocumentos(nPSN, int.Parse(Session["UsuarioActual"].ToString()));
                string[] aTabla2   = Regex.Split(strTabla2, "@#@");
                if (aTabla2[0] == "OK")
                {
                    div2.InnerHtml = aTabla2[1];
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener datos complementarios", ex);
            }
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }

            if (!Page.IsPostBack)
            {
                try
                {
                    strTablaHtmlAsunto = "<table id='tblDatos1'></table>";
                    strTablaHtmlAccion = "<table id='tblDatos2'></table>";
                    strTablaHtmlPTs    = "<table id='tblPTs'></table>";

                    if (Request.QueryString["sOrigen"] != null)
                    {
                        sOrigen = Utilidades.decodpar(Request.QueryString["sOrigen"].ToString());
                    }
                    if (Request.QueryString["sAccesoBitacoraPE"] != null)
                    {
                        sAccesoBitacoraPE = Utilidades.decodpar(Request.QueryString["sAccesoBitacoraPE"].ToString());
                    }

                    if (Request.QueryString["sT305IdProy"] != null)
                    {
                        this.hdnOrigen.Value = "T";
                        nPSN = int.Parse(Utilidades.decodpar(Request.QueryString["sT305IdProy"].ToString()));
                        this.hdnT305IdProy.Value = nPSN.ToString();
                        this.txtEstado.Text      = Utilidades.decodpar(Request.QueryString["sEstado"].ToString());
                        this.txtCodProy.Text     = Utilidades.decodpar(Request.QueryString["sCodProy"].ToString());
                        this.txtNomProy.Text     = Utilidades.decodpar(Request.QueryString["sNomProy"].ToString());
                    }
                    else
                    {
                        if (Session["ID_PROYECTOSUBNODO"].ToString() != "")
                        {
                            nPSN = int.Parse(Session["ID_PROYECTOSUBNODO"].ToString());
                            this.hdnT305IdProy.Value = nPSN.ToString();
                            this.hdnAcceso.Value     = PROYECTOSUBNODO.getAcceso(null, nPSN, (int)Session["UsuarioActual"]);
                            SqlDataReader dr = PROYECTO.fgGetDatosProy(nPSN);
                            if (dr.Read())
                            {
                                sAccesoBitacoraPE = dr["t305_accesobitacora_pst"].ToString();
                                if (sAccesoBitacoraPE != "X")
                                {
                                    this.txtEstado.Text  = dr["t301_estado"].ToString();
                                    this.txtNomProy.Text = dr["t301_denominacion"].ToString();
                                    this.txtCodProy.Text = int.Parse(dr["t301_idproyecto"].ToString()).ToString("#,###");
                                    if (this.hdnAcceso.Value == "R")
                                    {
                                        sAccesoBitacoraPE = "L";
                                    }
                                    else
                                    {
                                        if (this.txtEstado.Text == "C" || this.txtEstado.Text == "H")
                                        {
                                            sAccesoBitacoraPE = "L";
                                        }
                                    }
                                }
                            }
                            dr.Close();
                            dr.Dispose();
                        }
                    }
                    if (nPSN > -1 && sAccesoBitacoraPE != "X")
                    {
                        switch (this.txtEstado.Text)
                        {
                        case "A":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyAbierto.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto abierto");
                            break;

                        case "C":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyCerrado.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto cerrado");
                            break;

                        case "P":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyPresup.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto presupuestado");
                            break;

                        case "H":
                            imgEstProy.ImageUrl = "~/images/imgIconoProyHistorico.gif";
                            imgEstProy.Attributes.Add("title", "Proyecto histórico");
                            break;
                        }
                        ObtenerDatosAsunto(nPSN);
                        ObtenerPTs(nPSN.ToString());
                        LimpiarDatosAccion();
                    }
                    //Relleno el combo de tipo de asunto
                    this.cboTipo.DataValueField = "t384_idtipo";
                    this.cboTipo.DataTextField  = "t384_destipo";
                    this.cboTipo.DataSource     = TIPOASUNTO.Catalogo("", null, null, 3, 0);
                    this.cboTipo.DataBind();
                }
                catch (Exception ex)
                {
                    sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }