private void cboSelectCategory_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int intSelectedIndex;

            try
            {
                intSelectedIndex = cboSelectCategory.SelectedIndex - 2;

                if (intSelectedIndex == -1)
                {
                    TheFindAvailableActiveToolsDataSet = TheToolsClass.FindAvailableActiveTools();

                    dgrResults.ItemsSource = TheFindAvailableActiveToolsDataSet.FindAvailableActiveTools;
                }
                else if (intSelectedIndex > -1)
                {
                    ThefindAvailableActiveToolsByCategoryDataSet = TheToolsClass.FindAvailableActiveToolsByCategory(TheFindSortedToolCategoryDataSet.FindSortedToolCategory[intSelectedIndex].ToolCategory);

                    dgrResults.ItemsSource = ThefindAvailableActiveToolsByCategoryDataSet.FindAvailableActiveToolsByCategory;
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Find Available Tools // cbo Select Category Selection Changed " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public FindAvailableActiveToolsDataSet FindAvailableActiveTools()
        {
            try
            {
                aFindAvailableActiveToolsDataSet      = new FindAvailableActiveToolsDataSet();
                aFindAvailableActiveToolsTableAdapter = new FindAvailableActiveToolsDataSetTableAdapters.FindAvailableActiveToolsTableAdapter();
                aFindAvailableActiveToolsTableAdapter.Fill(aFindAvailableActiveToolsDataSet.FindAvailableActiveTools);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Tools Class // Find Available Active Tools " + Ex.Message);
            }

            return(aFindAvailableActiveToolsDataSet);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int intCounter;
            int intNumberOfRecords;

            TheFindAvailableActiveToolsDataSet = TheToolsClass.FindAvailableActiveTools();

            dgrResults.ItemsSource = TheFindAvailableActiveToolsDataSet.FindAvailableActiveTools;

            TheFindSortedToolCategoryDataSet = TheToolCategoryClass.FindSortedToolCategory();

            intNumberOfRecords = TheFindSortedToolCategoryDataSet.FindSortedToolCategory.Rows.Count - 1;

            cboSelectCategory.Items.Add("Select Tool Category");
            cboSelectCategory.Items.Add("All Tool Categories");

            for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
            {
                cboSelectCategory.Items.Add(TheFindSortedToolCategoryDataSet.FindSortedToolCategory[intCounter].ToolCategory);
            }

            cboSelectCategory.SelectedIndex = 0;
        }