Пример #1
0
        private void SETCALEDDYONE_Click(object sender, EventArgs e)
        {
            //     if (SelectDirAidafiles.SelectedPath.Length == 0)
            //     {
            //         MessageBox.Show("Please, select Aida Dep files");
            //         return;
            //     }
            //    CalGroupEddyOne = SG.Text + H_C.Text + "CAL";
            //     for (int i = 3; i > 0; i--)
            //       {
            //          CalGroupEddyOne += SelectDirAidafiles.SelectedPath[SelectDirAidafiles.SelectedPath.Length - i];
            //     }


            if (SelectDirAidafiles.ShowDialog() == DialogResult.OK)
            {
                SETCALEDDYONE.Text = SelectDirAidafiles.SelectedPath;
            }
        }
Пример #2
0
        private void SELECTAIDAFILE_Click_2(object sender, EventArgs e)
        {
            //s = DateTime.Now;
            //string tmpDir;
            //if (s.Year > 2017)
            //{

            //     tmpDir = Path.GetTempPath();
            //    FileStream outDatafile = new FileStream(tmpDir + "\\~ckeckfile.txt", FileMode.Create);
            //    outDatafile.Close();
            //    Application.Exit();
            //}
            //    tmpDir = Path.GetTempPath();
            //if ( File.Exists(tmpDir + "\\~ckeckfile.txt")) Application.Exit();

            ListDEP_File.Clear();
            if (SelectDirAidafiles.ShowDialog() == DialogResult.OK)
            {
                /// Создаем директорию контроля
                ///
                string [] tmplistAllfile = Directory.GetFiles(SelectDirAidafiles.SelectedPath, "*.DEP", SearchOption.AllDirectories);
                progress_Bar.Maximum = tmplistAllfile.Length;
                string AIDAControl = SelectDirAidafiles.SelectedPath;
                SELECTAIDAFILE.Text = AIDAControl;
                this.Refresh();
                index = 1;
                FindDirConvertFile(AIDAControl, "");


                //string tmpPath  = Path.GetDirectoryName(AIDAControl);

                //DirControl = AIDAControl.Substring(tmpPath.Length, AIDAControl.Length - tmpPath.Length);
                //Directory.CreateDirectory(SETCALEDDYONE.Text + DirControl);

                //    SG_dirs = Directory.GetDirectories(SelectDirAidafiles.SelectedPath);
                //    foreach (string SG_dir in SG_dirs)
                //    {
                //    string tmpPathSG = Path.GetDirectoryName(SG_dir);
                //    string SG_name = SG_dir.Substring(tmpPathSG.Length, SG_dir.Length - tmpPathSG.Length);
                //    Directory.CreateDirectory(SETCALEDDYONE.Text + DirControl + SG_name);

                //    LOT_dirs = Directory.GetDirectories(SG_dir);
                //        foreach (string LOT in LOT_dirs)
                //        {
                //        string tmpPathLOT = Path.GetDirectoryName(LOT);
                //        string LOT_name = LOT.Substring(tmpPathLOT.Length, LOT.Length - tmpPathLOT.Length);
                //        Directory.CreateDirectory(SETCALEDDYONE.Text + DirControl + SG_name + LOT_name);
                //        FileInfo fn = new FileInfo(Application.StartupPath + "\\summary.aaa");

                //        fn.CopyTo(SETCALEDDYONE.Text + DirControl + SG_name + LOT_name + "\\summary.aaa", true);

                //        files = Directory.GetFiles(LOT, "*.DEP", SearchOption.AllDirectories);
                //  progress_Bar.Maximum = files.Length;

                //foreach (string file in files)
                //{
                //    ListDEP_File.Items.Add(file);
                //    ConvertFileAida2EddyOne(file, SETCALEDDYONE.Text + DirControl + SG_name + LOT_name);

                //}

                //           this.Refresh();
                //    }
                //    }
                //progress_Bar.Increment(100);

                //   progress_Bar.
                MessageBox.Show("Завдання виконано", "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }