Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Int32.TryParse(Request.QueryString["page"], out pageNum))
        {
            pageNum = 1;
        }
        pageSize  = 10;
        pageCount = getPageCount(pageSize);
        if (!IsPostBack)
        {
            if (pageNum >= pageCount)
            {
                pageNum = pageCount;
            }
            ArticlesBind(pageNum, pageSize);


            using (var db = new CstwebEntities())
            {
                var lo = (from it in db.graduate
                          select it).ToList();
                RptGame.DataSource = lo;
                RptGame.DataBind();
            }
            effect();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Int16.TryParse(Request.QueryString["co"], out neid))
     {
         neid = 1;
     }
     if (neid <= 0 && neid > 2)
     {
         neid = 1;
     }
     if (!Int32.TryParse(Request.QueryString["page"], out pageNum))
     {
         pageNum = 1;
     }
     pageSize  = 10;
     pageCount = getPageCount(pageSize);
     if (!IsPostBack)
     {
         if (pageNum >= pageCount)
         {
             pageNum = pageCount;
         }
         ArticlesBind(pageNum, pageSize);
         using (var db = new CstwebEntities())
         {
             var lo = (from it in db.cooperation
                       where it.@class == neid
                       select it).ToList();
             RptGame.DataSource = lo;
             RptGame.DataBind();
         }
         effect();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Int32.TryParse(Request.QueryString["page"], out pageNum))
     {
         pageNum = 1;
     }
     pageSize  = 10;
     pageCount = getPageCount(pageSize);
     if (!IsPostBack)
     {
         if (pageNum >= pageCount)
         {
             pageNum = pageCount;
         }
         ArticlesBind(pageNum, pageSize);
         effect();
     }
     using (var db = new CstwebEntities())
     {
         var lo = (from it in db.games
                   orderby it.addtime descending
                   select it).ToList();
         List <games1> lo2 = new List <games1>();
         foreach (games ga in lo)
         {
             games1 ga1 = new games1();
             ga1.id       = ga.id;
             ga1.body     = ga.body;
             ga1.gamename = ga.gamename;
             ga1.status   = ga.status;
             if (ga.status == 1)
             {
                 ga1.gamestatus = @"<div class='comp-status comp-noting'>比赛尚未开始</div>";
             }
             else if (ga.status == 2)
             {
                 ga1.gamestatus = @"<div class='comp-status comp-ing'>比赛进行中</div>";
             }
             lo2.Add(ga1);
         }
         RptGame.DataSource = lo2;
         RptGame.DataBind();
     }
 }