public async Task SearchRide() { try { VoznjaSearchRequest search = new VoznjaSearchRequest { SearchFromHomePage = true, GradDestinacijaID = SelectedOdrediste.GradID, GradPolaskaID = SelectedPolazak.GradID, DatumPolaska = DatumPolaskaProvjera }; var model = await _voznja.Get <List <Voznja> >(search); if (model.Count == 0) { await Application.Current.MainPage.DisplayAlert("Carpool", "Trenutno nema traženih rezultata", "OK"); SearchListBool = false; return; } SearchList.Clear(); foreach (var voznja in model) { SearchList.Add(voznja); } SearchListBool = true; } catch (Exception) { } }
public IActionResult Index(Filter filter) { foreach (var i in Repository.Products) { if (filter.Name == i.Name) { TempData["state"] = "По вашему запросу был обнаружен фильм с тем же названием"; SearchList.Add(i); return(View("Search", SearchList)); } } foreach (var i in Repository.Products) { if (i.Name.Contains(filter.Name, StringComparison.OrdinalIgnoreCase)) { SearchList.Add(i); } } if (SearchList.Count == 0) { TempData["state"] = "Фильмов не обнаружено, проверьте правильность или данного фильма нет на сайте,обратитесь к администрации"; return(View("Index")); } else { TempData["state"] = "Фильма нет в списке, проверьте правильность набора или посмотрите их в похожих фильмах."; return(View("Search", SearchList)); } }
static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); var contactList = new ContactList(n); var searchList = new SearchList(n); for (int a0 = 0; a0 < n; a0++) { string[] tokens_op = Console.ReadLine().Split(' '); string op = tokens_op[0]; string contact = tokens_op[1]; if (op == addCommand) { contactList.Add(contact); } if (op == findCommand) { searchList.Add(contact); } } for (int i = 0; i < searchList.Count; i++) { Console.WriteLine(contactList.GetNumberOfContacts(searchList.SearchListCache[i]).ToString()); } }
/// <summary> /// Handles the Click event of the CheckBox control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void CheckBox_Click(object sender, RoutedEventArgs e) { var toggleButton = ((FrameworkElement)sender); string toggleButtonName = ((FrameworkElement)sender).Name; string selectOption = toggleButtonName.Replace("ToggleButton", ""); WellKnownTranscriptionQueueOption option = (WellKnownTranscriptionQueueOption)Enum.Parse(typeof(WellKnownTranscriptionQueueOption), selectOption, true); string selectedOption = option.ToString(); ManageToggleButtons(option); if ((bool)(sender as ToggleButton).IsChecked) { if (selectedOption.Equals("All")) { SearchList = new List <string>(); } SearchList.Add(selectedOption); SearchRequest = new SearchRequest(SearchHelper.InitialCurrentPage, CurrentPageList); } else { if (SearchList.Contains(selectedOption)) { SearchList.Remove(selectedOption); } } PopulateList(); }
public async Task <bool> SearchForItems(string searchTerm, int searchTypeId, string searchTypeName) { SkipItemCount = 0; ISBusy = true; SearchedItemList = await sts.GetShipments(searchTypeName, searchTerm, AppSettings.ListItemCount, SkipItemCount); if (SearchedItemList.ReturnMessage == "API Token Invalid") { ISBusy = false; return(await Task.FromResult(false)); } else { SkipItemCount += SearchedItemList.Shipments.Count; foreach (Shipment s in SearchedItemList.Shipments) { SearchList.Add(new ShipmentModelView(s)); } if (SearchList.Count > 0) { ListHeight = SearchList.Count * 80 * 0.8; ISBusy = false; return(await Task.FromResult(true)); } else { ISBusy = false; return(await Task.FromResult(false)); } } }
private void SearchActionList(string text) { SearchList.Clear(); var actionList = ActionList.Where(r => r.Name.ToLower().Contains(text.ToLower())); foreach (var entry in actionList) { SearchList.Add(entry); } }
private void SearchStatusList(string text) { SearchList.Clear(); var statusList = StatusList.Where(r => r.Name.ToLower().Contains(text.ToLower())); foreach (var entry in statusList) { SearchList.Add(entry); } }
private async void SearchMusic() { if (SearchQuery == null || SearchQuery.Length == 0) { MessageBox.Show("Please enter title or musician name"); return; } var items = await YouTubeHelper.Search(SearchQuery); SearchList.Clear(); foreach (var item in items) { if (item.Id.Kind == "youtube#video") { SearchList.Add(new SearchModel(item.Snippet.Title, YouTubeHelper.GetBaseUrl() + item.Id.VideoId)); } } }
protected void btnSearch_Click(object sender, EventArgs e) { grdThumbnails.PageIndex = 0; IsSearched = true; if (txtSearch.Text != String.Empty) { SearchList.Clear(); txtSearch.Text = txtSearch.Text.ToString().Trim(); foreach (String str in arr) { if (str.ToLower().Contains(txtSearch.Text.ToString().ToLower())) { SearchList.Add(str); } } } else { SearchList = arr; } grdThumbnails.DataSource = SearchList; grdThumbnails.DataBind(); }
private void dataView_RowValidated(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= SearchList.Count && e.RowIndex != dataView.Rows.Count) { SearchList.Add(curEdit); curEdit = null; currentRow = -1; } else if (curEdit != null && e.RowIndex < SearchList.Count) { SearchList.Set(e.RowIndex, curEdit); curEdit = null; currentRow = -1; } else if (dataView.ContainsFocus) { curEdit = null; currentRow = -1; } } catch { } }
private void btnFilter_Click(object sender, EventArgs e) { PaymentList = HistoryController.getHistory(user.RsaID); BeneficairyList = BeneficiaryController.GetBeneficiarys(user.RsaID); List <string> BeneficiarySearchIDs = new List <string>(); bool UsePaymentList = false; List <Payment> SearchList = new List <Payment>(); //Filter for Beneficiary Name if (!txtBName.Text.Equals("")) { //Get All ID's of Beneficiaries that fall under search Criteria foreach (Beneficiary item in BeneficairyList) { if (item.BeneficairyName.IndexOf(txtBName.Text.Trim(), StringComparison.CurrentCultureIgnoreCase) != -1) { BeneficiarySearchIDs.Add(item.BeneficairyID); } } //Filter All Payments, based on BeneficiaryID foreach (Payment item in PaymentList) { if (BeneficiarySearchIDs.Contains(item.BeneficairyID)) { SearchList.Add(item); } } //Changes the Criteria list, depending on this Filter Criteria, only showing payments that meet this criteria, for the next criteria methods. PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter Payments by Status if (!cmbStaus.Text.Equals("")) { foreach (Payment item in PaymentList) { if (item.Status.Equals(cmbStaus.Text.ToString())) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter by Date if (cxbDate.Checked) { string StartDateString = dtpStart.Value.ToString("dd/MM/yyyy"); DateTime StartDate = DateTime.ParseExact(StartDateString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); string EndDateString = dtpEnd.Value.ToString("dd/MM/yyyy"); DateTime EndDate = DateTime.ParseExact(EndDateString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); foreach (Payment item in PaymentList) { DateTime PaymentDate = DateTime.ParseExact(item.PayDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); if (PaymentDate > StartDate && PaymentDate < EndDate) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Filter by Payment Method if (!cbPaymenttype.Text.Equals("")) { foreach (Payment item in PaymentList) { if (item.TypePayment.ToString() == cbPaymenttype.Text.ToString()) { SearchList.Add(item); } } PaymentList = SearchList; SearchList = new List <Payment>(); UsePaymentList = true; } //Now Populate depending on which list, true means using PaymentList global variable, false means using the searchlist if (UsePaymentList) { FillPaymentsDatagrid(PaymentList); } else { FillPaymentsDatagrid(SearchList); } }
static void Main(string[] args) { //Observer Patern var phone = new Phone(); var Iphone6 = new PushNotification("Iphone 6", phone); var Samsung = new PushNotification("Samsung", phone); phone.Attach(Iphone6); phone.Attach(Samsung); phone.State = "Version NO: 22421231"; //14 C4#Future Afisare("George", 21, "da"); Afisare(age: 18, Name: "Mihai", licenses: "da"); Afisare("Alex"); Afisare("Andrei", 22); Student student = new Student("George", 23); Test(null); //Strategy Patern var SearchList = new SearchList(); SearchList.Add("George"); SearchList.Add("Mihai"); SearchList.Add("Alin"); SearchList.SetSearchStrategy(new LinqSearch()); SearchList.CautaCuvant(); //Template Vehicle ferrari = new Car(); Vehicle F17 = new Plane(); ferrari.Can("George", 21); F17.Can("George", 21); //var func = GetAFunc(); //Console.WriteLine(func(6)); //Console.WriteLine(func(3)); //Console.WriteLine(func(7)); //Console.WriteLine(func(4)); //Console.WriteLine(func(5)); //Console.WriteLine(func(2)); //Console.WriteLine("da", null == null); //Console.ReadLine(); MyCar(); Console.ReadKey(); //string Cuvant = "sadsaasdas"; //Encoding ascii = Encoding.ASCII; //Encoding unicode = Encoding.Unicode; //byte[] unicodebytes = unicode.GetBytes(Cuvant); //byte[] asciistring = Encoding.Convert(unicode,ascii, unicodebytes); //Console.WriteLine(asciistring); //Console.WriteLine(unicode); //var rectorat = new Rectorat(); //var student = rectorat.StudentsList(2); //foreach (var student1 in student) //{ // Console.WriteLine("{0} {1} {2}",student1.Name,student1.Age,student1.Sectie); //} //Console.ReadLine(); }
void InitSearch() { SearchList.Add(new SearchCSFile(FilePath, Content)); SearchList.Add(new SearchXMLFile(FilePath, Content, RegexValue)); }