public ActionResult AboutUs() { List <NewsUpdts> SelectAllNews = new Cateloge().SelectAllNewsForWeb(); WebAllClass Data = new WebAllClass(); if (SelectAllNews == null) { TempData["Message_Null_News"] = "No Any News Posted Yet !"; } else { Data.NewsAndUpdts_s = new List <NewsUpdt>(); foreach (var gdfc in SelectAllNews.Take(6)) { NewsUpdt dbr = new NewsUpdt(); dbr.Id = gdfc.db_Id; dbr.Name = gdfc.Name; dbr.Picture = gdfc.Picture; dbr.Detail = gdfc.Detail; dbr.Date = gdfc.Date; dbr.Month = gdfc.Month; dbr.Year = gdfc.Year; dbr.Time = gdfc.Time; Data.NewsAndUpdts_s.Add(dbr); } } List <Events> SelectAllEvents = new Cateloge().EventsForWeb(); if (SelectAllEvents == null) { TempData["Message_Null_Event"] = "No Any Event Posted Yet !"; } else { Data.Event_s = new List <Event>(); foreach (var gdfc in SelectAllEvents.Take(6)) { Event dbr = new Event(); dbr.Id = gdfc.db_Id; dbr.Name = gdfc.Name; dbr.Picture = gdfc.Picture; dbr.Detail = gdfc.Detail; dbr.Date = gdfc.Date; dbr.Month = gdfc.Month; dbr.Year = gdfc.Year; dbr.Time = gdfc.Time; Data.Event_s.Add(dbr); } } return(View(Data)); }
// // GET: /web/ public ActionResult Index() { List <NewsUpdts> SelectAllNews = new Cateloge().SelectAllNewsForWeb(); WebAllClass Data = new WebAllClass(); if (SelectAllNews == null) { TempData["Message_Null_News"] = "No Any News Posted Yet !"; } else { Data.NewsAndUpdts_s = new List <NewsUpdt>(); foreach (var gdfc in SelectAllNews.Take(1)) { NewsUpdt dbr = new NewsUpdt(); dbr.Id = gdfc.db_Id; dbr.Name = gdfc.Name; dbr.Picture = gdfc.Picture; dbr.Detail = gdfc.Detail; dbr.Date = gdfc.Date; dbr.Month = gdfc.Month; dbr.Year = gdfc.Year; dbr.Time = gdfc.Time; Data.NewsAndUpdts_s.Add(dbr); } } List <Stars> SelectAllStars = new Cateloge().StarsForWeb(); if (SelectAllStars == null) { TempData["Message_Null_Star"] = "No Any Star Posted Yet !"; } else { Data.Star_s = new List <Star>(); foreach (var gdfc in SelectAllStars) { Star dbr = new Star(); dbr.Id = gdfc.db_Id; dbr.Name = gdfc.Name; dbr.Picture = gdfc.Picture; dbr.Star_type = gdfc.Star_type; dbr.Achievement = gdfc.Achievement; Data.Star_s.Add(dbr); } } return(View(Data)); }