Пример #1
0
        private void InitializeComboBox()
        {
            // Load machine list data and assign to combobox
            List <string> machineData = SqliteDataAcces.LoadListData("Machine", "Tools");

            machineData = machineData.OrderBy(q => q).Distinct().ToList();
            machineComboBox.ItemsSource = machineData;

            // Load type list data and assign to combobox
            List <string> typeData = SqliteDataAcces.LoadComboBoxData("Type", "Machine", machineComboBox.Text);

            typeData = typeData.OrderBy(q => q).Distinct().ToList();
            typeComboBox.ItemsSource = typeData;

            // Load type list data and assign to combobox
            List <string> functionData = SqliteDataAcces.LoadComboBoxData("Function", "Type", typeComboBox.Text);

            functionData = functionData.OrderBy(q => q).Distinct().ToList();
            functionComboBox.ItemsSource = functionData;
        }
Пример #2
0
        private void InitializeVendorComboBox()
        {
            // Load function list data and assign to combobox
            List <string> holderVendorData    = SqliteDataAcces.LoadListData("HolderVendor", "Tools");
            List <string> extensionVendorData = SqliteDataAcces.LoadListData("ExtensionVendor", "Tools");
            List <string> toolVendorData      = SqliteDataAcces.LoadListData("ToolVendor", "Tools");

            // Combine vendorData
            var vendorData = holderVendorData.Concat(extensionVendorData)
                             .Concat(toolVendorData)
                             .ToList();

            // Sort data and Remove duplicates
            vendorData = vendorData.OrderBy(q => q).Distinct().ToList();

            // Assign data to vendor comboboxes
            HolderVendorComboBox.ItemsSource    = vendorData;
            ExtensionVendorComboBox.ItemsSource = vendorData;
            ToolVendorComboBox.ItemsSource      = vendorData;
        }
Пример #3
0
        //
        // ---Handle Comboboxes---
        //
        private void InitializeComboBox()
        {
            // Load Type list data and assign to combobox
            List <string> typeData = SqliteDataAcces.LoadListData("ToolType", "ToolTypes");

            typeData = typeData.OrderBy(q => q).Distinct().ToList();
            TypeComboBox.ItemsSource = typeData;

            // Load Holder list data and assign to combobox
            List <string> holderData = SqliteDataAcces.LoadListData("HolderName", "Holders");

            holderData = holderData.OrderBy(q => q).Distinct().ToList();
            HolderComboBox.ItemsSource = holderData;

            // Load machine list data and assign to combobox
            List <string> machineData = SqliteDataAcces.LoadListData("MachineName", "Machines");

            machineData = machineData.OrderBy(q => q).Distinct().ToList();
            MachineComboBox.ItemsSource = machineData;

            // Load function list data and assign to combobox
            List <string> holderVendorData    = SqliteDataAcces.LoadListData("HolderVendor", "Tools");
            List <string> extensionVendorData = SqliteDataAcces.LoadListData("ExtensionVendor", "Tools");
            List <string> toolVendorData      = SqliteDataAcces.LoadListData("ToolVendor", "Tools");

            // Combine vendorData
            var vendorData = holderVendorData.Concat(extensionVendorData)
                             .Concat(toolVendorData)
                             .ToList();

            // Sort data and Remove duplicates
            vendorData = vendorData.OrderBy(q => q).Distinct().ToList();

            // Assign data to vendor comboboxes
            HolderVendorComboBox.ItemsSource    = vendorData;
            ExtensionVendorComboBox.ItemsSource = vendorData;
            ToolVendorComboBox.ItemsSource      = vendorData;
        }