예제 #1
0
 //
 // GET: /News/
 public ActionResult Index(int page=1)
 {
     ViewBag.NaviCss.Current = TextileCity.Models.Navigation.News;
     int count = 0;
     if (page > 0)
     {
         NewsOperation nop = new NewsOperation();
         List<News> news = new List<News>();
         news = nop.GetMinList(page, out count);
         Pager pager =new Pager(page,count,NewsOperation.NewsListSize);
         ViewData["News"] = news;
         if (count > NewsOperation.NewsListSize)
         {
             if (page > 1)
             {
                 ViewData["Prev"] = page - 1;
             }
             if (page < pager.Count)
             {
                 ViewData["Next"] = page + 1;
             }
         }
     }
     return View();
 }
예제 #2
0
        public ActionResult Details(int id)
        {
            News dataModel = new NewsOperation().GetModel(id);
            if (dataModel != null)
            {
                ViewData["DataModel"] = dataModel;
            }

            return PartialView();
        }