Example #1
0
 public MainWindowViewModel()
 {
     _connCfg.LoadConfiguration();
     this._nNewRestPoint = 0;
     // this._dTimePre = DateTime.Now.ToString("yyyyMM");
     DataProcessor  = new DataProcessLogic(this._connCfg);
     RunConnSetting = new RelayCommand(o => ConnSetting(), o => canConnSetting());
     Initializer();
     Console.WriteLine("Skip");
 }
        public ConnSetting(ConnectionConfig connCfg, DataProcessLogic DataProcessor)
            : this()
        {
            this.DialogResult   = null;
            this._connCfg       = connCfg;
            this._dataProcessor = DataProcessor;
            //this.nLastAlarmRecIndex = DataProcessor.mAlarmList.nLastAlarmRecIndex;

            this.txtServer.Text        = _connCfg.Server;
            this.txtLogin.Text         = _connCfg.Login;
            this.txtPassword.Password  = _connCfg.Password;
            this.txtSelectedDB.Content = _connCfg.Database;
            this.txtCSVPath.Text       = _connCfg.CsvDirectory;
            this.lblCsvFile.Content    = _connCfg.CsvFile;

            this.database      = _connCfg.Database;
            this.fileDirectory = _connCfg.CsvDirectory;

            this.openFolderDialog = new OpenFileDialog();
            this.openFolderDialog.ValidateNames   = false;
            this.openFolderDialog.CheckFileExists = false;
            this.openFolderDialog.CheckPathExists = true;
        }