public bool Equals(PlatformFriendResponse input) { if (input == null) { return(false); } return (( ItemsPerPage == input.ItemsPerPage || (ItemsPerPage.Equals(input.ItemsPerPage)) ) && ( CurrentPage == input.CurrentPage || (CurrentPage.Equals(input.CurrentPage)) ) && ( HasMore == input.HasMore || (HasMore != null && HasMore.Equals(input.HasMore)) ) && ( PlatformFriends == input.PlatformFriends || (PlatformFriends != null && PlatformFriends.SequenceEqual(input.PlatformFriends)) )); }
/// <summary> /// Writes the current context to the specified <see cref="XmlWriter"/>. /// </summary> /// <param name="writer">The <b>XmlWriter</b> to which you want to write the current context.</param> /// <param name="xmlNamespace">The XML namespace used to qualify prefixed syndication extension elements and attributes.</param> /// <exception cref="ArgumentNullException">The <paramref name="writer"/> is a null reference (Nothing in Visual Basic).</exception> /// <exception cref="ArgumentNullException">The <paramref name="xmlNamespace"/> is a null reference (Nothing in Visual Basic).</exception> /// <exception cref="ArgumentNullException">The <paramref name="xmlNamespace"/> is an empty string.</exception> public void WriteTo(XmlWriter writer, string xmlNamespace) { //------------------------------------------------------------ // Validate parameter //------------------------------------------------------------ Guard.ArgumentNotNull(writer, "writer"); Guard.ArgumentNotNullOrEmptyString(xmlNamespace, "xmlNamespace"); //------------------------------------------------------------ // Write current extension details to the writer //------------------------------------------------------------ if (ItemsPerPage != null) { writer.WriteElementString("itemsPerPage", xmlNamespace, ItemsPerPage.ToString()); } if (TotalResults != null) { writer.WriteElementString("totalResults", xmlNamespace, TotalResults.ToString()); } if (StartIndex != null) { writer.WriteElementString("startIndex", xmlNamespace, StartIndex.ToString()); } }
public ActionResult Search(int page = 1, ItemsPerPage itemsPerPage = ItemsPerPage.p05, string Search = "") { if (page <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Parameter 'page' must be positive.")); } int productsPerPage = (int)itemsPerPage; var filters = _ideaRepository.GetNotCancelledIdeasBySearch(Search); int totalPages = (int)Math.Ceiling((double)filters.Count() / (double)productsPerPage); var ideas = filters .OrderByDescending(x => x.EndDate) .Skip((page - 1) * productsPerPage) .Take(productsPerPage) .ToList(); var viewModel = new IdeaIndexViewModel() { Ideas = ideas, Search = Search, TotalPages = totalPages, CurrentPage = page, ItemsPerPage = itemsPerPage, }; return(View(viewModel)); }
IReadOnlyList <KeyValuePair <string, string> > IParameterSet.GetQueryParameters() => new[] { new KeyValuePair <string, string>("current", CurrentPage.ToString()), new KeyValuePair <string, string>("rowCount", ItemsPerPage.ToString()), new KeyValuePair <string, string>("searchPhrase", SearchPhrase), };
public void ChangeItemsPerPageNumber(ItemsPerPage itemsPerPage) { const string location = "//div[@class='fright items-list-options']/select"; var currentValue = _selenium.GetSelectedValue(location); if (Convert.ToInt32(currentValue) == (int) itemsPerPage) return; _selenium.SelectAndWait(location, "value=" + (int) itemsPerPage, WaitingType.PageLoad); }
public void ChangeItemsPerPageNumber(ItemsPerPage itemsPerPage) { const string location = "//div[@class='fright items-list-options']/select"; var currentValue = _selenium.GetSelectedValue(location); if (Convert.ToInt32(currentValue) == (int)itemsPerPage) { return; } _selenium.SelectAndWait(location, "value=" + (int)itemsPerPage, WaitingType.PageLoad); }
public ActionResult AdsList(string search, int?page, ItemsPerPage itemsPerPage = ItemsPerPage.p05, SearchConfirm searchconfirm = SearchConfirm.all) { try { var query = from obj in _ctx.Houses select obj; string header = ""; switch (searchconfirm) { case 0: query = query.Where(x => x.IsConfirmed == Confirmation.Pass); header = "Έγγκεκριμένες αγγελίες "; break; case (SearchConfirm)1: query = query.Where(x => x.IsConfirmed == Confirmation.Pending); header = "Εκκρεμών αγγελίες"; break; case (SearchConfirm)2: query = query.Where(x => x.IsConfirmed == Confirmation.Cancel); header = "Απορριφθέντες αγγελίες"; break; default: header = "Όλες οι αγγελίες"; break; } var houses = query .Include(x => x.Area) .Include(x => x.State) .Include(x => x.User) .OrderByDescending(x => x.Created) .ToList().ToPagedList(page ?? 1, (int)itemsPerPage); AdminSearchViewModel vm = new AdminSearchViewModel { Houses = houses, ItemsPerPage = itemsPerPage, SearchConfirm = searchconfirm, }; ViewBag.Header = header; return(View(vm)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, $"{ex.Message}")); } }
public bool Equals(GroupQuery input) { if (input == null) { return(false); } return (( Name == input.Name || (Name != null && Name.Equals(input.Name)) ) && ( GroupType == input.GroupType || (GroupType != null && GroupType.Equals(input.GroupType)) ) && ( CreationDate == input.CreationDate || (CreationDate != null && CreationDate.Equals(input.CreationDate)) ) && ( SortBy == input.SortBy || (SortBy != null && SortBy.Equals(input.SortBy)) ) && ( GroupMemberCountFilter == input.GroupMemberCountFilter || (GroupMemberCountFilter.Equals(input.GroupMemberCountFilter)) ) && ( LocaleFilter == input.LocaleFilter || (LocaleFilter != null && LocaleFilter.Equals(input.LocaleFilter)) ) && ( TagText == input.TagText || (TagText != null && TagText.Equals(input.TagText)) ) && ( ItemsPerPage == input.ItemsPerPage || (ItemsPerPage.Equals(input.ItemsPerPage)) ) && ( CurrentPage == input.CurrentPage || (CurrentPage.Equals(input.CurrentPage)) ) && ( RequestContinuationToken == input.RequestContinuationToken || (RequestContinuationToken != null && RequestContinuationToken.Equals(input.RequestContinuationToken)) )); }
public bool Equals(PagedQuery input) { if (input == null) { return(false); } return (( ItemsPerPage == input.ItemsPerPage || (ItemsPerPage.Equals(input.ItemsPerPage)) ) && ( CurrentPage == input.CurrentPage || (CurrentPage.Equals(input.CurrentPage)) ) && ( RequestContinuationToken == input.RequestContinuationToken || (RequestContinuationToken != null && RequestContinuationToken.Equals(input.RequestContinuationToken)) )); }
public override int GetHashCode() { return(base.GetHashCode() ^ TotalItems.GetHashCode() ^ ItemsPerPage.GetHashCode() ^ CurrentPage.GetHashCode()); }