private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if ((e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) || e.KeyboardDevice.IsKeyDown(Key.RightCtrl)) && e.Key == Key.N)
     {
         if (NewBtn.IsVisible && NewBtn.IsEnabled)
         {
             AddCommandHandler(sender, null);
         }
     }
     else if ((e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) || e.KeyboardDevice.IsKeyDown(Key.RightCtrl)) && e.Key == Key.S)
     {
         if (SaveBtn.IsVisible && SaveBtn.IsEnabled)
         {
             UpdateCommandHandler(sender, null);
         }
     }
     else if ((e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) || e.KeyboardDevice.IsKeyDown(Key.RightCtrl)) && e.Key == Key.F)
     {
         if (SearchTxt.IsVisible && SearchTxt.IsEnabled)
         {
             SearchTxt.Focus();
         }
     }
     else if ((e.KeyboardDevice.IsKeyDown(Key.LeftShift) || e.KeyboardDevice.IsKeyDown(Key.RightShift)) && e.Key == Key.Delete)
     {
         if (DeleteBtn.IsVisible && DeleteBtn.IsEnabled)
         {
             DeleteItemCommandHandler(sender, null);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Seaching from page
 /// </summary>
 /// <param name="Anything"> what you searching for</param>
 public void Search(string Anything)
 {
     SearchTxt.Clear();
     SearchTxt.SendKeys(Anything);
     Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
     SearchBtn.Click();
     Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
 }
Exemple #3
0
        /// <summary>
        /// For any table within LS, this method enters text in the search box, then either clicks Go or hits Enter and waits for table to
        /// get returned by waiting for the the tbody element's "class" attribute to not have a value of "loading"
        /// </summary>
        /// <param name="tblBody">The tbody element in your table</param>
        /// <param name="searchText">What you want to search for</param>
        public void Search(By tblBody, string searchText)
        {
            SearchTxt.SendKeys(searchText);

            SearchTxt.SendKeys(Keys.Enter);

            Thread.Sleep(0400);
            Browser.WaitForElement(tblBody, TimeSpan.FromSeconds(240), ElementCriteria.AttributeValueNot("class", "loading"));
            Thread.Sleep(1000);
        }
        /// <summary>
        /// Enters text into the top left hand Search field, clicks Go, then waits for the Search Results page to load
        /// </summary>
        /// <param name="textToEnter">The text you want to enter into the Search field</param>
        /// <returns></returns>
        public SearchResultsPage Search(string textToEnter)
        {
            SearchTxt.Clear();
            SearchTxt.SendKeys(textToEnter);
            SearchBtn.Click();

            SearchResultsPage page = new SearchResultsPage(Browser);

            page.WaitForInitialize();
            return(page);
        }
        private void SearchBtn_Click(object sender, EventArgs e)           //Skriver ut informationen om personen man man sökt på i Edit sidan.
        {
            Search.SearchEditUser(SearchTxt.Text);

            EmailLbl.Text       = emailLbl;             //Här nedan så skrivs all information in i alla tomma variaberna på skärmen.
            FirstNameLbl.Text   = firstNameLbl;
            LastNameLbl.Text    = lastNameLbl;
            AddressLbl.Text     = addressLbl;
            PhonenumberLbl.Text = phoneNumberLbl;
            JobTitleLbl.Text    = jobTitleLbl;
            SalaryLbl.Text      = salaryLbl;
            SearchTxt.Clear();                                            //Rensar fältet.
        }
Exemple #6
0
 private void FormItems_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.N)
     {
         NewBtn.PerformClick();
     }
     else if (e.Control && e.KeyCode == Keys.S)
     {
         SaveBtn.PerformClick();
     }
     else if (e.Shift && e.KeyCode == Keys.Delete)
     {
         DeleteBtn.PerformClick();
     }
     else if (e.Control && e.KeyCode == Keys.F)
     {
         SearchTxt.Focus();
     }
 }
Exemple #7
0
        private void SearchBtn_Click(object sender, RoutedEventArgs e)
        {
            //make sure a search value was entered
            if (string.IsNullOrEmpty(SearchTxt.Text))
            {
                MessageBox.Show("You must enter a search term.", "Missing Search Term",
                                MessageBoxButton.OK);
                SearchTxt.Focus();
                return;
            }
            try
            {
                //change the cursor to hourglass
                this.Cursor = Cursors.Wait;


                PeopleSoapClient ps = new PeopleSoapClient();
                //use the host name property to configure the request against the site in
                //which the control is hosted
                ps.Endpoint.Address =
                    new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx");



                //create the handler for when the call completes
                ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted);
                //execute the search
                ps.SearchPrincipalsAsync(SearchTxt.Text, 50, SPPrincipalType.User);
            }
            catch (Exception ex)
            {
                //ERROR LOGGING HERE
                Debug.WriteLine(ex.Message);

                MessageBox.Show("There was a problem executing the search; please try again " +
                                "later.", "Search Error",
                                MessageBoxButton.OK);
                //reset cursor
                this.Cursor = Cursors.Arrow;
            }
        }
Exemple #8
0
        /// <summary>
        /// Selecting a value from the Status dropdown, Entering text in the name text box and clicking search
        /// </summary>
        /// <param name="UserStatus">Select user status from dropdown</param>
        /// <param name="UserName">passing username</param>
        public void SearchForUserByStatusAndName(String UserStatus, String UserName)
        {
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(180), ElementCriteria.IsNotVisible);
            StatusSelElem.SelectByValue(UserStatus);
            SearchTxt.Clear();
            SearchTxt.SendKeys(UserName);
            Browser.WaitForElement(Bys.AMAPage.SearchBtn, TimeSpan.FromSeconds(180), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
            try
            {
                Thread.Sleep(0500);
                SearchBtn.Click();
            }
            catch (InvalidOperationException)
            {
                SearchTxt.SendKeys(Keys.Enter);
                SearchTxt.SendKeys(Keys.Enter);
            }

            // StatusSelElem.SelectByValue(UserStatus);
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
        }
Exemple #9
0
 public void FocusText()
 {
     SearchTxt.Focus(FocusState.Programmatic);
 }
Exemple #10
0
 private void SearchTxt_MouseDown(object sender, MouseEventArgs e)
 {
     SearchTxt.Clear();
 }
Exemple #11
0
 //filtrowanie listy przepisow wedlug wyszukiwanej nazwy
 private void Search()
 {
     using (var contex = new CookingBookEntities1())
     {
         RecipeList = new ObservableCollection<Recipe>(contex.Recipes.Where(x => x.Title.ToUpper().Contains(SearchTxt.ToUpper())));
     }
 }
Exemple #12
0
 private void SearchTxt_Enter(object sender, EventArgs e)
 {
     optionPanelAnimation(false);
     SearchTxt.SelectAll();
     moreOptionsBtn.Hide();
 }
Exemple #13
0
 private void Panel_Productos_Load(object sender, EventArgs e)
 {
     this.loadtable();
     SearchTxt.Select();
 }
Exemple #14
0
 //wyswietlanie listy przepisow spelniajacych kryteria wyszukiwania
 private void Search()
 {
     using (var contex = new CookingBookEntities1())
     {
         if (SelectedTitle)
         {
             RecipeList = new ObservableCollection <Recipe>(contex.Recipes.Where(x => x.Title.ToUpper().Contains(SearchTxt.ToUpper())));
         }
         else if (SelectedAuthor)
         {
             RecipeList = new ObservableCollection <Recipe>(contex.Recipes.Where(x => x.Author.Name.ToUpper().Contains(SearchTxt.ToUpper())));
         }
         else if (SelectedIngredient)
         {
             RecipeList = new ObservableCollection <Recipe>(contex.Recipes.Where(x => x.Ingredients.Any(v => v.Name.ToUpper().Contains(SearchTxt.ToUpper()))));
         }
     }
 }
Exemple #15
0
 private void btnItemsforSale_Click(object sender, EventArgs e)
 {
     SearchTxt.Focus();
 }
Exemple #16
0
 private void Panel_Productos_Shown(object sender, EventArgs e)
 {
     SearchTxt.Select();
 }
Exemple #17
0
        public async void GetData()
        {
            try
            {
                IsBusy = true;

                using (RequestSelectBoardModel req = new RequestSelectBoardModel())
                {
                    req.boardId   = StringEnum.GetStringValue(EnumLib.BoardCode.Notice);
                    req.lang      = LoginViewModel.LanguagePack.Split('/')[2].Split('-')[0];
                    req.pageIndex = pageIndex;
                    if (!string.IsNullOrWhiteSpace(SearchTxt.Trim()))
                    {
                        req.searchWrd = SearchTxt;
                    }

                    using (ResponseSelectBoardModel res = await WebApiLib.AsyncCall <ResponseSelectBoardModel, RequestSelectBoardModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            if (res.data.list.Count > 0)
                            {
                                Notice = new ObservableCollection <list>();
                                foreach (ResponseSelectBoardListModel item in res.data.list)
                                {
                                    //string step1 = item.contentMsg.Replace("\",=\"\"", "',");
                                    //string step2 = step1.Replace("=\"\"", "");
                                    //string stepComp = step2.Replace(" \" ", "'");
                                    //string stepComp2 = stepComp.Replace("%29", "");
                                    //string stepComp2 = stepComp.Replace("/common.file", (ConfigLib.WebUrl + "common.file").ToString());
                                    Notice.Add(ViewModelSource.Create(() => new list()
                                    {
                                        num = item.no, title = item.boardTitle, date = item.regDt, content = item.contentMsg
                                    }));
                                }

                                pageSize = res.data.pageSize;

                                listVisible  = Visibility.Visible;
                                emptyVisible = Visibility.Collapsed;
                            }
                            else
                            {
                                listVisible  = Visibility.Collapsed;
                                emptyVisible = Visibility.Visible;
                            }

                            IsBusy = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy = false;
            }
        }