public void GetGames(HttpContext context) { List <Games> list = new List <Games>(); list = gm.GetAll(); string JsonStr = Json.ListToJson(list); context.Response.Write(JsonStr); }
public ActionResult Index() { List <Games> Hotlist = new List <Games>(); Hotlist = gm.GetAll(3, "is_hot"); ViewData["HotGame"] = hh.TjGameHtml(Hotlist); List <Games> list = new List <Games>(); list = gm.GetAll("where is_lock=1 order by sort_id"); ViewData["AllGame"] = hh.GameHtml2(list); return(View()); }
public ActionResult Index() { List <News> GGlist = new List <News>(); GGlist = nm.GetNews(7, 2); ViewData["NewsGG"] = hh.IndexNewsHtml(GGlist); List <News> HDlist = new List <News>(); HDlist = nm.GetNews(7, 4); ViewData["NewsHD"] = hh.IndexNewsHtml(HDlist); string IndexPic = ""; string[] pic = new string[5]; string filePath = Utils.GetXmlMapPath("Picpath"); XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlNode xn = doc.SelectSingleNode("models"); int i = 0; foreach (XmlElement xe in xn.ChildNodes) { if (xe.NodeType != XmlNodeType.Comment && xe.Name.ToLower() == "model") { pic[i] = xe.Attributes["name"].Value + "|" + xe.Attributes["url"].Value + "|" + xe.Attributes["url1"].Value + "|" + xe.Attributes["link"].Value; i++; } } foreach (string item in pic) { IndexPic += "<li><a href=\"http://" + item.Split('|')[3] + "\" target=\"_blank\"> <img title=\"\" src=\"" + item.Split('|')[1] + "\" width=\"505px\" height=\"212px\"></a></li>"; } ViewData["IndexPic"] = IndexPic; List <Games> Hotlist = new List <Games>(); Hotlist = gm.GetAll(3, "is_hot"); ViewData["HotGame"] = hh.HotGameHtml(Hotlist); List <Games> Tjlist = new List <Games>(); Tjlist = gm.GetAll(6, "is_red"); ViewData["TjGame"] = hh.GameHtml2(Tjlist); ViewData["YqLink"] = hh.YqLinkHtml("All"); return(View()); }
public string AllGameHtml() { List <Games> list = new List <Games>(); list = gm.GetAll(); string HtmlStr = ""; foreach (Games g in list) { HtmlStr += "<option value=\"" + g.Id + "\">" + g.Name + "</option>"; } return(HtmlStr); }
public ActionResult SpreadGame() { ViewData["UserCenterOn"] = "current"; ViewData["GameOn"] = "chosen"; int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); if (gu.IsSpreader > 0) { ViewData["Photo"] = gu.Photo; ViewData["SpreadCount"] = om.GetAllSpreadCount(UserId); ViewData["UserName"] = gu.UserName; if (gu.IsSpreader != 2) { ViewData["Style"] = "display:none"; } List <Games> list = new List <Games>(); list = gm.GetAll("where is_lock=1 order by sort_id "); ViewData["Action"] = DESEncrypt.Encrypt(UserId + "|" + list[list.Count - 1].Id); ViewData["GameName"] = list[list.Count - 1].Name; string HtmlGame = ""; foreach (Games g in list) { string Action = DESEncrypt.Encrypt(UserId + "|" + g.Id); HtmlGame += "<li style=\"width: 210px;\"><a onclick=\"GetSpreadText('" + g.Name + "','" + Action + "')\"><img src=\"" + g.GameListImg + "\" width=\"200px\" height=\"110px\"></a><label for=\"male\">" + g.Name + "</label></li>"; } ViewData["HtmlGame"] = HtmlGame; } else { return(RedirectToAction("Login", "SpreadCenter")); } } else { return(RedirectToAction("Login", "SpreadCenter")); } return(View()); }