Пример #1
0
        private void boutonPlus2_Click()
        {
            ControlState(false);

            var saveFileDialog1 = new SaveFileDialog
            {
                InitialDirectory = @"C:\",
                Title            = Resources.Languages.Resources.Txt_Export_Excel_PDF,
                CheckPathExists  = true,
                Filter           = "PDF files (*.pdf)|*.pdf|Excel files (*.XLSX)|*.XLSX",
                FilterIndex      = 2,
                RestoreDirectory = true
            };

            InitWorker(bwExp_DoWork, genericBackgroundWorkerEnd);

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                _wf = new Waiting
                {
                    label       = { Text = Resources.Languages.Resources.Txt_Export },
                    progressBar = { Style = ProgressBarStyle.Marquee },
                    Wr          = _gbw
                };

                _saveAs = saveFileDialog1.FileName;

                _gbw.RunWorkerAsync(saveFileDialog1.FilterIndex);
                _wf.ShowDialog();
            }
        }
Пример #2
0
        private void applyFilter(List <string> users)
        {
            dgvDoublons.Columns["isOriginal"].Visible = true;
            if (users.Count == 0)
            {
                dgvDoublons.DataSource = _dvDoublons;//dv.RowFilter = "isDuplicate=1";
            }
            else
            {
                ControlState(false);

                InitWorker(getFiltredFiles, genericBackgroundWorkerEnd);

                _wf = new Waiting
                {
                    label       = { Text = Resources.Languages.Resources.Txt_Chargement_des_données },
                    progressBar = { Style = ProgressBarStyle.Continuous },
                    Wr          = _gbw
                };

                _gbw.RunWorkerAsync(users);
                _wf.ShowDialog();

                dgvDoublons.Columns["isOriginal"].Visible = false;
                if (dgvDoublons.Columns["Hash1"] != null)
                {
                    dgvDoublons.Columns["Hash1"].Visible = false;
                    dgvDoublons.Columns["Hash2"].Visible = false;
                }
            }

            lbNbDoublons.Text = string.Format("{0} doublon(s) détecté(s)", dgvDoublons.RowCount);
            Finalize(false);
        }
Пример #3
0
        private void initDataBase()
        {
            try
            {
                ControlState(false);

                InitWorker(dbLoad, genericBackgroundWorkerEnd);

                _wf = new Waiting
                {
                    label       = { Text = Resources.Languages.Resources.Txt_Chargement_des_données },
                    progressBar = { Style = ProgressBarStyle.Marquee },
                    Wr          = _gbw
                };

                _gbw.RunWorkerAsync();
                _wf.ShowDialog();
            }
            catch (Exception e)
            {
                MessageBox.Show(Resources.Languages.Resources.Txt_LA_Base_est_inaccessible);
                Analyser.Config.Bdd = false;
                SimpleLog.Log("Database connection error :" + e.Message, SimpleLog.Severity.Error);
            }
        }
Пример #4
0
 private void dgvDoublons_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
 {
     e.Cancel = true;
     if (_bwSupp.IsBusy)
     {
         return;
     }
     ControlState(false);
     _wf = new Waiting
     {
         label       = { Text = Resources.Languages.Resources.Txt_Suppression_des_fichiers_en_cours___ },
         progressBar = { Style = ProgressBarStyle.Continuous },
         Wr          = _bwSupp
     };
     //wf.Show();
     _bwSupp.RunWorkerAsync();
     _wf.ShowDialog();
 }
Пример #5
0
        private void startAnalyse()
        {
            SimpleLog.Log("Analyse started", SimpleLog.Severity.Info2);

            Analyser.Stats = new Stats();

            if (_jobId != null)
            {
                Analyser.Stats.JobId = _jobId;
            }

            ControlState(false);

            _currentAnalysisindexPath = 0;

            InitWorker(doAnalysisBackground, analysisBackgroundWorkerEnd);

            _wf = new Waiting
            {
                label       = { Text = Resources.Languages.Resources.Txt_Analyse_des_fichiers_en_cours___ },
                lbStatus    = { Text = Resources.Languages.Resources.Txt_Getting_File_List },
                progressBar = { Style = ProgressBarStyle.Marquee },
                Wr          = _gbw
            };

            if (Analyser.Config.Bdd)
            {
                SimpleLog.Log("Database initialisation", SimpleLog.Severity.Info);
                DataTools.DataTools.Command("Update analyse Set Status=0,isDuplicate=0,isOriginal=0;", Analyser.Config.ConnectionString);//all file taged as deleted
            }

            DisposeDataBase();

            _gbw.RunWorkerAsync();
            if (!automaticMode)
            {
                _wf.ShowDialog();
            }

            btnAnalyse.Text = Resources.Languages.Resources.Txt_Analyser;
        }
Пример #6
0
        private void btnSupp_Click()
        {
            if (_bwSupp.IsBusy == true)
            {
                return;
            }
            ControlState(false);

            InitWorker(bwSupp_DoWork, bwSupp_RunWorkerCompleted);

            _wf = new Waiting
            {
                label       = { Text = Resources.Languages.Resources.Txt_Suppression_des_fichiers_en_cours___ },
                progressBar = { Style = ProgressBarStyle.Continuous },
                Wr          = _gbw
            };

            _gbw.RunWorkerAsync();
            _wf.ShowDialog();

            Display(false);
        }
Пример #7
0
        private void btnConvertir_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            btnAnalyse.Text = Resources.Languages.Resources.Txt_Annuler;
            ControlState(false);
            InitWorker(bwConv_DoWork, genericBackgroundWorkerEnd);

            _wf = new Waiting
            {
                label       = { Text = Resources.Languages.Resources.Txt_Conversion_en_cours___ },
                progressBar = { Style = ProgressBarStyle.Continuous },
                Wr          = _gbw
            };

            _gbw.RunWorkerAsync();
            _wf.ShowDialog();

            btnAnalyse.Text = Resources.Languages.Resources.Txt_Analyser;
        }
Пример #8
0
        private void btnGraph_Click()
        {
            if (Analyser.Config.Bdd)
            {
                if (DataTools.DataTools.DefaultFactory == null)
                {
                    initDataBase();
                }

                ControlState(false);

                InitWorker(drawChart, genericBackgroundWorkerEnd);

                _wf = new Waiting
                {
                    label       = { Text = Resources.Languages.Resources.Txt_Generation_Rapport },
                    progressBar = { Style = ProgressBarStyle.Marquee },
                    Wr          = _gbw
                };

                _gbw.RunWorkerAsync();
                _wf.ShowDialog();
            }
        }