Пример #1
0
 public ActionResult random()
 {
     Article article = new Article();
     int id = article.GetRandom();
     // return RedirectPermanent("/story/number/" + id.ToString());
     return View(article);
 }
Пример #2
0
 public void Load ()
 {
     DataTable table = sql.Select("SELECT * FROM story ORDER BY id DESC LIMIT 40");
     articles = new Article[table.Rows.Count];
     for (int j = 0; j < table.Rows.Count; j++)
         articles[j] = new Article(table.Rows[j]);
 }
Пример #3
0
        public ActionResult number()
        {
            string id;
            if (RouteData.Values["id"] == null)
                id = "1";
            else
                id = (string)RouteData.Values["id"];

            Article article = new Article();
            article.GetArticle(id);
            return View(article);
        }