protected void Page_Load(object sender, EventArgs e) { string match_id = Request.QueryString[0]; // === M A T C H === Matches match = new Matches(); string[] matchInfo = match.getMatchInfo(match_id); // == MATCHINFO ARRAY : == //0 = NAME //1 = CITY //2 = DATE //3 = TYPE //4 = FIELD // === /M A T C H // === C O U R T === Courts court = new Courts(); string[] courtInfo = court.getCourtInfo(Int32.Parse(matchInfo[3])); List <String> courtImgs = court.getCourtImages(Int32.Parse(matchInfo[3])); string url = "https://www.google.com/maps/embed/v1/place?key=AIzaSyDT-7W1RK56peUVp3CRTKxuQ5pyoifLnH8&q=" + courtInfo[3] + "," + courtInfo[4] + "&zoom=12"; string iframeUrl = "<iframe width=\"210\" height=\"160\" src=\"" + url + "\" frameborder=\"0\" style=\"border: 0\" > </iframe>"; // == COURTINFO ARRAY : == //0 = NAME //1 = CITY //2 = LIMIT //3 = LAT //4 = LNG // === /C O U R T === // === FILLING DATA ==== // Match related info Mname.InnerText = matchInfo[0]; Mcity.InnerText = courtInfo[1]; Mdatetime.InnerText = matchInfo[1]; // Court related info fillSrc(courtImgs); Cname.InnerText = courtInfo[0]; Clocation.InnerHtml = iframeUrl; //viewMatch.Attributes["href"] = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/" + "MatchRoom?match_id=" + match_id; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["courtId"] == null) { Response.Redirect("/Default.aspx"); } int court_id = Int32.Parse(Request.QueryString["courtId"]); string len = Request.QueryString["length"]; string courtLocationUrl = "https://maps.google.com/?q="; Courts court = new Courts(); string[] courtInfo = court.getCourtInfo(court_id); List <String> courtImgs = court.getCourtImages(court_id); // == COURTINFO ARRAY : == //0 = NAME //1 = CITY //2 = LIMIT //3 = LAT //4 = LNG string name = courtInfo[0]; string city = courtInfo[1]; string limit = courtInfo[2]; string lat = courtInfo[3]; string lng = courtInfo[4]; courtLocationUrl += lat + "," + lng + "&ll=" + lat + "," + lng + "&z=15"; courtMap.Attributes["href"] = courtLocationUrl; courtName.InnerText = name; courtCity.InnerText = "Field city: " + city; courtLimit.InnerText = "Field limit: " + limit; int imgsCounter = 0; if (courtImgs != null) { for (int i = 0; i < courtImgs.Count(); i++) { string src = courtImgs[i].Replace(@"\", "/"); imgsCounter++; switch (i) { case 0: img0.Attributes["src"] = src; break; case 1: img1.Attributes["src"] = src; break; case 2: img2.Attributes["src"] = src; break; case 3: img3.Attributes["src"] = src; break; case 4: img4.Attributes["src"] = src; break; } } if (courtImgs.Count() < 5) { for (int i = 4; i >= imgsCounter; i--) { switch (i) { case 4: imgblock4.Visible = false; break; case 3: imgblock3.Visible = false; break; case 2: imgblock2.Visible = false; break; case 1: imgblock1.Visible = false; break; case 0: imgblock0.Visible = false; break; } } } } else { for (int i = 0; i < 5; i++) { switch (i) { case 4: imgblock4.Visible = false; break; case 3: imgblock3.Visible = false; break; case 2: imgblock2.Visible = false; break; case 1: imgblock1.Visible = false; break; case 0: imgblock0.Visible = false; break; } } } if (courtImgs == null) { notFound.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null || Session["userid"] == null) { Response.Redirect("~/Login.aspx"); } else//Session is available { // Get user ID from session, match ID from URL query string user_id = Session["userid"].ToString(); match_id = Request.QueryString.Get(0); } Matches match = new Matches(); string[] MatchInfo = match.getMatchInfo(match_id); Courts court = new Courts(); string[] courtInfo = court.getCourtInfo(Int32.Parse(MatchInfo[3])); type = MatchInfo[2]; if (type == "Private" && isCaptain(user_id, match_id))// if private and captain { pvt.Visible = true; } if (type == "Public" && isCaptain(user_id, match_id))// if private and captain { pvt1.Visible = true; } if (type == "Public") { status.Visible = true; status.InnerText = "public."; status.Attributes["class"] = "subtitle-pub"; } if (type == "Private") { status.Visible = true; status.InnerText = "private."; status.Attributes["class"] = "subtitle-pvt"; } List <String> courtImgs = court.getCourtImages(Int32.Parse(MatchInfo[3])); string courtLocationUrl = "https://maps.google.com/?q="; string lat = courtInfo[3]; string lng = courtInfo[4]; courtLocationUrl += lat + "," + lng + "&ll=" + lat + "," + lng + "&z=15"; // == Filling data: == if (!IsPostBack) { checkIfFull(); checkIfJoined(user_id, match_id); fillDefaultSlots(Int32.Parse(MatchInfo[3])); fillSlotsTeam1(match_id); fillSlotsTeam2(match_id); fillCourtImages(courtImgs); } matchName.InnerText = MatchInfo[0]; matchDate.InnerText = MatchInfo[1]; courtName.InnerText = courtInfo[0]; matchCity.InnerText = courtInfo[1]; courtLocation.HRef = courtLocationUrl; }