Beispiel #1
0
        private void backgroundWorker3_DoWork(object sender, DoWorkEventArgs e)
        {
            string res = "Complete!";

            try
            {
                Preatretment(e);

                SaveParamInDb svparIndb = new SaveParamInDb
                {
                    startDate   = this.startDate,
                    FileName    = openFileDialog1.FileName,
                    CrDt        = crdt,
                    UserTGA     = userTGA,
                    iMass       = this.iMass,
                    inMassOrNot = checkBox2.Checked
                };
                // вызов конструктора класса сохранения данных
                SaveInDb svdb = new SaveInDb(ref db, ref backgroundWorker2, ref svparIndb, ref listTGA);

                //вызов метода сохранения данных
                svdb.SaveDataInDB(ref backgroundWorker2);
            }
            catch (ParsingException exPar)
            {
                res = "Ошибка :" + exPar.Message + "\n" + exPar.InnerException + "\n";
            }
            finally
            {
                e.Result = res;
            }
        }
Beispiel #2
0
        //методы второго backgroundworker2 для сохранения данных
        private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
        {
            string res = "Saving is Complete!";

            try
            {
                // инициализация структуры сохранения данных
                SaveParamInDb svparIndb = new SaveParamInDb
                {
                    startDate   = this.startDate,
                    FileName    = openFileDialog1.FileName,
                    CrDt        = crdt,
                    UserTGA     = userTGA,
                    iMass       = this.iMass,
                    inMassOrNot = checkBox2.Checked
                };
                // вызов конструктора класса сохранения данных
                SaveInDb svdb = new SaveInDb(ref db, ref backgroundWorker2, ref svparIndb, ref listTGA);

                //вызов метода сохранения данных
                svdb.SaveDataInDB(ref backgroundWorker2);
            }
            catch (DataException exdb)
            {
                res = "Ошибка :" + exdb.Message + "\n" + exdb.InnerException + "\n";
            }
            finally
            {
                backgroundWorker2.ReportProgress(100, "Complete!");
                e.Result = res;
            }
        }
Beispiel #3
0
 public SaveInDb(ref TGAContex _db, ref BackgroundWorker _bgrwork, ref SaveParamInDb _svPar, ref List <List <double> > _slTGA)
 {
     locDb   = _db;
     bgrwork = _bgrwork;
     svPar   = _svPar;
     slTGA   = _slTGA;
 }