Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32262/b5_Presentation/Reporting/WindowsForm
Modified Files:
ReportShower.cs
Log Message:
Added try/catch blocks, to avoid run time errors;
added code to retrieve at open the date of the last trade in report
Index: ReportShower.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/ReportShower.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ReportShower.cs 12 Feb 2005 19:02:02 -0000 1.1
--- ReportShower.cs 13 Mar 2005 23:38:40 -0000 1.2
***************
*** 44,48 ****
private Report report;
private System.Windows.Forms.Label label4;
! private System.Windows.Forms.TextBox index;
/// <summary>
--- 44,48 ----
private Report report;
private System.Windows.Forms.Label label4;
! private System.Windows.Forms.TextBox benchmark;
/// <summary>
***************
*** 60,63 ****
--- 60,64 ----
//
this.report = report;
+ this.endingDate.Value = this.report.GetLastTradeDate();
//
}
***************
*** 93,97 ****
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
! this.index = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.numDaysForEquityLine)).BeginInit();
this.SuspendLayout();
--- 94,98 ----
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
! this.benchmark = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.numDaysForEquityLine)).BeginInit();
this.SuspendLayout();
***************
*** 168,180 ****
this.label4.Size = new System.Drawing.Size(96, 16);
this.label4.TabIndex = 8;
! this.label4.Text = "Index";
//
! // index
//
! this.index.Location = new System.Drawing.Point(106, 160);
! this.index.Name = "index";
! this.index.Size = new System.Drawing.Size(176, 20);
! this.index.TabIndex = 7;
! this.index.Text = "";
//
// ReportShower
--- 169,181 ----
this.label4.Size = new System.Drawing.Size(96, 16);
this.label4.TabIndex = 8;
! this.label4.Text = "Benchmark";
//
! // benchmark
//
! this.benchmark.Location = new System.Drawing.Point(106, 160);
! this.benchmark.Name = "benchmark";
! this.benchmark.Size = new System.Drawing.Size(176, 20);
! this.benchmark.TabIndex = 7;
! this.benchmark.Text = "";
//
// ReportShower
***************
*** 184,188 ****
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label4,
! this.index,
this.label3,
this.label2,
--- 185,189 ----
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label4,
! this.benchmark,
this.label3,
this.label2,
***************
*** 202,211 ****
private void buttonShowReport_Click(object sender, System.EventArgs e)
{
! this.report.Clear();
! this.report.Show(this.reportName.Text, (int)this.numDaysForEquityLine.Value,
! new EndOfDayDateTime(this.endingDate.Value,
! EndOfDaySpecificTime.MarketClose),
! this.index.Text);
!
}
}
--- 203,221 ----
private void buttonShowReport_Click(object sender, System.EventArgs e)
{
! try
! {
! if(this.benchmark.Text == "")
! throw new Exception("Benchmark symbol is requested!");
! this.report.Clear();
! this.report.Show(this.reportName.Text, (int)this.numDaysForEquityLine.Value,
! new EndOfDayDateTime(this.endingDate.Value,
! EndOfDaySpecificTime.MarketClose),
! this.benchmark.Text);
! }
!
! catch(Exception ex)
! {
! MessageBox.Show(ex.ToString());
! }
}
}
|