private void OpenPostWindow() { PostPopUpView = new PostingPopUpView(); PostPopUpView.ItemToPost = itemToLookUp; PostPopUpView.BuyoutTxtBox = SearchedList.Any() ? SearchedList.Min(Auction => Auction.Buyout).ToString() : "0"; PostPopUpView.BidTxtBox = "0"; PostPopUpView.db = db; PostPopUpView.Show(); }
public void Search(string _s) { if (QuickSearch) { PostBottomOpacity = 1.0; PostEnabled = true; } else { PostBottomOpacity = 0.3; PostEnabled = false; } SearchedList.Clear(); if (_s == null) { _s = ""; } SearchedList = db.SearchAuction(_s); }
public void SearchCountries(string SearchKey) { try { //SearchedList.Clear(); var list = GlobalCountryCaseDataModel.Where(x => x.country.ToUpper().StartsWith(SearchKey.ToUpper())).ToList(); if (list.Count > 0) { SearchedList = list; IsNoResultLabelVisilbe = false; } else { SearchedList.Clear(); NotifyChage("SearchedList"); IsNoResultLabelVisilbe = true; } } catch (Exception ex) { Debug.WriteLine(ex.StackTrace); } }
private void SortBy(string arg) { arg = arg.ToLower(); List <Auction> temp = SearchedList.ToList <Auction>(); if (arg.ToLower() == "name") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.Name.CompareTo(a2.Name)); }); sorted[arg] = true; } } if (arg.ToLower() == "time left") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.TimeLeftIndex.CompareTo(a2.TimeLeftIndex)); }); sorted[arg] = true; } } if (arg.ToLower() == "bid") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.Bid.CompareTo(a2.Bid)); }); sorted[arg] = true; } } if (arg.ToLower() == "buyout") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.Buyout.CompareTo(a2.Buyout)); }); sorted[arg] = true; } } if (arg.ToLower() == "seller") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.SellerName.CompareTo(a2.SellerName)); }); sorted[arg] = true; } } if (arg.ToLower() == "amount") { if (sorted[arg]) { temp.Reverse(); sorted[arg] = false; } else { temp.Sort(delegate(Auction a1, Auction a2) { return(a1.Amount.CompareTo(a2.Amount)); }); sorted[arg] = true; } } FixDic(arg); SearchedList.Clear(); foreach (Auction a in temp) { SearchedList.Add(a); } }