public static string GetReturnUrl(string page, PathInfo path, LocationPathInfo locationPath, int reservationId, DateTime date) { string result = $"~/{page}"; string separator = "?"; if (reservationId > 0) { result += $"{separator}ReservationID={reservationId}"; separator = "&"; } if (!path.IsEmpty()) { result += $"{separator}Path={path.UrlEncode()}"; separator = "&"; } if (!locationPath.IsEmpty()) { result += $"{separator}LocationPath={locationPath.UrlEncode()}"; separator = "&"; } result += $"{separator}Date={date:yyyy-MM-dd}"; separator = "&"; return(result); }
public static string NavigateUrl(string url, PathInfo path, LocationPathInfo locationPath) { if (!path.IsEmpty()) { url += $"&Path={path.UrlEncode()}"; } if (!locationPath.IsEmpty()) { url += $"&LocationPath={locationPath.UrlEncode()}"; } return(url); }