Ejemplo n.º 1
0
        public frmOptionsDialog( EmdrConfig _cfg)
        {
            dcd = new DataConnectionDialog();

            InitializeComponent();

            dcd.ConnectionString = _cfg.Attr.DataSource;
            tbDataBaseConnName.Text = _cfg.Attr.DataSource;
            tbHistTrimDays.Text = _cfg.Attr.TrimHistDays.ToString();
            tbOrdTrimDays.Text = _cfg.Attr.TrimOrdersDays.ToString();
            cbEmdrServer.Text = _cfg.Attr.EMDRServer;
            cbMergeDuplicates.Checked = _cfg.Attr.MergeDuplicates;
        }
Ejemplo n.º 2
0
        public frmEMDRGatherer()
        {
            edl = new emdrDl();
            bw = new BackgroundWorker();
            trimBw = new BackgroundWorker();

            InitializeComponent();

            config = new EmdrConfig();

            if (config.CfgState != ConfigState.ConfigLoaded)
            {
                DialogResult res;
                while (OpenOptionDialog() != ConfigState.ConfigLoaded)
                {
                    res = MessageBox.Show(this, "Configuation is Invalid. Please complete the configuration to continue. Press OK to try again or cancel to close the program"
                        , "Invalid Configuration",
                        MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

                    if (res == DialogResult.Cancel)
                    {
                        this.Close();
                    }
                }
                btnStartCapture.Enabled = true;
            }
            else
            {
                btnStartCapture.Enabled = true;
            }

            bw.WorkerSupportsCancellation = true;
            bw.WorkerReportsProgress = true;
            bw.DoWork += new DoWorkEventHandler(edl.getMarketData);
            bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            trimBw.WorkerSupportsCancellation = true;
            trimBw.DoWork += new DoWorkEventHandler(edl.trimOrderData);
        }