Example #1
0
        private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            if (!popupSearchBox.Visible)
            {
                popupSearchBox.Visible = true;
            }

            popupSearchBox.Clear();
            popupSearchBox.AddItem("Search " + textBox1.Text);
        }
Example #2
0
        private void SearchBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                SearchBox.Clear();
                GeneralSettings.ItemsCount = StackMain.Children.Count;
                FilterCards(new Regex(".*"));
                return;
            }

            if (e.Key != Key.Return || StackMain.Children.Count == 0 || string.IsNullOrEmpty(SearchBox.Text))
            {
                return;
            }
            DisplayAwesomeMessage(this, "Showing search results...", MessageType.Notify, 1200);

            try
            {
                var regex = new Regex(SearchBox.Text, RegexOptions.IgnoreCase);
                FilterCards(regex);
            }
            catch (Exception ex)
            {
                DisplayAwesomeMessage(this, "Invalid regular expression", MessageType.Warning, 2000);
            }
        }
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            mainShow = Utilities.LoadFromAPI(SearchBox.Text);

            DescriptionBlock.Text     = mainShow.ToString();
            SeasonPicker.SelectedItem = "Season 1";
            episodes = mainShow.GetEpisodes(1);
            EpisodeBox.ItemsSource = episodes;
            Imagebox.Source        = new BitmapImage(new Uri(mainShow.image.Original, UriKind.Absolute));

            int number = SeasonPicker.Items.Count;

            for (int i = 2; i <= number; i++)
            {
                SeasonPicker.Items.Remove($"Season {i}");
            }
            int counter = 0;

            foreach (var season in mainShow.Seasons)
            {
                counter++;
                if (flag == 1 && counter == 1)
                {
                }
                else
                {
                    SeasonPicker.Items.Add($"Season {counter}");
                }
            }
            flag = 1;

            SeasonPicker.Items.Refresh();
            EpisodeBox.Items.Refresh();
            SearchBox.Clear();
        }
Example #4
0
 public BingMainPage Search(string textToType)
 {
     SearchBox.Clear();
     SearchBox.SendKeys(textToType);
     GoButton.Click();
     return(this);
 }
Example #5
0
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (SearchBox.TextLength < 3)
         {
             throw new Exception("Введите предмет полностью");
         }
         using (SqlCommand cmd = new SqlCommand(("DELETE FROM [Table] WHERE [Навзание курса] LIKE \'%" + SearchBox.Text + "%\'"), SqlCon))
         {
             cmd.ExecuteNonQuery();
         }
         SearchBox.Clear();
         MessageBox.Show($"Предмет успешно удален", "Успех!",
                         MessageBoxButtons.OK, MessageBoxIcon.Information);
         SqlCommand command = new SqlCommand();
         command = new SqlCommand("SELECT * FROM [Table]", SqlCon);
         BuildDB(command);
         SearchBox.Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Example #6
0
 private void RefreshBtn_Click(object sender, EventArgs e)
 {
     refreshData();
     SearchBox.Clear();
     SearchTypeComboBox.SelectedIndex = -1;
     SearchBox.Enabled = false;
 }
Example #7
0
 private void SearchOnClick(object sender, System.EventArgs e)
 {
     if (!searchMode)
     {
         searchMode = true;
         SearchBox.Clear();
     }
 }
 private void Clear_All_Entries()
 {
     USNBox.Clear();
     ScholarshipNameList.ClearSelected();
     SearchBox.Clear();
     AmountBox.Clear();
     DataView.DataSource = null;
 }
 private void Clear_All_Entries()
 {
     EmployeeIDBox.Clear();
     AmountBox.Clear();
     CategoryList.ClearSelected();
     SearchBox.Clear();
     DataView.DataSource = null;
 }
Example #10
0
 private void SearchBox_Enter(object sender, EventArgs e)
 {
     if ((SearchBox.Text == "Search") && (SearchBox.TextAlign == HorizontalAlignment.Center))
     {
         SearchBox.TextAlign = HorizontalAlignment.Left;
         SearchBox.Clear();
     }
     SearchBox.ForeColor = Color.Gainsboro;
 }
Example #11
0
 public SearchResultPage Search(string textToType)
 {
     Navigate();
     SearchBox.Clear();
     SearchBox.SendKeys(textToType);
     SearchType.Click();
     SearchButton.Click();
     return(new SearchResultPage(this.driver));
 }
Example #12
0
 private void SearchBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
 {
     if (!string.IsNullOrEmpty(SearchBox.Text))
     {
         return;
     }
     SearchBox.Clear();
     GeneralSettings.ItemsCount = StackMain.Children.Count;
     FilterCards(new Regex(".*"));
 }
 public void Search(string textToType)
 {
     if (string.IsNullOrEmpty(textToType))
     {
         throw new ArgumentException(nameof(textToType) + "cannot be null or empty.");
     }
     SearchBox.Clear();
     SearchBox.SendKeys(textToType);
     GoButton.Click();
 }
 private void tryAddMonster()
 {
     if (!string.IsNullOrWhiteSpace(searchBox.Selected) &&
         !string.IsNullOrWhiteSpace(textBox.Text) &&
         int.TryParse(textBox.Text, out int quantity))
     {
         encounter.MonsterGroups.Add(new MonsterGroup(new Monster(searchBox.Selected), quantity));
         searchBox.Clear();
         textBox.Clear();
     }
 }
Example #15
0
        private async void UploadDiary_Click(object sender, RoutedEventArgs e)
        {
            await Repository.UpdateRegularDiaryAsync(DiaryId, SelectionNumber, FilePath);

            SnackbarThree.MessageQueue.Enqueue("Diary " + SelectionNumber + " has been updated");
            SelectedDiary.Clear();
            SearchBox.Clear();
            ChosenDiary.Clear();
            FilePath = null;
            UploadDiary.IsEnabled  = false;
            DiaryGroup.ItemsSource = DiaryPager.SetPaging(DiaryList.NeedUploaded(), 15).DefaultView;
        }
Example #16
0
File: Form1.cs Project: IchPOch/PPO
 private void SbrosBut_Click(object sender, EventArgs e)
 {
     BoCh.Enabled      = true;
     BoCh.Checked      = false;
     JaCh.Enabled      = true;
     JaCh.Checked      = false;
     NmCh.Enabled      = true;
     NmCh.Checked      = false;
     SearchBox.Enabled = true;
     Table.BringToFront();
     SearchBox.Clear();
 }
Example #17
0
 private void off_Click(object sender, EventArgs e)        //"сброс" элементов управления
 {
     Poscb.Enabled     = true;
     Poscb.Checked     = false;
     Actcb.Enabled     = true;
     Actcb.Checked     = false;
     Fired.Enabled     = true;
     Fired.Checked     = false;
     LNcb.Enabled      = true;
     LNcb.Checked      = false;
     SearchBox.Enabled = true;
     Data_Person.BringToFront();
     SearchBox.Clear();
 }
Example #18
0
        private void RefreshReports()
        {
            var service = Helper.getServiceClient();
            var list    = service.GetReportNames();

            listbox.Items.Clear();
            SearchBox.Clear();
            foreach (string s in list)
            {
                listbox.Items.Add(s);
            }

            CountLabel.Content = listbox.Items.Count.ToString() + " Items";
        }
        private void ClearButton_OnClick(object sender, RoutedEventArgs e)
        {
            string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()";

            try
            {
                SearchBox.Clear();
                SearchButton.IsEnabled = true;
                ClearButton.IsEnabled  = false;
                ICollectionView filteredView = CollectionViewSource.GetDefaultView((this.MainGrid.DataContext as LibraryViewModel).ChemistryItems);
                filteredView.Filter = null;
            }
            catch (Exception ex)
            {
                new ReportError(Globals.Chem4WordV3.Telemetry, Globals.Chem4WordV3.WordTopLeft, module, ex).ShowDialog();
            }
        }
        private void FilterByClass(object sender, RoutedEventArgs e)
        {
            var c    = (Class)((FrameworkElement)sender).DataContext;
            var view = DC.AbnormalitiesView;

            if (SearchBox.Text.Length > 0)
            {
                SearchBox.Clear();
                view.Filter = null;
            }

            if (view.Filter == null || c != _currentFilter)
            {
                view.Filter    = o => ((GroupAbnormalityVM)o).Classes.Any(x => x.Class == c && x.Selected);
                _currentFilter = c;
            }
            else
            {
                view.Filter    = null;
                _currentFilter = Class.None;
            }

            view.Refresh();

            //TODO: this is bad and i should feel bad
            foreach (var x in ClassesButtons.Items)
            {
                var cp  = (ContentPresenter)ClassesButtons.ItemContainerGenerator.ContainerFromItem(x);
                var btn = cp.ContentTemplate.FindName("Btn", cp) as Button;
                if (btn?.DataContext == null)
                {
                    continue;
                }
                var dc = (Class)btn.DataContext;
                if (dc == _currentFilter)
                {
                    btn.Opacity = 1;
                }
                else
                {
                    btn.Opacity = .3;
                }
            }
        }
Example #21
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            string searchText = SearchBox.Text;

            if (searchText != "")
            {
                var results = ManagerHome.mainDatabaseReference.Foods
                              .Where(p => p.Food_Name == searchText)
                              .Select(p =>
                                      new { p.Food_ID, p.Food_Name, p.Food_Type, p.Exp_Date, p.Shelf_Number }).ToList();
                ResultsGrid.DataSource = null;
                ResultsGrid.DataSource = results;
            }
            else
            {
                MessageBox.Show("Invalid Input. Try again!");
                SearchBox.Clear();
            }
        }
Example #22
0
        private void Search_Click(object sender, EventArgs e)
        {
            string searchText = SearchBox.Text;

            if (searchText != "")
            {
                var results = ManagerHome.mainDatabaseReference.Recipes
                              .Where(p => p.Name == searchText)
                              .Select(p =>
                                      new { p.Name, p.Description }).ToList();
                ResultsGrid.DataSource = null;
                ResultsGrid.DataSource = results;
            }
            else
            {
                MessageBox.Show("Invalid Input. Try again!");
                SearchBox.Clear();
            }
        }
Example #23
0
        //public override string Url => "http://www.google.com/";
        //public override string Url => "https://www.yahoo.com/";
        //public override string Url => "http://www.aol.com/";


        public void Search(string textToType)
        {
            SearchBox.Clear();
            SearchBox.SendKeys(textToType + Keys.Enter);
            //GoButton.Click();
            ////var link = WrappedDriver.FindElement(By.PartialLinkText("Homepage"));
            //////var jsToBeExecuted = $"window.scroll(0, {link.Location.Y});";
            //////((IJavaScriptExecutor)WrappedDriver).ExecuteScript(jsToBeExecuted);
            ////var wait = new WebDriverWait(WrappedDriver, TimeSpan.FromMinutes(1));
            //////System.Threading.Thread.Sleep(TimeSpan.FromSeconds(8));
            ////var clickableElement = wait.Until(ExpectedConditions.ElementToBeClickable(By.PartialLinkText("Homepage")));
            ////clickableElement.Click();
            //System.Threading.Thread.Sleep(TimeSpan.FromSeconds(8));
            //WrappedDriver.SwitchTo().Window(WrappedDriver.WindowHandles.Last());

            WebDriverWait wait = new WebDriverWait(WrappedDriver, TimeSpan.FromSeconds(10));

            wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.Id("b_tween")));
            bool bis = ResultsCountDiv.Text.Contains(ResultsCountDiv.Text);
            //Assert.IsTrue(bis);
        }
Example #24
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (IsOpen == false)
            {
                SearchBox.Clear();
                sp.Play();
                MessageBox.Show("Сначала открой БД", "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            dataGridView1.Rows.Clear();
            SqlCommand command = new SqlCommand();

            try
            {
                command = new SqlCommand("SELECT * FROM [Table] WHERE [Шифр курса] = " + Convert.ToInt32(SearchBox.Text) + "or [Количество часов] LIKE \'%" + SearchBox.Text + "%\'", SqlCon);
            }
            catch (System.FormatException)
            {
                command = new SqlCommand("SELECT * FROM [Table] WHERE [ФИО преподователя] LIKE \'%" + SearchBox.Text + "%\' or [Навзание курса] LIKE \'%" + SearchBox.Text + "%\' or [ФИО студента] LIKE \'%" + SearchBox.Text + "%\' or [Количество часов] LIKE \'%" + SearchBox.Text + "%\' or [ФИО студента] LIKE \'%" + SearchBox.Text + "%\' or [Факультет] LIKE \'%" + SearchBox.Text + "%\'", SqlCon);
            }
            BuildDB(command);
        }
Example #25
0
 //reset method called to when serch by is changed to refill tables, clear search boxes, and sets dgv/ssearchboxes to invisible
 private void reset()
 {
     //fill tables
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.receivablesQuery' table. You can move, or remove it, as needed.
     this.receivablesQueryTableAdapter.Fill(this.pineSpringsPotteryDataSet.receivablesQuery);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.orderLineItemQuery' table. You can move, or remove it, as needed.
     this.orderLineItemQueryTableAdapter.Fill(this.pineSpringsPotteryDataSet.orderLineItemQuery);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.PIECE_CATALOG' table. You can move, or remove it, as needed.
     this.pIECE_CATALOGTableAdapter.Fill(this.pineSpringsPotteryDataSet.PIECE_CATALOG);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.PATTERN' table. You can move, or remove it, as needed.
     this.pATTERNTableAdapter.Fill(this.pineSpringsPotteryDataSet.PATTERN);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.ORDERS' table. You can move, or remove it, as needed.
     this.oRDERSTableAdapter.Fill(this.pineSpringsPotteryDataSet.ORDERS);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.SHOW' table. You can move, or remove it, as needed.
     this.sHOWTableAdapter.Fill(this.pineSpringsPotteryDataSet.SHOW);
     // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.CUSTOMER' table. You can move, or remove it, as needed.
     this.cUSTOMERTableAdapter.Fill(this.pineSpringsPotteryDataSet.CUSTOMER);
     //make invisible
     patternPanel.Visible                   = false;
     piecePanel.Visible                     = false;
     SearchPanel.Visible                    = false;
     DatePanel.Visible                      = false;
     cUSTOMERDataGridView.Visible           = false;
     sHOWDataGridView.Visible               = false;
     oRDERSDataGridView.Visible             = false;
     receivablesQueryDataGridView.Visible   = false;
     orderLineItemQueryDataGridView.Visible = false;
     SearchButton.Enabled                   = true;
     ViewInfoButton.Enabled                 = true;
     //clear search criteria
     SearchBox.Clear();
     startDateTimePicker.ResetText();
     endDateTimePicker.ResetText();
     patternNameComboBox.SelectedIndex = 0;
     pieceNameComboBox.SelectedIndex   = 0;
 }
Example #26
0
 public void Search(string textToType)
 {
     SearchBox.Clear();
     SearchBox.SendKeys(textToType);
     GoButton.Click();
 }
Example #27
0
 //
 // ----Search box----
 //
 // Clear Searchbox at focus
 private void SearchBox_GotFocus(object sender, RoutedEventArgs e)
 {
     SearchBox.Clear();
 }
Example #28
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     if (CheckData(CourseNameInput.Text, CourseNumberInput.Text, FacultyInput.Text, HoursInput.Text, TeacherNameInput.Text, StudentNameInput.Text) == false)
     {
         return;
     }
     try
     {
         if (String.IsNullOrWhiteSpace(TeacherNameInput.Text))
         {
             TeacherNameInput.Text = null;
         }
         SqlCommand addcom = new SqlCommand("INSERT INTO [Table] ([Навзание курса],[Шифр курса],[Факультет],[Количество часов], [ФИО преподователя], [ФИО студента])VALUES(@Course,@Number,@Faculty,@Hours,@Teacher,@Student)", SqlCon);
         addcom.Parameters.AddWithValue("Course", CourseNameInput.Text);
         addcom.Parameters.AddWithValue("Number", Convert.ToInt32(CourseNumberInput.Text));
         addcom.Parameters.AddWithValue("Faculty", FacultyInput.Text);
         addcom.Parameters.AddWithValue("Hours", HoursInput.Text);
         addcom.Parameters.AddWithValue("Teacher", TeacherNameInput.Text);
         addcom.Parameters.AddWithValue("Student", StudentNameInput.Text);
         addcom.ExecuteNonQuery();
         CourseNameInput.Clear();
         CourseNumberInput.Clear();
         FacultyInput.Clear();
         HoursInput.Clear();
         TeacherNameInput.Clear();
         StudentNameInput.Clear();
         SearchBox.Clear();
         SqlCommand command = new SqlCommand();
         command = new SqlCommand("SELECT * FROM [Table]", SqlCon);
         BuildDB(command);
         MessageBox.Show($"Успешное добавление в БД", "Успех!",
                         MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (System.Data.SqlClient.SqlException)
     {
         DialogResult result = MessageBox.Show($"Предмет с таким шифром уже существует. Желаете обновить его в БД?", "Непорядок",
                                               MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (result == DialogResult.Yes)
         {
             if (CheckData(CourseNameInput.Text, CourseNumberInput.Text, FacultyInput.Text, HoursInput.Text, TeacherNameInput.Text, StudentNameInput.Text) == false)
             {
                 return;
             }
             try
             {
                 if (String.IsNullOrWhiteSpace(TeacherNameInput.Text))
                 {
                     TeacherNameInput.Text = null;
                 }
                 SqlCommand addcom = new SqlCommand("UPDATE [Table] SET [Навзание курса] = @Course,[Шифр курса] = @Number,[Факультет] = @Faculty,[Количество часов] = @Hours, [ФИО преподователя] = @Teacher, [ФИО студента] = @Student WHERE [Шифр курса] = " + CourseNumberInput.Text, SqlCon);
                 addcom.Parameters.AddWithValue("Course", CourseNameInput.Text);
                 addcom.Parameters.AddWithValue("Number", Convert.ToInt32(CourseNumberInput.Text));
                 addcom.Parameters.AddWithValue("Faculty", FacultyInput.Text);
                 addcom.Parameters.AddWithValue("Hours", HoursInput.Text);
                 addcom.Parameters.AddWithValue("Teacher", TeacherNameInput.Text);
                 addcom.Parameters.AddWithValue("Student", StudentNameInput.Text);
                 addcom.ExecuteNonQuery();
                 CourseNameInput.Clear();
                 CourseNumberInput.Clear();
                 FacultyInput.Clear();
                 HoursInput.Clear();
                 TeacherNameInput.Clear();
                 StudentNameInput.Clear();
                 SqlCommand command = new SqlCommand();
                 command = new SqlCommand("SELECT * FROM [Table]", SqlCon);
                 BuildDB(command);
                 SearchBox.Clear();
                 MessageBox.Show($"Успешное обновление БД", "Успех!",
                                 MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message.ToString());
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Example #29
0
 private void SearchBox_GotFocus(object sender, RoutedEventArgs e)
 {
     SearchBox.Clear();
     SearchBox.GotFocus  -= SearchBox_GotFocus;
     SearchBox.Foreground = Brushes.Black;
 }
 //Search for a product
 public void Search(string searchText)
 {
     SearchBox.Clear();
     SearchBox.SendKeys(searchText);
     SearchBox.Submit();
 }