[Quantproject-developers] QuantDownloader/Downloader/TickerSelectors TickerViewer.cs,1.6,1.7
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-09-11 15:36:10
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18632/Downloader/TickerSelectors Modified Files: TickerViewer.cs Log Message: Added filter on group. Now, it is also possible to skip one or more filters by choosing null values in combo boxes. Index: TickerViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerViewer.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TickerViewer.cs 13 Feb 2005 11:44:51 -0000 1.6 --- TickerViewer.cs 11 Sep 2005 15:36:02 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- using QuantProject.Data.DataTables; using QuantProject.Data.Selectors; + using QuantProject.ADT; namespace QuantProject.Applications.Downloader.TickerSelectors *************** *** 64,70 **** private System.Windows.Forms.Button buttonViewFaultyTickers; private System.Windows.Forms.Label label4; private bool skipRowChangedEvent;// event must be launched only by // user's changes ! public TickerViewer() { InitializeComponent(); --- 65,74 ---- private System.Windows.Forms.Button buttonViewFaultyTickers; private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.ComboBox comboBoxBelongingGroup; private bool skipRowChangedEvent;// event must be launched only by // user's changes ! ! public TickerViewer() { InitializeComponent(); *************** *** 73,76 **** --- 77,81 ---- this.dataGrid1.DataSource = this.tableTickers; this.AcceptButton = this.buttonFindTickers; + } *************** *** 106,110 **** --- 111,119 ---- this.label2 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); + this.label4 = new System.Windows.Forms.Label(); + this.buttonViewFaultyTickers = new System.Windows.Forms.Button(); this.groupBoxDateQuoteFilter = new System.Windows.Forms.GroupBox(); + this.comboBoxBelongingGroup = new System.Windows.Forms.ComboBox(); + this.label8 = new System.Windows.Forms.Label(); this.comboBoxSecondOperator = new System.Windows.Forms.ComboBox(); this.comboBoxFirstOperator = new System.Windows.Forms.ComboBox(); *************** *** 117,122 **** this.radioButtonAnyTicker = new System.Windows.Forms.RadioButton(); this.splitter1 = new System.Windows.Forms.Splitter(); - this.buttonViewFaultyTickers = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.panel2.SuspendLayout(); --- 126,129 ---- *************** *** 164,168 **** // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(152, 224); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(104, 24); --- 171,175 ---- // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(152, 264); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(104, 24); *************** *** 207,213 **** --- 214,240 ---- this.panel2.TabIndex = 7; // + // label4 + // + this.label4.Location = new System.Drawing.Point(24, 304); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(352, 16); + this.label4.TabIndex = 16; + this.label4.Text = "________________________________________"; + this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // buttonViewFaultyTickers + // + this.buttonViewFaultyTickers.Location = new System.Drawing.Point(144, 336); + this.buttonViewFaultyTickers.Name = "buttonViewFaultyTickers"; + this.buttonViewFaultyTickers.Size = new System.Drawing.Size(120, 24); + this.buttonViewFaultyTickers.TabIndex = 15; + this.buttonViewFaultyTickers.Text = "&View faulty Tickers"; + this.buttonViewFaultyTickers.Click += new System.EventHandler(this.buttonViewFaultyTickers_Click); + // // groupBoxDateQuoteFilter // this.groupBoxDateQuoteFilter.Controls.AddRange(new System.Windows.Forms.Control[] { + this.comboBoxBelongingGroup, + this.label8, this.comboBoxSecondOperator, this.comboBoxFirstOperator, *************** *** 221,233 **** this.groupBoxDateQuoteFilter.Location = new System.Drawing.Point(8, 80); this.groupBoxDateQuoteFilter.Name = "groupBoxDateQuoteFilter"; ! this.groupBoxDateQuoteFilter.Size = new System.Drawing.Size(384, 136); this.groupBoxDateQuoteFilter.TabIndex = 14; this.groupBoxDateQuoteFilter.TabStop = false; this.groupBoxDateQuoteFilter.Text = "Quote filter"; // // comboBoxSecondOperator // this.comboBoxSecondOperator.Enabled = false; this.comboBoxSecondOperator.Items.AddRange(new object[] { "<=", ">="}); --- 248,279 ---- this.groupBoxDateQuoteFilter.Location = new System.Drawing.Point(8, 80); this.groupBoxDateQuoteFilter.Name = "groupBoxDateQuoteFilter"; ! this.groupBoxDateQuoteFilter.Size = new System.Drawing.Size(384, 168); this.groupBoxDateQuoteFilter.TabIndex = 14; this.groupBoxDateQuoteFilter.TabStop = false; this.groupBoxDateQuoteFilter.Text = "Quote filter"; // + // comboBoxBelongingGroup + // + this.comboBoxBelongingGroup.Enabled = false; + this.comboBoxBelongingGroup.Location = new System.Drawing.Point(200, 128); + this.comboBoxBelongingGroup.Name = "comboBoxBelongingGroup"; + this.comboBoxBelongingGroup.Size = new System.Drawing.Size(176, 21); + this.comboBoxBelongingGroup.TabIndex = 24; + this.comboBoxBelongingGroup.Text = "comboBox1"; + // + // label8 + // + this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.label8.Location = new System.Drawing.Point(24, 136); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(120, 16); + this.label8.TabIndex = 23; + this.label8.Text = "belonging to group"; + // // comboBoxSecondOperator // this.comboBoxSecondOperator.Enabled = false; this.comboBoxSecondOperator.Items.AddRange(new object[] { + "", "<=", ">="}); *************** *** 236,240 **** this.comboBoxSecondOperator.Size = new System.Drawing.Size(48, 21); this.comboBoxSecondOperator.TabIndex = 22; ! this.comboBoxSecondOperator.Text = "<="; // // comboBoxFirstOperator --- 282,286 ---- this.comboBoxSecondOperator.Size = new System.Drawing.Size(48, 21); this.comboBoxSecondOperator.TabIndex = 22; ! this.comboBoxSecondOperator.SelectedValueChanged += new System.EventHandler(this.comboBoxSecondOperator_SelectedValueChanged); // // comboBoxFirstOperator *************** *** 242,245 **** --- 288,292 ---- this.comboBoxFirstOperator.Enabled = false; this.comboBoxFirstOperator.Items.AddRange(new object[] { + "", "<=", ">="}); *************** *** 248,252 **** this.comboBoxFirstOperator.Size = new System.Drawing.Size(48, 21); this.comboBoxFirstOperator.TabIndex = 21; ! this.comboBoxFirstOperator.Text = ">="; // // label7 --- 295,299 ---- this.comboBoxFirstOperator.Size = new System.Drawing.Size(48, 21); this.comboBoxFirstOperator.TabIndex = 21; ! this.comboBoxFirstOperator.SelectedValueChanged += new System.EventHandler(this.comboBoxFirstOperator_SelectedValueChanged); // // label7 *************** *** 321,342 **** this.splitter1.TabStop = false; // - // buttonViewFaultyTickers - // - this.buttonViewFaultyTickers.Location = new System.Drawing.Point(144, 296); - this.buttonViewFaultyTickers.Name = "buttonViewFaultyTickers"; - this.buttonViewFaultyTickers.Size = new System.Drawing.Size(120, 24); - this.buttonViewFaultyTickers.TabIndex = 15; - this.buttonViewFaultyTickers.Text = "&View faulty Tickers"; - this.buttonViewFaultyTickers.Click += new System.EventHandler(this.buttonViewFaultyTickers_Click); - // - // label4 - // - this.label4.Location = new System.Drawing.Point(24, 264); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(352, 16); - this.label4.TabIndex = 16; - this.label4.Text = "________________________________________"; - this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // // TickerViewer // --- 368,371 ---- *************** *** 496,501 **** else //all tickers with first date quote and last date quote within a specified interval { ! this.tableTickers = Tickers.GetTableOfFilteredTickers(this.textBoxStringToFind.Text, this.textBoxStringToFindInName.Text, this.comboBoxFirstOperator.Text, --- 525,533 ---- else //all tickers with first date quote and last date quote within a specified interval + //(and, if specified, belonging to a given group) { ! if(((string)this.comboBoxBelongingGroup.SelectedValue).Length == 0) ! //no group has been selected ! this.tableTickers = Tickers.GetTableOfFilteredTickers(this.textBoxStringToFind.Text, this.textBoxStringToFindInName.Text, this.comboBoxFirstOperator.Text, *************** *** 503,506 **** --- 535,546 ---- this.comboBoxSecondOperator.Text, this.dateTimePickerLastDate.Value); + else + this.tableTickers = Tickers.GetTableOfFilteredTickers(this.textBoxStringToFind.Text, + this.textBoxStringToFindInName.Text, + this.comboBoxFirstOperator.Text, + this.dateTimePickerFirstDate.Value, + this.comboBoxSecondOperator.Text, + this.dateTimePickerLastDate.Value, + (string)this.comboBoxBelongingGroup.SelectedValue); this.dataGrid1.DataSource = this.tableTickers; this.setStyle_dataGridWithQuoteInfo(); *************** *** 552,564 **** } } private void radioButtonDateQuoteFilter_CheckedChanged(object sender, System.EventArgs e) { if(this.radioButtonDateQuoteFilter.Checked == true) { - this.dateTimePickerFirstDate.Enabled = true; - this.dateTimePickerLastDate.Enabled = true; this.comboBoxFirstOperator.Enabled = true; this.comboBoxSecondOperator.Enabled = true; } else --- 592,624 ---- } } + private void radioButtonDateQuoteFilter_checkedChanged_fillComboBoxBelongingGroup() + { + if(this.comboBoxBelongingGroup.DataSource == null) + //data source not set yet + { + DataTable groups = SqlExecutor.GetDataTable("SELECT tgId AS GroupID, tgDescription AS GroupDescription FROM tickerGroups " + + "UNION " + + "SELECT '' AS GroupID, '' AS GroupDescription FROM tickerGroups " + + "ORDER BY GroupDescription"); + this.comboBoxBelongingGroup.DataSource = groups; + this.comboBoxBelongingGroup.DisplayMember = "GroupDescription"; + this.comboBoxBelongingGroup.ValueMember = "GroupID"; + } + + } private void radioButtonDateQuoteFilter_CheckedChanged(object sender, System.EventArgs e) { if(this.radioButtonDateQuoteFilter.Checked == true) { this.comboBoxFirstOperator.Enabled = true; + this.comboBoxFirstOperator.Text = ""; this.comboBoxSecondOperator.Enabled = true; + this.comboBoxSecondOperator.Text = ""; + this.comboBoxBelongingGroup.Enabled = true; + this.radioButtonDateQuoteFilter_checkedChanged_fillComboBoxBelongingGroup(); + this.comboBoxBelongingGroup.Text = ""; + + } else *************** *** 568,571 **** --- 628,632 ---- this.comboBoxFirstOperator.Enabled = false; this.comboBoxSecondOperator.Enabled = false; + this.comboBoxBelongingGroup.Enabled = false; } } *************** *** 658,661 **** --- 719,738 ---- } + private void comboBoxFirstOperator_SelectedValueChanged(object sender, System.EventArgs e) + { + if(this.comboBoxFirstOperator.Text.Length > 0) + this.dateTimePickerFirstDate.Enabled = true; + else + this.dateTimePickerFirstDate.Enabled = false; + } + + private void comboBoxSecondOperator_SelectedValueChanged(object sender, System.EventArgs e) + { + if(this.comboBoxSecondOperator.Text.Length > 0) + this.dateTimePickerLastDate.Enabled = true; + else + this.dateTimePickerLastDate.Enabled = false; + } + } |