protected string LinkForFlight(int idFlight) { return(String.Format(CultureInfo.InvariantCulture, "~/Member/FlightDetail.aspx/{0}{1}", idFlight, Restriction == null || Restriction.IsDefault ? string.Empty : "?fq=" + HttpUtility.UrlEncode(Restriction.ToBase64CompressedJSONString()))); }
protected string ReturnLink(FlightQuery fq) { if (fq == null) { throw new ArgumentNullException(nameof(fq)); } return(String.Format(CultureInfo.InvariantCulture, "~/Member/LogbookNew.aspx?fq={0}", HttpUtility.UrlEncode(fq.ToBase64CompressedJSONString()))); }
protected void AddDayCell(TableRow parent, DateTime dt, int value, string cssCell) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } TableCell tc = new TableCell() { CssClass = cssCell }; parent.Cells.Add(tc); tc.Controls.Add(new Label() { Text = dt.Day.ToString(CultureInfo.CurrentCulture), CssClass = "dayOfMonth" }); if (value == 0) { tc.Controls.Add(new Label() { Text = Resources.LocalizedText.NonBreakingSpace, CssClass = "dateContent" }); } else { FlightQuery fq = new FlightQuery(Page.User.Identity.Name) { DateRange = FlightQuery.DateRanges.Custom, DateMax = dt.Date, DateMin = dt.Date }; tc.Controls.Add(new HyperLink() { Text = value.ToString(CultureInfo.CurrentCulture), CssClass = "dateContent dateContentValue", NavigateUrl = String.Format(CultureInfo.InvariantCulture, "https://{0}{1}{2}", Branding.CurrentBrand.HostName, ResolveUrl("~/Member/LogbookNew.aspx?fq="), HttpUtility.UrlEncode(fq.ToBase64CompressedJSONString())) }); } }
protected void AddDayCell(TableRow parent, DateTime dt, int value, string cssCell) { TableCell tc = new TableCell(); parent.Cells.Add(tc); tc.CssClass = cssCell; Label l = new Label(); tc.Controls.Add(l); l.Text = dt.Day.ToString(CultureInfo.CurrentCulture); l.CssClass = "dayOfMonth"; if (value == 0) { l = new Label(); tc.Controls.Add(l); l.Text = Resources.LocalizedText.NonBreakingSpace; l.CssClass = "dateContent"; } else { HyperLink h = new HyperLink(); tc.Controls.Add(h); h.Text = value.ToString(CultureInfo.CurrentCulture); h.CssClass = "dateContent"; FlightQuery fq = new FlightQuery(Page.User.Identity.Name) { DateRange = FlightQuery.DateRanges.Custom, DateMax = dt.Date, DateMin = dt.Date }; h.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "https://{0}{1}{2}", Branding.CurrentBrand.HostName, ResolveUrl("~/Member/LogbookNew.aspx?fq="), HttpUtility.UrlEncode(fq.ToBase64CompressedJSONString())); h.Style["background-color"] = "#00EE00"; } }