Пример #1
0
 protected void ObtenerProyectosByExperiencia(int t808_idexpprof)
 {
     try
     {
         strTablaHTML = EXPPROFPROYECTO.ObtenerProyectosByExperiencia(t808_idexpprof);
     }
     catch (Exception ex)
     {
         sErrores = Errores.mostrarError("Error al obtener la relación de validadores de la experiencia.", ex);
     }
 }
    /// <summary>
    ///
    /// </summary>
    /// <param name="o">Origen: F-> experiencia no asociada a proyecto relativa a fuera de Ibermática
    ///                         D-> experiencia no asociada a proyecto relativa a Ibermática
    /// </param>
    /// <param name="ep">Código de experiencia profesional (para entrar a registros ya existentes)</param>
    /// <param name="m">Modo de acceso R-> lectura, eoc-> escritura</param>
    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; }
                }

                bool bLectura = true;

                this.hdnUserAct.Value = Session["IDFICEPI_CVT_ACTUAL"].ToString();
                if (Request.QueryString["iE"] != null)
                {    //Código de experiencia profesional
                    this.hdnEP.Value = SUPER.Capa_Negocio.Utilidades.decodpar(Request.QueryString["iE"].ToString());
                }
                else
                {
                    if (Request.Form["iE"] != null)
                    {
                        this.hdnEP.Value = SUPER.Capa_Negocio.Utilidades.decodpar(Request.Form["iE"].ToString());
                    }
                }
                if (Request.QueryString["iF"] != null)
                {    //Código del profesional
                    this.hdnProf.Value = SUPER.Capa_Negocio.Utilidades.decodpar(Request.QueryString["iF"].ToString());
                }
                if (Request.QueryString["iEF"] != null)
                {    //Código de experiencia ficepi
                    this.hdnidExpFicepi.Value = SUPER.Capa_Negocio.Utilidades.decodpar(Request.QueryString["iEF"].ToString());
                    if (this.hdnidExpFicepi.Value == "null")
                    {
                        hdnidExpFicepi.Value = "0";
                    }
                }

                if (this.hdnProf.Value == "-1")
                {
                    throw (new Exception("Es necesario indicar el profesional de la experiencia"));
                }

                //Compruebo si estoy en mi propio curriculum
                //if (this.hdnProf.Value == this.hdnUserAct.Value)
                if (this.hdnProf.Value == Session["IDFICEPI_CVT_ACTUAL"].ToString())
                {
                    this.hdnEsMiCV.Value = "S";
                }

                //Encargado de CVs
                //if (Request.QueryString["eA"] != null)
                //{
                //    if (Request.QueryString["eA"].ToString()=="1")
                //        this.hdnEsEncargado.Value = "S";
                //}
                if (User.IsInRole("ECV"))
                {
                    this.hdnEsEncargado.Value = "S";
                }
                //Estado
                if (this.hdnEP.Value == "-1")
                {
                    this.hdnModo.Value = "W";
                }
                else
                {
                    if (Request.QueryString["e"] != null)
                    {    //Modo de acceso (lectura o escritura)
                        switch (Request.QueryString["e"].ToString())
                        {
                        case "R":
                            this.hdnModo.Value = "R";
                            break;

                        case "V":
                        case "O":
                        case "P":
                        case "S":
                        case "T":
                        case "B":
                        case "X":
                        case "Y":
                            this.hdnModo.Value = "W";
                            break;
                        }
                    }
                }
                if (Request.QueryString["pr"] != null && Utilidades.decodpar(Request.QueryString["pr"]) != "-1" && this.hdnEP.Value != "-1")
                {
                    this.hdnModo.Value = "R";
                }
                if (this.hdnModo.Value == "R")
                {
                    SUPER.Capa_Negocio.ModoLectura.Poner(this.Controls);
                    this.imgGomaCliente.Style.Add("visibility", "hidden");
                    this.txtDen.Enabled = false;
                    //this.txtDes.Enabled = false;
                    this.txtDes.Attributes.Add("ReadOnly", "true");
                    this.txtDes.Style.Add("color", "gray");
                    this.txtCliente.Enabled   = false;
                    this.txtValidador.Enabled = false;
                }
                else
                {
                    bLectura = false;
                }

                //Recojo el nombre del profesional (por si hay que hacer una petición de borrado)

                if (Request.QueryString["n"] != null)
                {
                    this.hdnNomProf.Value = Utilidades.decodpar(Request.QueryString["n"]);
                }
                GetConTec(int.Parse(this.hdnEP.Value), bLectura);
                GetConSec(int.Parse(this.hdnEP.Value), bLectura);
                GetPerfiles(int.Parse(this.hdnProf.Value), int.Parse(this.hdnEP.Value));
                if (this.hdnEP.Value != "" && this.hdnEP.Value != "-1")
                {    //Entramos en una Experiencia Profesional ya existente
                    GetDatos(int.Parse(this.hdnEP.Value), int.Parse(this.hdnProf.Value));
                }
                else
                {
                    SetValidador(int.Parse(this.hdnProf.Value));
                }

                //Si se trata de una experiencia profesional de proyecto, se muestra el icono para acceder a
                //la relación de proyectos asociados a la misma.

                if (this.hdnEP.Value != "-1" && EXPPROFPROYECTO.CountProyectosByExperiencia(int.Parse(this.hdnEP.Value)) > 0)
                {
                    this.imgInfoExpProy.Visible = true;
                }

                if (User.IsInRole("DIS") || ConfigurationManager.AppSettings["MOSTRAR_SOLODIS"] == "0")
                {
                    sTareasPendientes = Curriculum.MiCVTareasPendientes(1, int.Parse(this.hdnProf.Value), int.Parse(this.hdnidExpFicepi.Value), int.Parse(this.hdnEP.Value));
                }
            }
            catch (Exception ex)
            {
                sErrores += SUPER.Capa_Negocio.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);
        }
    }