Beispiel #1
0
        private void NotificacionEnviadas()
        {
            lfecha.Text = DateTime.Now.ToShortDateString();

            try
            {
                if (HttpContext.Current.Session["codpNotificacion"] != null && HttpContext.Current.Session["codcNotificacion"] != null)
                {
                    int codconvoctoria = Convert.ToInt32(HttpContext.Current.Session["codcNotificacion"].ToString());
                    int codproyecto    = Convert.ToInt32(HttpContext.Current.Session["codpNotificacion"].ToString());

                    consultas.Parameters = null;

                    consultas.Parameters = new[]
                    {
                        new SqlParameter
                        {
                            ParameterName = "@codproyecto",
                            Value         = codproyecto
                        }, new SqlParameter
                        {
                            ParameterName = "@codconvocatoria",
                            Value         = codconvoctoria
                        }
                    };

                    var notificaciones = consultas.ObtenerDataTable("MD_NotificacionEnviadas");

                    if (notificaciones.Rows.Count != 0)
                    {
                        HttpContext.Current.Session["DtNotificaciones"] = notificaciones;
                        GrvNotificaciones.DataSource = notificaciones;
                        GrvNotificaciones.DataBind();
                    }
                    else
                    {
                        GrvNotificaciones.DataSource = notificaciones;
                        GrvNotificaciones.DataBind();
                    }

                    consultas.Parameters = null;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
                consultas.Parameters = null;
            }
        }
Beispiel #2
0
 protected void GrvNotificaciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GrvNotificaciones.PageIndex  = e.NewPageIndex;
     GrvNotificaciones.DataSource = HttpContext.Current.Session["DtNotificaciones"];
     GrvNotificaciones.DataBind();
 }