Пример #1
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var client = Helper.getServiceClient();
            HRCashBenefitQuery query = new HRCashBenefitQuery(); //by default we have an empty query

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new HRCashBenefitQuery()
                {
                    BenefitCode = SearchControl.SearchTextBox.Text
                }
            }
            ;

            //The search control needs to know the method it has to use inorder to search. So we pass a method
            SearchControl.Search = Search;
            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryHRCashBenefitsAsync(query, pagesize, pagePosition);

            //No response; exit
            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <HR_CASH_BENEFIT>(response.Result.ToList <HR_CASH_BENEFIT>());
        }
Пример #2
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var client = Helper.getServiceClient();
            ProcessControlQuery query = new ProcessControlQuery(); //by default we have an empty query

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new ProcessControlQuery()
                {
                    ProductCode = SearchControl.SearchTextBox.Text
                };
            }

            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryProcessControlAsync(query, pagesize, pagePosition);

            //No response; exit
            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <ERP_ProcessControl>(response.Result.ToList <ERP_ProcessControl>());;
        }
Пример #3
0
        //Normal Search method has been made resuable
        public static async void Search(CustomSearchControl SearchControl)
        {
            var client = Helper.getServiceClient();
            DocumentAttributesRefQuery query = new DocumentAttributesRefQuery();

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new DocumentAttributesRefQuery()
                {
                    DocCode = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionTwo.IsChecked == true)
            {
                query = new DocumentAttributesRefQuery()
                {
                    TxCode = SearchControl.SearchTextBox.Text
                };
            }
            SearchControl.Search = Search;
            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryDocumentAttributesRefAsync(query, pagesize, pagePosition);

            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            var servicelist        = response.Result.ToList <ERP_DocumentAttributesRef>();
            var DocumentAttributes = new ObservableCollection <ERP_DocumentAttributesRef>(servicelist);

            SearchControl.ResultsGrid.ItemsSource = DocumentAttributes;
        }
Пример #4
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var          client = Helper.getServiceClient();
            WarningQuery query  = new WarningQuery(); //by default we have an empty query

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new WarningQuery()
                {
                    EmployeeNumber = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionTwo.IsChecked == true)
            {
                query = new WarningQuery()
                {
                    WarningID = Int32.Parse(SearchControl.SearchTextBox.Text)
                };
            }

            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryWarningAsync(query, pagesize, pagePosition);

            //No response; exit
            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <HR_EMP_WARNINGS>(response.Result.ToList <HR_EMP_WARNINGS>());;
        }
Пример #5
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var           client = Helper.getServiceClient();
            CurrencyQuery query  = new CurrencyQuery();

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new CurrencyQuery()
                {
                    CurrencyCode = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionTwo.IsChecked == true)
            {
                query = new CurrencyQuery()
                {
                    CurrencyName = SearchControl.SearchTextBox.Text
                };
            }
            SearchControl.Search = Search;
            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryCurrencyAsync(query, pagesize, pagePosition);

            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <FIN_Currency>(response.Result.ToList <FIN_Currency>());;
        }
Пример #6
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var client = Helper.getServiceClient();
            HRWorkExperienceQuery query = new HRWorkExperienceQuery(); //by default we have an empty query

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new HRWorkExperienceQuery()
                {
                    EmployeeNumber = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionTwo.IsChecked == true)
            {
                query = new HRWorkExperienceQuery()
                {
                    Company = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionThree.IsChecked == true)
            {
                int value = 0;
                if (int.TryParse(SearchControl.SearchTextBox.Text, out value))
                {
                    query = new HRWorkExperienceQuery()
                    {
                        Years = value
                    };
                }
            }

            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryEMPWORKEXPERIENCEAsync(query, pagesize, pagePosition);

            //No response; exit
            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <HR_EMP_WORK_EXPERIENCE>(response.Result.ToList <HR_EMP_WORK_EXPERIENCE>());;
        }
Пример #7
0
        public static async void Search(CustomSearchControl SearchControl)
        {
            var       client = Helper.getServiceClient();
            AreaQuery query  = new AreaQuery();

            if (SearchControl.OptionOne.IsChecked == true)
            {
                query = new Service.AreaQuery()
                {
                    AreaCode = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionTwo.IsChecked == true)
            {
                query = new Service.AreaQuery()
                {
                    AreaName = SearchControl.SearchTextBox.Text
                };
            }
            else if (SearchControl.OptionThree.IsChecked == true)
            {
                query = new Service.AreaQuery()
                {
                    RegionCode = SearchControl.SearchTextBox.Text
                };
            }
            //The search control needs to know the method it has to use inorder to search. So we pass a method
            SearchControl.Search = Search;
            int pagesize     = SearchControl.PageSize;
            int pagePosition = SearchControl.PagePosition;
            var response     = await client.QueryAreaAsync(query, pagesize, pagePosition);

            //No response; exit
            if (response == null)
            {
                MessageBox.Show("Service isn't responding, please try again later", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            SearchControl.ResultCount = response.TotalResultCount;
            //Fill the datagrid with the results
            SearchControl.ResultsGrid.ItemsSource = new ObservableCollection <FIN_Area>(response.Result.ToList <FIN_Area>());;
        }