Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["IDRED"] == null)
                    {
                        try
                        {
                            Response.Redirect("~/SesionCaducadaModal.aspx", true);
                        }
                        catch (System.Threading.ThreadAbortException) { return; }
                    }

                    sNodo = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                    if (Request.QueryString["psn"] != null)
                    {
                        this.hdnPSN.Value = Request.QueryString["psn"].ToString();
                        bool bLectura = false;

                        this.hdnEstadoPSN.Value = PROYECTOSUBNODO.getEstado(null, int.Parse(this.hdnPSN.Value));
                        if (this.hdnEstadoPSN.Value == "C" || this.hdnEstadoPSN.Value == "H")
                        {
                            //ModoLectura.Poner(this.Controls);
                            bLectura = true;
                        }
                        GetProfesionales(int.Parse(this.hdnPSN.Value), bLectura);
                    }
                }
                catch (Exception ex)
                {
                    sErrores += Errores.mostrarError("Error al obtener los datos", 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);
        }
    }
Ejemplo n.º 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; }
            }

            //if (!(bool)Session["FORANEOS"])
            //{
            //    this.imgForaneo.Visible = false;
            //    this.lblForaneo.Visible = false;
            //}
            sNodo               = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
            nIdAsunto           = int.Parse(Utilidades.decodpar(Request.QueryString["as"].ToString())); //nIdAsunto
            this.hdnAcceso.Text = Utilidades.decodpar(Request.QueryString["p"].ToString());             //Permiso
            nIdPE               = int.Parse(quitaPuntos(Utilidades.decodpar(Request.QueryString["nPE"].ToString())));
            string sPSN = Utilidades.decodpar(Request.QueryString["ps"].ToString());                    //sIdT305
            this.hdnT305IdProy.Value = quitaPuntos(sPSN);
            this.hdnDesPE.Text       = Utilidades.decodpar(Request.QueryString["desPE"].ToString());
            this.hdnNodo.Value       = PROYECTOSUBNODO.GetNodo(tr, int.Parse(sPSN)).ToString();
            try
            {
                Utilidades.SetEventosFecha(this.txtValNotif);
                Utilidades.SetEventosFecha(this.txtValLim);
                Utilidades.SetEventosFecha(this.txtValFin);

                ObtenerDatosAsunto();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos del asunto", ex);
            }
            try
            {
                //Datos de las personas asignadas al asunto
                string   strTabla  = ObtenerRecursos(nIdAsunto.ToString(), this.hdnNodo.Value);
                string[] aRecursos = Regex.Split(strTabla, "@#@");
                if (aRecursos[0] == "OK")
                {
                    divR.InnerHtml = aRecursos[1];
                }

                //Datos del historial del asunto
                strTabla = ObtenerHistorial(nIdAsunto.ToString());
                string[] aTareas = Regex.Split(strTabla, "@#@");
                if (aTareas[0] == "OK")
                {
                    divH.InnerHtml = aTareas[1];
                }

                //Datos de los documentos asociados a la acción
                //strTabla = ObtenerDocumentos(nIdAsunto.ToString());
                //string[] aTabla = Regex.Split(strTabla, "@#@");
                //if (aTabla[0] == "OK") divDoc.InnerHtml = aTabla[1];
                string sEstado = PROYECTOSUBNODO.getEstado(null, int.Parse(this.hdnT305IdProy.Value));
                divDoc.InnerHtml = Utilidades.ObtenerDocumentos("AS_PE", nIdAsunto, this.hdnAcceso.Text, sEstado);
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener datos complementarios", ex);
            }

            this.hdnAcceso.Text = Utilidades.decodpar(Request.QueryString["p"].ToString());//Permiso
            if (this.hdnAcceso.Text == "R")
            {
                ModoLectura.Poner(this.Controls);
                sLectura = "true";
            }
            //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);
        }
    }