Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                lbl_Titulo.Text = void_establecerTitulo("FORMALIZAR PROYECTO");

                codProyecto = Request.QueryString["codProyecto"] == null || String.IsNullOrEmpty(Request.QueryString["codProyecto"]) ? "0" : Request.QueryString["codProyecto"].ToString();

                insertarDatos();
                if (!Page.IsPostBack)
                {
                    if (usuario.CodGrupo != Constantes.CONST_Emprendedor)//Se valida si el usuario es emprendedor, en caso de no serlo se redirige al Home
                    {
                        Response.Redirect(validacionCuenta.rutaHome(), true);
                    }
                    else
                    {
                        if (proyectoController.codProyectoXEmprendedor(usuario.IdContacto) == Convert.ToInt32(codProyecto))//validar emprendedor x Proyecto
                        {
                            var query = from Conv in consultas.Db.Convocatoria
                                        where
                                        Conv.FechaInicio <= DateTime.Now &&
                                        Conv.FechaFin > DateTime.Now &&
                                        Conv.Publicado.Equals(true)
                                        select new
                            {
                                Id_convoct          = Conv.Id_Convocatoria,
                                Nombre_Convocatoria = Conv.NomConvocatoria,
                            };
                            System.Web.UI.WebControls.ListItem itemSelect = new System.Web.UI.WebControls.ListItem();
                            itemSelect.Value = "0";
                            itemSelect.Text  = "Seleccione...";
                            DropDownListConvoct.Items.Add(itemSelect);
                            foreach (var itemlist in query)
                            {
                                System.Web.UI.WebControls.ListItem itemConvocatoria = new System.Web.UI.WebControls.ListItem();
                                itemConvocatoria.Value = itemlist.Id_convoct.ToString();
                                itemConvocatoria.Text  = itemlist.Nombre_Convocatoria;
                                DropDownListConvoct.Items.Add(itemConvocatoria);
                            }
                            DropDownListConvoct.DataBind();
                        }
                        else
                        {
                            Response.Redirect(validacionCuenta.rutaHome(), true);
                        }
                    }
                }
            }
            catch (Exception)
            { }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Recuperar la url
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
                else
                {
                    CargarConvocatorias();

                    try
                    {
                        if (!String.IsNullOrEmpty(HttpContext.Current.Session["SelectedIndex"].ToString()))
                        {
                            DDL_Convocatoria.SelectedIndex = Int32.Parse(HttpContext.Current.Session["SelectedIndex"].ToString());
                            DDL_Convocatoria_SelectedIndexChanged(sender, e);
                            HttpContext.Current.Session["SelectedIndex"] = null;

                            llenarGrilla("");
                        }
                    }
                    catch (Exception) { }
                }
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Recuperar la url
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.Acreditador(usuario.IdContacto)) //Menu Master Page
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
                else
                {
                    string txtSQL = @"SELECT DISTINCT P.ID_PROYECTO, P.NOMPROYECTO,PC.FECHAINICIO 'FECHAASIGNACION', DATEDIFF(DD,PC.FECHAINICIO,GETDATE()) 'DIAS', MAX(PC.CODCONVOCATORIA) 'CODCONVOCATORIA' ,E.NOMESTADO 'ESTADO' FROM PROYECTO P JOIN PROYECTOCONTACTO PC ON (PC.INACTIVO=0 AND PC.CODPROYECTO=P.ID_PROYECTO AND P.CODESTADO IN (10,11,12,13,14,15,16)) JOIN ESTADO E ON (E.ID_ESTADO = P.CODESTADO) INNER JOIN (SELECT DISTINCT P.ID_PROYECTO, MAX(PC.CODCONVOCATORIA) 'CODCONVOCATORIA' FROM PROYECTO P JOIN PROYECTOCONTACTO PC ON (PC.INACTIVO=0 AND PC.CODPROYECTO=P.ID_PROYECTO AND P.CODESTADO IN (10,11,12,13,14,15,16)) JOIN ESTADO E ON (E.ID_ESTADO = P.CODESTADO)  WHERE PC.ACREDITADOR = 1 AND PC.CODCONVOCATORIA IS NOT NULL AND PC.CODCONTACTO = " + usuario.IdContacto +
                                    " GROUP BY P.ID_PROYECTO) t on (t.ID_PROYECTO=p.ID_PROYECTO and t.CODCONVOCATORIA=pc.CODCONVOCATORIA) WHERE PC.ACREDITADOR = 1 AND PC.CODCONVOCATORIA IS NOT NULL AND PC.CODCONTACTO = " + usuario.IdContacto +
                                    " GROUP BY P.ID_PROYECTO,P.NOMPROYECTO,PC.FECHAINICIO,E.NOMESTADO";

                    var result = consultas.ObtenerDataTable(txtSQL, "text");

                    if (result.Rows.Count > 0)
                    {
                        gvplanesaacreditar.DataSource = result;
                        gvplanesaacreditar.DataBind();
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //Recuperar la url
            string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

            if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
            {
                Response.Redirect(validacionCuenta.rutaHome(), true);
            }
            else
            {
                gvplanesnegocio.Attributes.CssStyle.Add("font-size", "9px");
                if (!IsPostBack)
                {
                    cargarDllOperador(usuario.CodOperador);
                    mostrarGrilla();
                    llenarGrilla();
                    GenerarFecha_Year();
                    CargarDropDown_Convocatorias();
                    DropDown_Fecha_Actual();
                }

                txtnummemorando.Attributes.Add("onkeypress", "javascript: return ValidNum(event);");
            }
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
         {
             Response.Redirect(validacionCuenta.rutaHome(), true);
         }
     }
 }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Recuperar la url
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id_TareaUsuarioRepeticion = HttpContext.Current.Session["Id_tareaRepeticion"] != null ? Id_TareaUsuarioRepeticion = Convert.ToInt32(HttpContext.Current.Session["Id_tareaRepeticion"].ToString()) : 0;

            if (!IsPostBack)
            {
                //Recuperar la url
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
                else
                {
                    DateTime?fechaActual = DateTime.Today;
                    DateTime fechamostar = DateTime.Today;
                    txtDate2.Text = fechamostar.ToString("dd/MM/yyyy");



                    if (Id_TareaUsuarioRepeticion != 0)
                    {
                        menuMostar();
                        tbl1.Visible    = false;
                        tbl1.Enabled    = false;
                        Panel2.Visible  = true;
                        Panel2.Enabled  = true;
                        lbl_Titulo.Text = "REVISAR TAREA";
                    }
                    else
                    {
                        CargarPlanesDeNegocio();
                        tbl1.Visible    = true;
                        tbl1.Enabled    = true;
                        Panel2.Visible  = false;
                        Panel2.Enabled  = false;
                        lbl_Titulo.Text = "AGENDAR TAREA";
                    }

                    cargarActividades();


                    if (usuario.CodGrupo == Constantes.CONST_AdministradorSistema || usuario.CodGrupo == Constantes.CONST_GerenteAdministrador)
                    {
                        labelPlan.Visible = false;
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //L_Fecha.Text = "" + DateTime.Now.Day + " Del Mes " + DateTime.Now.Month + " De " + DateTime.Now.Year;
            if (!IsPostBack)
            {
                ValidacionCuenta validacionCuenta = new ValidacionCuenta();

                //Recuperar la url
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(usuario.IdContacto, pathRuta))//Se valida si el usuario tiene permisos de acceso a la pagina, en caso de no serlo se redirige al Home
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
                else
                {
                    lbl_Titulo.Text = void_establecerTitulo("PROYECTOS A FORMALIZAR");
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string pathRuta = HttpContext.Current.Request.Url.AbsolutePath;

                if (!validacionCuenta.validarPermiso(Usuario.IdContacto, pathRuta))
                {
                    Response.Redirect(validacionCuenta.rutaHome(), true);
                }
                else
                {
                    //cargar Datos
                    cargarRecomendaciones();
                }
            }
        }