예제 #1
0
        private void replaceDriveLetterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Drive_Letter l = new Drive_Letter();

            l.ShowDialog(); // waits for user input

            sql_replace_drive_letter(l.get_drive_letter());
        }
예제 #2
0
        private void addNewPartsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("This will search all BOM *.xlsx files for parts and may take a while. Are you sure you would like to continue?", "Warning", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                List <string> dirs = sql_get_dirs_list();

                // Verify paths
                if (dirs.Count > 0)
                {
                    string test_path = dirs[0].ToString();
                    test_path = test_path.Substring(0, test_path.LastIndexOf('\\'));



                    if (Directory.Exists(test_path))
                    {
                        pbMain.Visible = true;

                        // Initialize progress bar
                        pbMain.Maximum = dirs.Count;
                        pbMain.Step    = 1;
                        pbMain.Value   = 0;

                        backgroundWorkerAddParts.RunWorkerAsync();
                    }
                    else
                    {
                        dialogResult = MessageBox.Show("Directory cannot be found, would you like to replace the drive letter?", "Warning", MessageBoxButtons.YesNo);
                        if (dialogResult == DialogResult.Yes)
                        {
                            // Replace drive letter
                            Drive_Letter l = new Drive_Letter();
                            l.ShowDialog(); // waits for user input

                            sql_replace_drive_letter(l.get_drive_letter());
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Warning", "No directories currently found. Please run a directory search.");
                }
            }
        }