Example #1
0
        public productionReport()
        {
            InitializeComponent();

            //list Production reports in a given directory
            DirectoryInfo dinfo = new DirectoryInfo(@"..\..\..\..\..\Reports\Production Reports");

            FileInfo[] Files = dinfo.GetFiles();

            //file list to string for filter purposes
            var fileList = Files.ToList();

            //show all files before filtering
            listBox.ItemsSource = fileList;

            //pull parts list from the database
            GCIDB.Initialize();
            GCIDB.OpenConnection();
            partNames = GCIDB.GetPartList();
            partName_listBox1.ItemsSource = partNames;

            //create view then filter, doesnt includes batch view, which is changed in the
            System.ComponentModel.ICollectionView view = CollectionViewSource.GetDefaultView(listBox.ItemsSource);
            view.Filter = CustomFilter;

            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(partName_listBox1.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
        public lifetimeReport()
        {
            InitializeComponent();

            DirectoryInfo dinfo = new DirectoryInfo(@"..\..\..\..\..\Reports\Lifetime Reports");

            FileInfo[] Files = dinfo.GetFiles();

            //file list to string for filter purposes
            var fileList = Files.ToList();

            //show all files before filtering
            files_listbox.ItemsSource = fileList;

            //get part names
            GCIDB.Initialize();
            GCIDB.OpenConnection();
            partNames = GCIDB.GetPartList();
            partName_listbox.ItemsSource = partNames;

            System.ComponentModel.ICollectionView file_view = CollectionViewSource.GetDefaultView(files_listbox.ItemsSource);
            file_view.Filter = files_CustomFilter;

            //filter for partnames
            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(partName_listbox.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
Example #3
0
        public TestEditor()
        {
            InitializeComponent();


            GCIDB.Initialize();
            GCIDB.OpenConnection();
            List <string> partNames = GCIDB.GetPartList();

            part_listBox.ItemsSource = partNames;

            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(part_listBox.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
Example #4
0
        private void delete_button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show($"name: , board: {SelectedPartName.Length}, {SelectedBoardName.Length}");
            if (SelectedPartName.Length > 0 && SelectedBoardName.Length > 0)
            {
                GCIDB.DeleteBoard(SelectedPartName, SelectedBoardName);
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                List <string> partNames = GCIDB.GetPartList();
                part_listBox.ItemsSource = partNames;

                System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(part_listBox.ItemsSource);
                partName_view.Filter = partName_CustomFilter;
            }
        }
Example #5
0
 private void part_listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (part_listBox.SelectedIndex == -1)
     {
         MessageBox.Show("Select a Part Name!");
     }
     else
     {
         //pull batch names from the DB, then render the view for filtering
         SelectedPartName = part_listBox.SelectedItem.ToString();
         GCIDB.Initialize();
         GCIDB.OpenConnection();
         List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName);
         SelectedBoardName = string.Empty;
         testBoardList1.ClearPins();
         selectBoard_listBox.ItemsSource = boardNames;
     }
 }
Example #6
0
        private void batchName_listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (batchName_listBox1.SelectedIndex == -1)
            {
                MessageBox.Show("Select a Batch Name!");
            }
            else
            {
                SelectedBatchName = batchName_listBox1.SelectedItem.ToString();
                // MessageBox.Show(string.Format("Pulling Legacy Report for Part ID: {0}  Batch ID: {1}", SelectedPartName, SelectedBatchName));

                //connect to DB, get production data then return into datatable
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                dt = GCIDB.GetProductionData(SelectedPartName, SelectedBatchName);
                dataGrid.DataContext = dt;
            }
        }
        private void partName_listbox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (partName_listbox.SelectedIndex == -1)
            {
                MessageBox.Show("Select a Part Name!");
            }
            else
            {
                //pull batch names from the DB, then render the view for filtering
                SelectedPartName = partName_listbox.SelectedItem.ToString();
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                batchNames = GCIDB.GetBatchNameList(SelectedPartName);
                batchName_listbox.ItemsSource = batchNames;

                System.ComponentModel.ICollectionView batchName_view = CollectionViewSource.GetDefaultView(batchName_listbox.ItemsSource);
                batchName_view.Filter = batchName_CustomFilter;
            }
        }
Example #8
0
        private void selectBoard_listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (selectBoard_listBox.Items.Count > 0)
            {
                if (selectBoard_listBox.SelectedItem == null)
                {
                    return;
                }

                if (SelectedBoardName == selectBoard_listBox.SelectedItem.ToString())
                {
                    return;
                }
                SelectedBoardName = selectBoard_listBox.SelectedItem.ToString();

                LoadedTestInfo = GCIDB.GetTestPins(SelectedPartName, SelectedBoardName);
                testBoardList1.ClearPins();
                //  test
                String LastDeviceName = string.Empty;
                foreach (TestPinEntity Pin in LoadedTestInfo)
                {
                    if (LastDeviceName.Length > 0 && (LastDeviceName != Pin.SocketName))
                    {
                        testBoardList1.ExtraSpace += 20;
                    }

                    testBoardList1.AddPinMap(Pin);
                    LastDeviceName = Pin.SocketName;
                }

                SelectedPartName = part_listBox.SelectedItem.ToString();
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName);
                SelectedBoardName = string.Empty;
                selectBoard_listBox.ItemsSource = boardNames;

                SelectedBoardName = selectBoard_listBox.SelectedItem.ToString();
            }
        }
        private void serialNumbers_listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // List<string> SerialNumbers = GetSelectedSerialNumbers();
            //Show that the Button is functioning
            //MessageBox.Show(string.Format("Pulling Legacy Report for Part ID: {0}  Batch ID: {1} and Serial Number: {2}", SelectedPartName, SelectedBatchName, SelectedSerialNumbers));
            GCIDB.Initialize();
            GCIDB.OpenConnection();

            List <String> SerialNumbers = GetSelectedSerialNumbers();

            if (SerialNumbers.Count == 0)
            {
                MessageBox.Show("Please select serial numbers.");
                return;
            }
            DataTable           dtResult       = GCIDB.GetLifetimeData(SelectedPartName, SelectedBatchName, SerialNumbers);
            LifetimeLimitEntity Limits         = GCIDB.GetLifetimeLimits(SelectedPartName);
            LifeTimeReportData  LifetimeReport = new LifeTimeReportData(dtResult, Limits);

            //dt = GCIDB.GetLifetimeData(SelectedPartName, SelectedBatchName, SelectedSerialNumbers);
            dataGrid.DataContext = dtResult;
        }