public static string get_NavigatePath(int iCategroryId, string postLink) { UrlQuery postURL = new UrlQuery(postLink); postURL.Remove("contentid"); postURL.Remove("mnuid"); postURL.Remove("catid"); string sNaviPath = ""; string sRootNaviFormat = "<span class='icon-11-arr-target navigator-text'><a href='{0}'>{1}</a></span>"; string sChildNaviFormat = "<span class='icon-11-arr-navigate navigator-text'><a href='{0}'>{1}</a></span>"; DataTable CatInfo = LegoWebSite.Buslgic.Categories.get_CATEGORY_BY_ID(iCategroryId).Tables[0]; int icatid = iCategroryId; string scatname = CatInfo.Rows[0]["CATEGORY_" + System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToUpper() + "_TITLE"].ToString(); int ipcatid = int.Parse(CatInfo.Rows[0]["PARENT_CATEGORY_ID"].ToString()); postURL.Set("catid", icatid.ToString()); sNaviPath = (ipcatid > 0 ? string.Format(sChildNaviFormat, postURL.AbsoluteUri, scatname) : string.Format(sRootNaviFormat, postURL.AbsoluteUri, scatname)); while (ipcatid > 0) { iCategroryId = ipcatid; CatInfo = LegoWebSite.Buslgic.Categories.get_CATEGORY_BY_ID(iCategroryId).Tables[0]; icatid = iCategroryId; scatname = CatInfo.Rows[0]["CATEGORY_" + System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToUpper() + "_TITLE"].ToString(); ipcatid = int.Parse(CatInfo.Rows[0]["PARENT_CATEGORY_ID"].ToString()); postURL.Set("catid", icatid.ToString()); sNaviPath = (ipcatid > 0 ? string.Format(sChildNaviFormat, postURL.AbsoluteUri, scatname) : string.Format(sRootNaviFormat, postURL.AbsoluteUri, scatname)) + sNaviPath; } return(sNaviPath); }
public static string Dates(string tag = "") { UrlQuery query = new UrlQuery(Url.For(Constant.POST_DATE)); query.Add("tag", tag); return(query.ToString()); }
protected void vi_Click(object sender, EventArgs e) { UrlQuery myURL = new UrlQuery(Request.Url.AbsoluteUri); myURL.Set("locale", "vi-VN"); Response.Redirect(myURL.AbsoluteUri); }
public IActionResult Get(UrlQuery urlQuery) { IEnumerable <Product> listQuery = _context.Products.Include(spec => spec.Specification); if (urlQuery.HaveFilter) { if (!string.IsNullOrEmpty(urlQuery.Genres)) { listQuery = listQuery.Where(q => q.Specification.Genres.Select(s => s.ToUpperInvariant()).ToList().Contains(urlQuery.Genres.ToUpperInvariant())); } if (!string.IsNullOrEmpty(urlQuery.Illustrator)) { listQuery = listQuery.Where(q => q.Specification.Illustrator.Select(s => s.ToUpperInvariant()).Contains(urlQuery.Illustrator.ToUpperInvariant())); } if (!string.IsNullOrEmpty(urlQuery.Author)) { listQuery = listQuery.Where(q => q.Specification.Author.ToUpperInvariant().Equals(urlQuery.Author.ToUpperInvariant())); } if (!string.IsNullOrEmpty(urlQuery.Published)) { listQuery = listQuery.Where(q => q.Specification.Published == Convert.ToDateTime(urlQuery.Published)); } } if (urlQuery.SortPriceType == "asc") { listQuery = listQuery.OrderBy(x => x.Price); } else if (urlQuery.SortPriceType == "desc") { listQuery = listQuery.OrderByDescending(x => x.Price); } return(new OkObjectResult(listQuery)); }
public static string Suggest(string url) { UrlQuery query = new UrlQuery(Url.For(Constant.POST_SUGGEST)); query.Add("url", url); return(query.ToString()); }
public static string Delete(string name) { UrlQuery query = new UrlQuery(Url.For(Constant.TAG_DELETE)); query.Add("tag", name); return(query.ToString()); }
protected void uxSearchButton_Click(object sender, EventArgs e) { UrlQuery urlQuery = new UrlQuery(); if (ParseSearchType(FieldTypes[uxHiddenFilterSearch.Value]) != SearchFilter.SearchFilterType.ValueRange) { PopulateValueFilter( SearchFilter.SearchFilterType.Text, uxHiddenFilterSearch.Value, uxHiddenValueSearch.Value, e); urlQuery.AddQuery("Type", _searchFilterObj.FilterType.ToString()); urlQuery.AddQuery("FieldName", _searchFilterObj.FieldName); urlQuery.AddQuery("Value1", _searchFilterObj.Value1); } else { PopulateValueRangeFilter( SearchFilter.SearchFilterType.ValueRange, uxHiddenFilterSearch.Value, uxHiddenValueSearch.Value, uxHiddenValueSearch.Value, e); urlQuery.AddQuery("Type", _searchFilterObj.FilterType.ToString()); urlQuery.AddQuery("FieldName", _searchFilterObj.FieldName); urlQuery.AddQuery("Value1", _searchFilterObj.Value1); urlQuery.AddQuery("Value2", _searchFilterObj.Value2); } MainContext.RedirectMainControl(ResultPage, urlQuery.RawQueryString); }
public static string Rename(string oldName, string newName) { UrlQuery query = new UrlQuery(Url.For(Constant.TAG_RENAME)); query.Add("old", oldName); query.Add("new", newName); return query.ToString(); }
public static string All(string name = "") { UrlQuery query = new UrlQuery(Url.For(Constant.BUNDLE_ALL)); query.Add("name", name); return(query.ToString()); }
public void GetIdParameter() { UrlQuery query = new UrlQuery("http://localhost/default.aspx?id=1"); Assert.AreEqual(1, query.QueryString.Count); Assert.AreEqual(1, Convert.ToInt32(query["id"])); }
public void CreateEmptyQuery() { UrlQuery query = new UrlQuery("http://localhost/default.aspx"); Assert.AreNotEqual(null, query); Assert.AreEqual("http://localhost/default.aspx", query.Url); }
protected void uxViewAllCustomer_Click(object sender, EventArgs e) { UrlQuery urlQuery = new UrlQuery(); urlQuery.AddQuery("Sort", "CustomerID DESC"); MainContext.RedirectMainControl("CustomerList.ascx", urlQuery.RawQueryString); }
public void RemoveParameter() { UrlQuery query = new UrlQuery("http://localhost/default.aspx?id=1"); Assert.AreEqual(1, query.QueryString.Count); query["id"] = null; Assert.AreEqual(null, query["id"]); Assert.AreEqual(0, query.QueryString.Count); }
public static string Rename(string oldName, string newName) { UrlQuery query = new UrlQuery(Url.For(Constant.TAG_RENAME)); query.Add("old", oldName); query.Add("new", newName); return(query.ToString()); }
public void AddAdditionalParameter() { UrlQuery query = new UrlQuery("http://localhost/default.aspx?id=1"); Assert.AreEqual(1, query.QueryString.Count); query["myparam"] = "myval"; Assert.AreEqual("myval", query["myparam"]); Assert.AreEqual(2, query.QueryString.Count); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!String.IsNullOrEmpty(_box_css_name)) { if (_box_css_name.IndexOf("-title-") > 0) { string sBoxTop = String.Format("<div id=\"{0}\"><div class=\"t\"><div class=\"t\"><div class=\"t\"></div></div></div><div class=\"title\">{1}</div><div class=\"m\"><div class=\"clearfix\">", _box_css_name, LegoWebSite.Buslgic.CommonParameters.asign_COMMON_PARAMETER(this.Title)); string sBoxBottom = "</div><div class=\"clr\"></div></div><div class=\"b\"><div class=\"b\"><div class=\"b\"></div></div></div></div>"; this.litBoxTop.Text = sBoxTop; this.litBoxBottom.Text = sBoxBottom; } else { string sBoxTop = String.Format("<div id=\"{0}\"><div class=\"t\"><div class=\"t\"><div class=\"t\"></div></div></div><div class=\"m\"><div class=\"clearfix\">", _box_css_name); string sBoxBottom = "</div><div class=\"clr\"></div></div><div class=\"b\"><div class=\"b\"><div class=\"b\"></div></div></div></div>"; this.litBoxTop.Text = sBoxTop; this.litBoxBottom.Text = sBoxBottom; } } DataTable cntData = LegoWebSite.Buslgic.MetaContents.get_MOST_READ_CONTENTS(_category_id, _number_of_record, System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToLower()); if (cntData.Rows.Count > 0) { CRecord myRec = new CRecord(); CSubfield Sf = new CSubfield(); string sTemplateFileName = LegoWebSite.DataProvider.FileTemplateDataProvider.get_XsltTemplateFile(_template_name); UrlQuery myPost = new UrlQuery(); if (!String.IsNullOrEmpty(_default_post_page)) { myPost = new UrlQuery(_default_post_page); } CRecords outRecs = new CRecords(); for (int i = 0; i < cntData.Rows.Count; i++) { int meta_content_id = (int)cntData.Rows[i]["META_CONTENT_ID"]; myRec.load_Xml(LegoWebSite.Buslgic.MetaContents.get_META_CONTENT_MARCXML(meta_content_id, 0)); if (myRec.Datafields.Datafield("245").Subfields.get_Subfield("n", ref Sf)) { Sf.Value = cntData.Rows[i]["READ_COUNT"].ToString(); } else { Sf.ReConstruct(); Sf.Code = "n"; Sf.Value = cntData.Rows[i]["READ_COUNT"].ToString(); myRec.Datafields.Datafield("245").Subfields.Add(Sf); } myPost.Set("contentid", cntData.Rows[i]["META_CONTENT_ID"].ToString()); myRec.Controlfields.Controlfield("001").Value = myPost.AbsoluteUri; outRecs.Add(myRec); } this.litContent.Text = outRecs.XsltFile_Transform(sTemplateFileName); } } }
private void initializeApplication(SPWeb web) { var query = new UrlQuery(Page.Request.Url.ToString()); // ForumApplication.Instance.BasePath = SPEncode.UrlEncodeAsUrl(query.Url); // ForumApplication.Instance.Title = Name; // ForumApplication.Instance.ForumCache = Page.Cache; // ForumApplication.Instance.ClassResourcePath = ClassResourcePath; // ForumApplication.Instance.SpWeb = web; }
public async Task <bool> UpdateShopThread(int threadId, Player player, string content) { string editThreadPage = await GetEditThreadPage(threadId, player.SessionId); if (editThreadPage == null) { return(false); } string csrfToken = Utils.GetCsrfToken(editThreadPage, "hash"); if (string.IsNullOrEmpty(csrfToken)) { return(false); } string title = Utils.FindTextBetween(editThreadPage, "<input type=\"text\" name=\"title\" id=\"title\" onkeypress=\"return event.keyCode!=13\" value=\"", "\">"); UrlQuery data = new UrlQuery(); data.Add("hash", csrfToken); data.Add("title", title); data.Add("content", content); data.Add("submit", "Submit"); var uri = new Uri(Url_MainPoEPage); var cookieContainer = new CookieContainer(); using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer }) using (var client = new HttpClient(handler) { BaseAddress = uri }) { cookieContainer.Add(uri, new Cookie(PoESessionIdCookieName, player.SessionId)); var baseUrl = BaseUrlTemplate_EditThread.Replace("$threadId$", threadId.ToString()); try { var response = await client.PostAsync(baseUrl, new StringContent(data.Build(), Encoding.UTF8, "application/x-www-form-urlencoded")); if (response.IsSuccessStatusCode) { if (await NotifyPoETrade(threadId, player.SessionId)) { return(true); } } } catch (HttpRequestException e) { MessageController.Instance().Log($"[Error][API] Error while updating shop thread {threadId}: {e.Message}"); return(false); } } return(false); }
public async Task <IActionResult> Get([FromQuery] UrlQuery urlQuery) { var result = await _venueRepository.ActivitiesinCity(urlQuery.cityname, urlQuery.PageSize, urlQuery.PageNumber.Value); if (result.Any()) { return(Ok(new { pagingend = false, nextpage = $"{Request.Path}?{urlQuery.PageNumber}&{urlQuery.PageSize}", activitiescity = result })); } return(Ok(new { pagingend = true, nextpage = $"{Request.Path}?{urlQuery.PageNumber}&{urlQuery.PageSize}", activitiescity = result })); }
public IActionResult GetAll([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Bridges .OrderBy(thing => thing.BridgeId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public ActionResult <Pokemon> GetPage([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Pokemon .OrderBy(pokemon => pokemon.PokemonId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public async Task <IActionResult> GetAll([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Locations .OrderBy(thing => thing.LocationId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public ActionResult GetPage([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Creatures .OrderBy(creature => creature.CreatureId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public ActionResult <List <Discussion> > GetTop([FromQuery] UrlQuery urlQuery) { string sql = @"SELECT * FROM Discussion"; if (urlQuery.PageNumber.HasValue) { sql += $" ORDER BY Discussion.CreatedOn DESC OFFSET {urlQuery.PageSize} * ({urlQuery.PageNumber} - 1) ROWS FETCH NEXT {urlQuery.PageSize} ROWS ONLY"; } return(_context.Discussions.FromSql(sql).ToList()); }
[HttpGet("page")] //GET api/dogs/page/?pageNumber=1&pageSize=2 public ActionResult GetPages([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Dogs .OrderBy(dog => dog.DogId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
protected void uxViewAllOrder_Click(object sender, EventArgs e) { UrlQuery urlQuery = new UrlQuery(); urlQuery.AddQuery("Processed", "ShowAll"); urlQuery.AddQuery("Payment", "ShowAll"); urlQuery.AddQuery("Sort", "OrderDate DESC"); MainContext.RedirectMainControl("OrdersList.ascx", urlQuery.RawQueryString); }
public ActionResult GetPage([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Businesses .OrderBy(business => business.BusinessId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public ActionResult GetPage([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Shops .OrderBy(shop => shop.ShopId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public void UpdateBrowseQuery(UrlQuery urlQuery) { if (!String.IsNullOrEmpty(CurrentCurrencyCode)) { urlQuery.AddQuery("CurrencyCode", CurrentCurrencyCode); } else { urlQuery.RemoveQuery("CurrencyCode"); } }
public IActionResult Index([FromQuery] UrlQuery urlQuery) { var item = _analiseService.QueryPag(urlQuery); if (_analiseService.QueryPag(urlQuery).Results.Count == 0) { return(NotFound()); } // ListPaginacao<AnaliseDTO> lst = CreateLinksAnalise(urlQuery, item); return(Ok(item)); }
public ActionResult GetPage([FromQuery] UrlQuery urlQuery) { var validUrlQuery = new UrlQuery(urlQuery.PageNumber, urlQuery.PageSize); var pagedData = _db.Restaurants .OrderBy(restaurant => restaurant.RestaurantId) .Skip((validUrlQuery.PageNumber - 1) * validUrlQuery.PageSize) .Take(validUrlQuery.PageSize); return(Ok(pagedData)); }
public static string Add(string url, string description, string extended = "", string tags = "", DateTime? date = null, bool shared = false, bool replace = false) { UrlQuery query = new UrlQuery(Url.For(Constant.POST_ADD)); query.Add("url", url); query.Add("decription", description); query.Add("extended", extended); query.Add("tags", tags); query.Add("dt", date.Value.ToLongDateString()); query.Add("shared", shared.ToString()); query.Add("replace", replace.ToString()); return query.ToString(); }
public static string Dates(string tag = "") { UrlQuery query = new UrlQuery(Url.For(Constant.POST_DATE)); query.Add("tag", tag); return query.ToString(); }
public static string Suggest(string url) { UrlQuery query = new UrlQuery(Url.For(Constant.POST_SUGGEST)); query.Add("url", url); return query.ToString(); }
public static string All(string name = "") { UrlQuery query = new UrlQuery(Url.For(Constant.BUNDLE_ALL)); query.Add("name", name); return query.ToString(); }
public static string Delete(string name) { UrlQuery query = new UrlQuery(Url.For(Constant.TAG_DELETE)); query.Add("tag", name); return query.ToString(); }