From 63c12958f7f3dcbbf1d5511cd1983d8f5500b6ee Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 18 Mar 2016 15:53:33 +0800 Subject: [PATCH] ResultsBrowser: RBrowserWnd added, ver. RB2.4.250. --- .../Forms/DatabaseSettings.Designer.cs | 12 +- ResultsBrowser/Program.cs | 7 + ResultsBrowser/Properties/AssemblyInfo.cs | 4 +- ResultsBrowser/RBrowserWnd.Designer.cs | 577 ++++++++++++++++++ ResultsBrowser/RBrowserWnd.cs | 527 ++++++++++++++++ ResultsBrowser/RBrowserWnd.resx | 120 ++++ ResultsBrowser/ResultsBrowser.csproj | 9 + 7 files changed, 1248 insertions(+), 8 deletions(-) create mode 100644 ResultsBrowser/RBrowserWnd.Designer.cs create mode 100644 ResultsBrowser/RBrowserWnd.cs create mode 100644 ResultsBrowser/RBrowserWnd.resx diff --git a/ResultsBrowser/Forms/DatabaseSettings.Designer.cs b/ResultsBrowser/Forms/DatabaseSettings.Designer.cs index 43b6d8088..8239bc0c0 100644 --- a/ResultsBrowser/Forms/DatabaseSettings.Designer.cs +++ b/ResultsBrowser/Forms/DatabaseSettings.Designer.cs @@ -50,18 +50,18 @@ this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(26, 26); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(38, 13); + this.label1.Size = new System.Drawing.Size(39, 13); this.label1.TabIndex = 1; - this.label1.Text = "WR10"; + this.label1.Text = "PT300"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(26, 52); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(38, 13); + this.label2.Size = new System.Drawing.Size(39, 13); this.label2.TabIndex = 3; - this.label2.Text = "WR11"; + this.label2.Text = "PT150"; // // textBox11 // @@ -75,9 +75,9 @@ this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(26, 78); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(38, 13); + this.label3.Size = new System.Drawing.Size(33, 13); this.label3.TabIndex = 5; - this.label3.Text = "WR12"; + this.label3.Text = "PT50"; // // textBox12 // diff --git a/ResultsBrowser/Program.cs b/ResultsBrowser/Program.cs index f02e6be40..5aa5b284e 100644 --- a/ResultsBrowser/Program.cs +++ b/ResultsBrowser/Program.cs @@ -31,6 +31,7 @@ namespace ResultsBrowser /// Main window object. /// public static MainWnd MainWnd; + public static RBrowserWnd RBrowserWnd; /// @@ -137,9 +138,15 @@ namespace ResultsBrowser { /// Open the main application window log.Info("Creating the main window"); +#if IPERLST MainWnd = new MainWnd(); log.Info("Opening the main window"); Application.Run(MainWnd); +#else + RBrowserWnd = new RBrowserWnd(); + log.Info("Opening the main window"); + Application.Run(RBrowserWnd); +#endif log.Info("The main window was closed"); } catch (Exception e) diff --git a/ResultsBrowser/Properties/AssemblyInfo.cs b/ResultsBrowser/Properties/AssemblyInfo.cs index 3a479adcc..a56d55979 100644 --- a/ResultsBrowser/Properties/AssemblyInfo.cs +++ b/ResultsBrowser/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.189.0")] -[assembly: AssemblyFileVersion("2.1.189.0")] +[assembly: AssemblyVersion("2.4.250.0")] +[assembly: AssemblyFileVersion("2.4.250.0")] diff --git a/ResultsBrowser/RBrowserWnd.Designer.cs b/ResultsBrowser/RBrowserWnd.Designer.cs new file mode 100644 index 000000000..013396f3b --- /dev/null +++ b/ResultsBrowser/RBrowserWnd.Designer.cs @@ -0,0 +1,577 @@ +namespace ResultsBrowser +{ + partial class RBrowserWnd + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.queryBatchesButton = new System.Windows.Forms.Button(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.queryResultsItemsLabel = new System.Windows.Forms.Label(); + this.queryWatermetersButton = new System.Windows.Forms.Button(); + this.batchNrGroupBox = new System.Windows.Forms.GroupBox(); + this.batchNrToTextBox = new System.Windows.Forms.TextBox(); + this.batchNrFromTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.batchNrCheckBox = new System.Windows.Forms.CheckBox(); + this.removeFromQueryButton = new System.Windows.Forms.Button(); + this.addToReportButton = new System.Windows.Forms.Button(); + this.resolveManuallyCheckBox = new System.Windows.Forms.CheckBox(); + this.procedureGroupBox = new System.Windows.Forms.GroupBox(); + this.procedureCheckBox = new System.Windows.Forms.CheckBox(); + this.procedureComboBox = new System.Windows.Forms.ComboBox(); + this.fromGroupBox = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.filterDateCheckBox = new System.Windows.Forms.CheckBox(); + this.toDateTimePicker = new System.Windows.Forms.DateTimePicker(); + this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker(); + this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox(); + this.purchaseOrderCheckBox = new System.Windows.Forms.CheckBox(); + this.purchaseOrderComboBox = new System.Windows.Forms.ComboBox(); + this.queryResultsListBox = new System.Windows.Forms.ListBox(); + this.configReportButton = new System.Windows.Forms.Button(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.reportItemsLabel = new System.Windows.Forms.Label(); + this.configButton = new System.Windows.Forms.Button(); + this.makeReportButton = new System.Windows.Forms.Button(); + this.removeFromReportButton = new System.Windows.Forms.Button(); + this.reportFileGroupBox = new System.Windows.Forms.GroupBox(); + this.browseFileButton = new System.Windows.Forms.Button(); + this.reportFileComboBox = new System.Windows.Forms.ComboBox(); + this.makeAscFileButton = new System.Windows.Forms.Button(); + this.reportListBox = new System.Windows.Forms.ListBox(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.batchNrGroupBox.SuspendLayout(); + this.procedureGroupBox.SuspendLayout(); + this.fromGroupBox.SuspendLayout(); + this.purchaseOrderGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + this.reportFileGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // queryBatchesButton + // + this.queryBatchesButton.Location = new System.Drawing.Point(15, 178); + this.queryBatchesButton.Name = "queryBatchesButton"; + this.queryBatchesButton.Size = new System.Drawing.Size(108, 29); + this.queryBatchesButton.TabIndex = 3; + this.queryBatchesButton.Text = "Query batches"; + this.queryBatchesButton.UseVisualStyleBackColor = true; + this.queryBatchesButton.Click += new System.EventHandler(this.queryBatchesButton_Click); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = true; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.queryResultsItemsLabel); + this.splitContainer1.Panel1.Controls.Add(this.queryWatermetersButton); + this.splitContainer1.Panel1.Controls.Add(this.batchNrGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.removeFromQueryButton); + this.splitContainer1.Panel1.Controls.Add(this.addToReportButton); + this.splitContainer1.Panel1.Controls.Add(this.resolveManuallyCheckBox); + this.splitContainer1.Panel1.Controls.Add(this.procedureGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.fromGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.queryBatchesButton); + this.splitContainer1.Panel1.Controls.Add(this.purchaseOrderGroupBox); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.queryResultsListBox); + this.splitContainer1.Size = new System.Drawing.Size(604, 624); + this.splitContainer1.SplitterDistance = 220; + this.splitContainer1.TabIndex = 5; + // + // queryResultsItemsLabel + // + this.queryResultsItemsLabel.AutoSize = true; + this.queryResultsItemsLabel.Location = new System.Drawing.Point(255, 207); + this.queryResultsItemsLabel.Name = "queryResultsItemsLabel"; + this.queryResultsItemsLabel.Size = new System.Drawing.Size(40, 13); + this.queryResultsItemsLabel.TabIndex = 13; + this.queryResultsItemsLabel.Text = "0 items"; + // + // queryWatermetersButton + // + this.queryWatermetersButton.Location = new System.Drawing.Point(129, 178); + this.queryWatermetersButton.Name = "queryWatermetersButton"; + this.queryWatermetersButton.Size = new System.Drawing.Size(108, 29); + this.queryWatermetersButton.TabIndex = 12; + this.queryWatermetersButton.Text = "Query water meters"; + this.queryWatermetersButton.UseVisualStyleBackColor = true; + this.queryWatermetersButton.Click += new System.EventHandler(this.queryWatermetersButton_Click); + // + // batchNrGroupBox + // + this.batchNrGroupBox.Controls.Add(this.batchNrToTextBox); + this.batchNrGroupBox.Controls.Add(this.batchNrFromTextBox); + this.batchNrGroupBox.Controls.Add(this.label4); + this.batchNrGroupBox.Controls.Add(this.label3); + this.batchNrGroupBox.Controls.Add(this.batchNrCheckBox); + this.batchNrGroupBox.Location = new System.Drawing.Point(15, 122); + this.batchNrGroupBox.Name = "batchNrGroupBox"; + this.batchNrGroupBox.Size = new System.Drawing.Size(242, 50); + this.batchNrGroupBox.TabIndex = 11; + this.batchNrGroupBox.TabStop = false; + this.batchNrGroupBox.Visible = false; + // + // batchNrToTextBox + // + this.batchNrToTextBox.Location = new System.Drawing.Point(157, 21); + this.batchNrToTextBox.Name = "batchNrToTextBox"; + this.batchNrToTextBox.Size = new System.Drawing.Size(62, 20); + this.batchNrToTextBox.TabIndex = 5; + // + // batchNrFromTextBox + // + this.batchNrFromTextBox.Location = new System.Drawing.Point(56, 21); + this.batchNrFromTextBox.Name = "batchNrFromTextBox"; + this.batchNrFromTextBox.Size = new System.Drawing.Size(62, 20); + this.batchNrFromTextBox.TabIndex = 4; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(131, 24); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(20, 13); + this.label4.TabIndex = 3; + this.label4.Text = "To"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(19, 24); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(30, 13); + this.label3.TabIndex = 2; + this.label3.Text = "From"; + // + // batchNrCheckBox + // + this.batchNrCheckBox.AutoSize = true; + this.batchNrCheckBox.Location = new System.Drawing.Point(19, 0); + this.batchNrCheckBox.Name = "batchNrCheckBox"; + this.batchNrCheckBox.Size = new System.Drawing.Size(116, 17); + this.batchNrCheckBox.TabIndex = 1; + this.batchNrCheckBox.Text = "Filter batch number"; + this.batchNrCheckBox.UseVisualStyleBackColor = true; + this.batchNrCheckBox.Visible = false; + // + // removeFromQueryButton + // + this.removeFromQueryButton.Location = new System.Drawing.Point(380, 178); + this.removeFromQueryButton.Name = "removeFromQueryButton"; + this.removeFromQueryButton.Size = new System.Drawing.Size(114, 29); + this.removeFromQueryButton.TabIndex = 9; + this.removeFromQueryButton.Text = "Remove selected"; + this.removeFromQueryButton.UseVisualStyleBackColor = true; + this.removeFromQueryButton.Click += new System.EventHandler(this.removeFromQueryButton_Click); + // + // addToReportButton + // + this.addToReportButton.Location = new System.Drawing.Point(558, 162); + this.addToReportButton.Name = "addToReportButton"; + this.addToReportButton.Size = new System.Drawing.Size(46, 40); + this.addToReportButton.TabIndex = 8; + this.addToReportButton.Text = ">>>"; + this.addToReportButton.UseVisualStyleBackColor = true; + this.addToReportButton.Click += new System.EventHandler(this.addToReportButton_Click); + // + // resolveManuallyCheckBox + // + this.resolveManuallyCheckBox.AutoSize = true; + this.resolveManuallyCheckBox.Location = new System.Drawing.Point(282, 143); + this.resolveManuallyCheckBox.Name = "resolveManuallyCheckBox"; + this.resolveManuallyCheckBox.Size = new System.Drawing.Size(158, 17); + this.resolveManuallyCheckBox.TabIndex = 7; + this.resolveManuallyCheckBox.Text = "Resolve duplicities manually"; + this.resolveManuallyCheckBox.UseVisualStyleBackColor = true; + // + // procedureGroupBox + // + this.procedureGroupBox.Controls.Add(this.procedureCheckBox); + this.procedureGroupBox.Controls.Add(this.procedureComboBox); + this.procedureGroupBox.Location = new System.Drawing.Point(15, 68); + this.procedureGroupBox.Name = "procedureGroupBox"; + this.procedureGroupBox.Size = new System.Drawing.Size(242, 50); + this.procedureGroupBox.TabIndex = 6; + this.procedureGroupBox.TabStop = false; + // + // procedureCheckBox + // + this.procedureCheckBox.AutoSize = true; + this.procedureCheckBox.Location = new System.Drawing.Point(19, 0); + this.procedureCheckBox.Name = "procedureCheckBox"; + this.procedureCheckBox.Size = new System.Drawing.Size(99, 17); + this.procedureCheckBox.TabIndex = 1; + this.procedureCheckBox.Text = "Filter procedure"; + this.procedureCheckBox.UseVisualStyleBackColor = true; + this.procedureCheckBox.CheckedChanged += new System.EventHandler(this.procedureCheckBox_CheckedChanged); + // + // procedureComboBox + // + this.procedureComboBox.FormattingEnabled = true; + this.procedureComboBox.Location = new System.Drawing.Point(18, 19); + this.procedureComboBox.Name = "procedureComboBox"; + this.procedureComboBox.Size = new System.Drawing.Size(201, 21); + this.procedureComboBox.TabIndex = 0; + // + // fromGroupBox + // + this.fromGroupBox.Controls.Add(this.label2); + this.fromGroupBox.Controls.Add(this.label1); + this.fromGroupBox.Controls.Add(this.filterDateCheckBox); + this.fromGroupBox.Controls.Add(this.toDateTimePicker); + this.fromGroupBox.Controls.Add(this.fromDateTimePicker); + this.fromGroupBox.Location = new System.Drawing.Point(263, 14); + this.fromGroupBox.Name = "fromGroupBox"; + this.fromGroupBox.Size = new System.Drawing.Size(242, 104); + this.fromGroupBox.TabIndex = 3; + this.fromGroupBox.TabStop = false; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 68); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(20, 13); + this.label2.TabIndex = 3; + this.label2.Text = "To"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 36); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 2; + this.label1.Text = "From"; + // + // filterDateCheckBox + // + this.filterDateCheckBox.AutoSize = true; + this.filterDateCheckBox.Location = new System.Drawing.Point(19, -1); + this.filterDateCheckBox.Name = "filterDateCheckBox"; + this.filterDateCheckBox.Size = new System.Drawing.Size(72, 17); + this.filterDateCheckBox.TabIndex = 1; + this.filterDateCheckBox.Text = "Filter date"; + this.filterDateCheckBox.UseVisualStyleBackColor = true; + // + // toDateTimePicker + // + this.toDateTimePicker.Location = new System.Drawing.Point(68, 65); + this.toDateTimePicker.Name = "toDateTimePicker"; + this.toDateTimePicker.Size = new System.Drawing.Size(151, 20); + this.toDateTimePicker.TabIndex = 0; + // + // fromDateTimePicker + // + this.fromDateTimePicker.Location = new System.Drawing.Point(68, 32); + this.fromDateTimePicker.Name = "fromDateTimePicker"; + this.fromDateTimePicker.Size = new System.Drawing.Size(151, 20); + this.fromDateTimePicker.TabIndex = 0; + // + // purchaseOrderGroupBox + // + this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderCheckBox); + this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox); + this.purchaseOrderGroupBox.Location = new System.Drawing.Point(15, 14); + this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox"; + this.purchaseOrderGroupBox.Size = new System.Drawing.Size(242, 50); + this.purchaseOrderGroupBox.TabIndex = 2; + this.purchaseOrderGroupBox.TabStop = false; + // + // purchaseOrderCheckBox + // + this.purchaseOrderCheckBox.AutoSize = true; + this.purchaseOrderCheckBox.Location = new System.Drawing.Point(19, 0); + this.purchaseOrderCheckBox.Name = "purchaseOrderCheckBox"; + this.purchaseOrderCheckBox.Size = new System.Drawing.Size(122, 17); + this.purchaseOrderCheckBox.TabIndex = 1; + this.purchaseOrderCheckBox.Text = "Filter purchase order"; + this.purchaseOrderCheckBox.UseVisualStyleBackColor = true; + // + // purchaseOrderComboBox + // + this.purchaseOrderComboBox.FormattingEnabled = true; + this.purchaseOrderComboBox.Location = new System.Drawing.Point(18, 19); + this.purchaseOrderComboBox.Name = "purchaseOrderComboBox"; + this.purchaseOrderComboBox.Size = new System.Drawing.Size(201, 21); + this.purchaseOrderComboBox.TabIndex = 0; + // + // queryResultsListBox + // + this.queryResultsListBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.queryResultsListBox.FormattingEnabled = true; + this.queryResultsListBox.Location = new System.Drawing.Point(0, 0); + this.queryResultsListBox.Name = "queryResultsListBox"; + this.queryResultsListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; + this.queryResultsListBox.Size = new System.Drawing.Size(604, 400); + this.queryResultsListBox.TabIndex = 0; + this.queryResultsListBox.DoubleClick += new System.EventHandler(this.queryResultsListBox_DoubleClick); + // + // configReportButton + // + this.configReportButton.Location = new System.Drawing.Point(226, 95); + this.configReportButton.Name = "configReportButton"; + this.configReportButton.Size = new System.Drawing.Size(103, 47); + this.configReportButton.TabIndex = 5; + this.configReportButton.Text = "Configure Report"; + this.configReportButton.UseVisualStyleBackColor = true; + this.configReportButton.Click += new System.EventHandler(this.configReportButton_Click); + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.splitContainer1); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.splitContainer3); + this.splitContainer2.Size = new System.Drawing.Size(1284, 624); + this.splitContainer2.SplitterDistance = 604; + this.splitContainer2.TabIndex = 6; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer3.IsSplitterFixed = true; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.reportItemsLabel); + this.splitContainer3.Panel1.Controls.Add(this.configButton); + this.splitContainer3.Panel1.Controls.Add(this.makeReportButton); + this.splitContainer3.Panel1.Controls.Add(this.removeFromReportButton); + this.splitContainer3.Panel1.Controls.Add(this.reportFileGroupBox); + this.splitContainer3.Panel1.Controls.Add(this.makeAscFileButton); + this.splitContainer3.Panel1.Controls.Add(this.configReportButton); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.reportListBox); + this.splitContainer3.Size = new System.Drawing.Size(676, 624); + this.splitContainer3.SplitterDistance = 220; + this.splitContainer3.TabIndex = 6; + // + // reportItemsLabel + // + this.reportItemsLabel.AutoSize = true; + this.reportItemsLabel.Location = new System.Drawing.Point(261, 207); + this.reportItemsLabel.Name = "reportItemsLabel"; + this.reportItemsLabel.Size = new System.Drawing.Size(40, 13); + this.reportItemsLabel.TabIndex = 14; + this.reportItemsLabel.Text = "0 items"; + // + // configButton + // + this.configButton.Location = new System.Drawing.Point(589, 14); + this.configButton.Name = "configButton"; + this.configButton.Size = new System.Drawing.Size(75, 71); + this.configButton.TabIndex = 12; + this.configButton.Text = "Configure"; + this.configButton.UseVisualStyleBackColor = true; + this.configButton.Click += new System.EventHandler(this.configButton_Click); + // + // makeReportButton + // + this.makeReportButton.Location = new System.Drawing.Point(335, 95); + this.makeReportButton.Name = "makeReportButton"; + this.makeReportButton.Size = new System.Drawing.Size(103, 47); + this.makeReportButton.TabIndex = 11; + this.makeReportButton.Text = "Make Report"; + this.makeReportButton.UseVisualStyleBackColor = true; + this.makeReportButton.Click += new System.EventHandler(this.makeReportButton_Click); + // + // removeFromReportButton + // + this.removeFromReportButton.Location = new System.Drawing.Point(55, 178); + this.removeFromReportButton.Name = "removeFromReportButton"; + this.removeFromReportButton.Size = new System.Drawing.Size(114, 29); + this.removeFromReportButton.TabIndex = 10; + this.removeFromReportButton.Text = "Remove selected"; + this.removeFromReportButton.UseVisualStyleBackColor = true; + this.removeFromReportButton.Click += new System.EventHandler(this.removeFromReportButton_Click); + // + // reportFileGroupBox + // + this.reportFileGroupBox.Controls.Add(this.browseFileButton); + this.reportFileGroupBox.Controls.Add(this.reportFileComboBox); + this.reportFileGroupBox.Location = new System.Drawing.Point(18, 14); + this.reportFileGroupBox.Name = "reportFileGroupBox"; + this.reportFileGroupBox.Size = new System.Drawing.Size(546, 63); + this.reportFileGroupBox.TabIndex = 8; + this.reportFileGroupBox.TabStop = false; + this.reportFileGroupBox.Text = "Report file name"; + // + // browseFileButton + // + this.browseFileButton.Location = new System.Drawing.Point(453, 22); + this.browseFileButton.Name = "browseFileButton"; + this.browseFileButton.Size = new System.Drawing.Size(75, 27); + this.browseFileButton.TabIndex = 2; + this.browseFileButton.Text = "Browse"; + this.browseFileButton.UseVisualStyleBackColor = true; + this.browseFileButton.Click += new System.EventHandler(this.browseFileButton_Click); + // + // reportFileComboBox + // + this.reportFileComboBox.FormattingEnabled = true; + this.reportFileComboBox.Location = new System.Drawing.Point(20, 25); + this.reportFileComboBox.Name = "reportFileComboBox"; + this.reportFileComboBox.Size = new System.Drawing.Size(414, 21); + this.reportFileComboBox.TabIndex = 1; + // + // makeAscFileButton + // + this.makeAscFileButton.Location = new System.Drawing.Point(443, 95); + this.makeAscFileButton.Name = "makeAscFileButton"; + this.makeAscFileButton.Size = new System.Drawing.Size(103, 47); + this.makeAscFileButton.TabIndex = 7; + this.makeAscFileButton.Text = "Make *.asc File"; + this.makeAscFileButton.UseVisualStyleBackColor = true; + this.makeAscFileButton.Click += new System.EventHandler(this.makeAscFileButton_Click); + // + // reportListBox + // + this.reportListBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.reportListBox.FormattingEnabled = true; + this.reportListBox.Location = new System.Drawing.Point(0, 0); + this.reportListBox.Name = "reportListBox"; + this.reportListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; + this.reportListBox.Size = new System.Drawing.Size(676, 400); + this.reportListBox.TabIndex = 0; + this.reportListBox.DoubleClick += new System.EventHandler(this.reportListBox_DoubleClick); + // + // RBrowserWnd + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1284, 624); + this.Controls.Add(this.splitContainer2); + this.Name = "RBrowserWnd"; + this.Text = "Results browser"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWnd_FormClosing); + this.Load += new System.EventHandler(this.MainWnd_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.batchNrGroupBox.ResumeLayout(false); + this.batchNrGroupBox.PerformLayout(); + this.procedureGroupBox.ResumeLayout(false); + this.procedureGroupBox.PerformLayout(); + this.fromGroupBox.ResumeLayout(false); + this.fromGroupBox.PerformLayout(); + this.purchaseOrderGroupBox.ResumeLayout(false); + this.purchaseOrderGroupBox.PerformLayout(); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel1.PerformLayout(); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + this.reportFileGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button queryBatchesButton; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.GroupBox fromGroupBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox filterDateCheckBox; + private System.Windows.Forms.DateTimePicker toDateTimePicker; + private System.Windows.Forms.DateTimePicker fromDateTimePicker; + private System.Windows.Forms.GroupBox purchaseOrderGroupBox; + private System.Windows.Forms.CheckBox purchaseOrderCheckBox; + private System.Windows.Forms.ComboBox purchaseOrderComboBox; + private System.Windows.Forms.Button configReportButton; + private System.Windows.Forms.CheckBox resolveManuallyCheckBox; + private System.Windows.Forms.GroupBox procedureGroupBox; + private System.Windows.Forms.CheckBox procedureCheckBox; + private System.Windows.Forms.ComboBox procedureComboBox; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.Button makeAscFileButton; + private System.Windows.Forms.ListBox queryResultsListBox; + private System.Windows.Forms.ListBox reportListBox; + private System.Windows.Forms.GroupBox reportFileGroupBox; + private System.Windows.Forms.Button browseFileButton; + private System.Windows.Forms.ComboBox reportFileComboBox; + private System.Windows.Forms.Button removeFromQueryButton; + private System.Windows.Forms.Button addToReportButton; + private System.Windows.Forms.Button removeFromReportButton; + private System.Windows.Forms.GroupBox batchNrGroupBox; + private System.Windows.Forms.TextBox batchNrToTextBox; + private System.Windows.Forms.TextBox batchNrFromTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckBox batchNrCheckBox; + private System.Windows.Forms.Button makeReportButton; + private System.Windows.Forms.Button configButton; + private System.Windows.Forms.Button queryWatermetersButton; + private System.Windows.Forms.Label queryResultsItemsLabel; + private System.Windows.Forms.Label reportItemsLabel; + } +} + diff --git a/ResultsBrowser/RBrowserWnd.cs b/ResultsBrowser/RBrowserWnd.cs new file mode 100644 index 000000000..3c0523b9f --- /dev/null +++ b/ResultsBrowser/RBrowserWnd.cs @@ -0,0 +1,527 @@ +/// +/// Copyright (c) 2015 Sensus Metering Systems +/// +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using log4net; +using NHibernate; +using Results.Entities; + +namespace ResultsBrowser +{ + public partial class RBrowserWnd : Form + { + static readonly ILog log = LogManager.GetLogger(typeof(RBrowserWnd)); + + bool batchesQueried; + + public static IList QueryBatches; + public static IList QueryWaterMeters; + + public static IList ReportBatches; + public static IList ReportWaterMeters; + + public IList ReportItems_Single; + public IList ReportItems_Compound; + + + public RBrowserWnd() + { + InitializeComponent(); + + QueryBatches = new List(); + QueryWaterMeters = new List(); + + ReportBatches = new List(); + ReportWaterMeters = new List(); + } + + private void MainWnd_Load(object sender, EventArgs e) + { + PrepareComboBoxHistory(Program.LocalSettings.PurchaseOrderHistory, purchaseOrderComboBox); + PrepareComboBoxHistory(Program.LocalSettings.ProcedureHistory, procedureComboBox); + PrepareComboBoxHistory(Program.LocalSettings.ReportFileNameHistory, reportFileComboBox); + purchaseOrderComboBox.Text = Program.LocalSettings.LastPurchaseOrder; + procedureComboBox.Text = Program.LocalSettings.LastProcedure; + reportFileComboBox.Text = Program.LocalSettings.LastReportFileName; + + ReportItems_Single = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Single); + ReportItems_Compound = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Compound); + + purchaseOrderCheckBox.Checked = Program.LocalSettings.FilterPurchaseOrder; + procedureCheckBox.Checked = Program.LocalSettings.FilterProcedure; + batchNrCheckBox.Checked = Program.LocalSettings.FilterBatchNr; + filterDateCheckBox.Checked = Program.LocalSettings.FilterDate; + + resolveManuallyCheckBox.Checked = Program.LocalSettings.ResolveManually; + + batchNrFromTextBox.Text = Program.LocalSettings.BatchFrom; + batchNrToTextBox.Text = Program.LocalSettings.BatchTo; + + Results.DB.ConnectionString = Program.LocalSettings.ConnectionString_WR10; + } + + private void MainWnd_FormClosing(object sender, FormClosingEventArgs e) + { + Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory); + Program.LocalSettings.UpdateHistory(procedureComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory); + Program.LocalSettings.UpdateHistory(reportFileComboBox.Text, ref Program.LocalSettings.ReportFileNameHistory); + Program.LocalSettings.LastPurchaseOrder = purchaseOrderComboBox.Text; + Program.LocalSettings.LastProcedure = procedureComboBox.Text; + Program.LocalSettings.LastReportFileName = reportFileComboBox.Text; + + Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single); + Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound); + + Program.LocalSettings.FilterPurchaseOrder = purchaseOrderCheckBox.Checked; + Program.LocalSettings.FilterProcedure = procedureCheckBox.Checked; + Program.LocalSettings.FilterBatchNr = batchNrCheckBox.Checked; + Program.LocalSettings.FilterDate = filterDateCheckBox.Checked; + + Program.LocalSettings.BatchFrom = batchNrFromTextBox.Text; + Program.LocalSettings.BatchTo = batchNrToTextBox.Text; + + Program.LocalSettings.ResolveManually = resolveManuallyCheckBox.Checked; + + Program.LocalSettings.Save(); + } + + void RedrawLists() + { + RedrawQueryList(); + RedrawReportList(); + } + + void RedrawQueryList() + { + queryResultsListBox.Items.Clear(); + if (batchesQueried) + { + foreach (var b in QueryBatches) queryResultsListBox.Items.Add(b.ToString()); + } + else + { + foreach (var wmr in QueryWaterMeters) queryResultsListBox.Items.Add(wmr); + } + int nrItems = queryResultsListBox.Items.Count; + if (nrItems == 0) queryResultsListBox.Items.Add(""); + queryResultsItemsLabel.Text = string.Format("{0} items", nrItems); + } + + void RedrawReportList() + { + reportListBox.Items.Clear(); + foreach (var wmr in ReportWaterMeters) reportListBox.Items.Add(wmr); + int nrItems = reportListBox.Items.Count; + if (nrItems == 0) reportListBox.Items.Add(""); + reportItemsLabel.Text = string.Format("{0} items", nrItems); + } + + /// + /// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array + /// + /// Puchase order ComboBox + void PrepareComboBoxHistory(string[] history, ComboBox comboBox) + { + if (history == null || history.Length == 0) return; + + for (int i = 0; i < history.Length; i++) comboBox.Items.Add(history[i]); + if (comboBox.Items.Count > 0) comboBox.Text = comboBox.Items[0].ToString(); + } + + private void filterDateCheckBox_CheckedChanged(object sender, EventArgs e) + { + fromDateTimePicker.Enabled = toDateTimePicker.Enabled = filterDateCheckBox.Checked; + } + + private void purchaseOrderCheckBox_CheckedChanged(object sender, EventArgs e) + { + purchaseOrderComboBox.Enabled = purchaseOrderCheckBox.Checked; + } + + private void procedureCheckBox_CheckedChanged(object sender, EventArgs e) + { + procedureComboBox.Enabled = procedureCheckBox.Checked; + } + + + private void clearButton_Click(object sender, EventArgs e) + { + QueryWaterMeters.Clear(); + queryResultsListBox.Items.Clear(); + } + + + private void configReportButton_Click(object sender, EventArgs e) + { + Forms.ResultsConfig dlg = new Forms.ResultsConfig(false); + + dlg.ReportItems_Single = ReportItems_Single; + dlg.ReportItems_Compound = ReportItems_Compound; + + if (DialogResult.OK == dlg.ShowDialog()) + { + ReportItems_Single = dlg.ReportItems_Single; + ReportItems_Compound = dlg.ReportItems_Compound; + + Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single); + Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound); + } + } + + + private void removeFromQueryButton_Click(object sender, EventArgs e) + { + try + { + /// Remove from the list (the last selected item first so that the indexes are not affected) + for (int i = queryResultsListBox.SelectedIndices.Count - 1; i >= 0; i--) + { + if (batchesQueried) + { + QueryBatches.RemoveAt(queryResultsListBox.SelectedIndices[i]); + } + else + { + QueryWaterMeters.RemoveAt(queryResultsListBox.SelectedIndices[i]); + } + } + + RedrawLists(); + } + catch + { + MessageBox.Show("Something strange happened", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + + + private void removeFromReportButton_Click(object sender, EventArgs e) + { + /// Remove from the list (the last selected item first so that the indexes are not affected) + for (int i = reportListBox.SelectedIndices.Count - 1; i >= 0; i--) + { + ReportWaterMeters.RemoveAt(reportListBox.SelectedIndices[i]); + } + + RedrawLists(); + } + + + private void addToReportButton_Click(object sender, EventArgs e) + { + if (batchesQueried) + { + foreach (var b in QueryBatches) + { + foreach (var wm in b.WaterMeters) ReportWaterMeters.Add(wm); + } + } + else + { + foreach (var wm in QueryWaterMeters) + { + if (!ReportWaterMeters.Contains(wm)) ReportWaterMeters.Add(wm); + } + } + + RedrawLists(); + } + + + private void browseFileButton_Click(object sender, EventArgs e) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Target file"; + if (dlg.ShowDialog() == DialogResult.OK) + { + reportFileComboBox.Text = dlg.FileName; + } + } + + + /// + /// Create ASC file in R.Uhlik format + /// + /// + /// + private void makeAscFileButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(reportFileComboBox.Text)) + { + MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + if (ReportItems_Single == null || ReportItems_Single.Count == 0) + { + MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true)) + { + foreach (var wm in ReportWaterMeters) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(wm.SerialNr); + sb.Append(';'); sb.Append(wm.ProductName()); + sb.Append(';'); sb.Append(wm.ApprovalInfo()); + sb.Append(';'); sb.Append(wm.MetrologicalClass()); + sb.Append(';'); sb.Append("0"); + sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q1") != null ? wm.GetTestRslt("Q1").Qfrom() : 0)).ToString("F0")); /// Q1 nominal + sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q2") != null ? wm.GetTestRslt("Q2").Qfrom() : 0)).ToString("F0")); /// Q2 nominal + sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q3") != null ? wm.GetTestRslt("Q3").Qto() : 0)).ToString("F0")); /// Q3 nominal + sb.Append(';'); sb.Append("0"); /// Q4 nominal + sb.Append(';'); sb.Append("6"); /// Worker code + sb.Append(';'); sb.Append(ToShortStr(wm.EndTime())); + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q1") != null ? wm.GetMeterTestRslt("Q1").Error : 99).ToString("F1")); /// Q1 Error [%] + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q2") != null ? wm.GetMeterTestRslt("Q2").Error : 99).ToString("F1")); /// Q2 Error [%] + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q3") != null ? wm.GetMeterTestRslt("Q3").Error : 99).ToString("F1")); /// Q3 Error [%] + sb.Append(';'); sb.Append("0"); /// Q4 Error [%] + sb.Append(';'); sb.Append(wm.BenchId().ToString()); /// + sb.Append(';'); sb.Append(wm.PurchaseOrder); + sb.Append(';'); sb.Append(""); + sb.Append(';'); sb.Append("10000"); + sb.Append(';'); sb.Append(wm.ProcedureName().Substring(0, 8)); + sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); + + report.WriteLine(sb); + } + catch (Exception exc) + { + string msg = exc.Message; + } + } + } + + MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + + static string ToShortStr(DateTime date) + { + return (((date.Year % 100) * 100 + date.Month) * 100 + date.Day).ToString(); + } + + + private void makeReportButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(reportFileComboBox.Text)) + { + MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + if (ReportItems_Single == null || ReportItems_Single.Count == 0) + { + MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true)) + { + foreach (var wm in ReportWaterMeters) + { + try + { + StringBuilder sb = new StringBuilder(); + + sb.Append(wm.SerialNr); + sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); /// PCB number + sb.Append(";\""); sb.Append(wm.ProcedureName()); sb.Append('"'); /// Procedure name + sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("q3") != null ? wm.GetTestRslt("q3").Qto() : 0)).ToString("F0")); /// Q3 nominal + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("adjustment") != null ? wm.GetMeterTestRslt("adjustment").Error : 99).ToString("F2"));/// Adjustment Error [%] + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q3") != null ? wm.GetMeterTestRslt("q1").Error : 99).ToString("F2")); /// Q1 Error [%] + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q2") != null ? wm.GetMeterTestRslt("q2").Error : 99).ToString("F2")); /// Q2 Error [%] + sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q1") != null ? wm.GetMeterTestRslt("q3").Error : 99).ToString("F2")); /// Q3 Error [%] + sb.Append(';'); sb.Append(wm.StartTime().ToShortTimeString()); + sb.Append(';'); sb.Append(wm.EndTime().ToShortTimeString()); + + report.WriteLine(sb); + } + catch (Exception exc) + { + string msg = exc.Message; + } + } + } + + MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + + private void configButton_Click(object sender, EventArgs e) + { + if ((new Forms.DatabaseSettings()).ShowDialog() == DialogResult.OK) + { + Results.DB.ConnectionString = Program.LocalSettings.ConnectionString_WR10; + } + } + + + + private void queryBatchesButton_Click(object sender, EventArgs e) + { + if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked && + !filterDateCheckBox.Checked && !batchNrCheckBox.Checked) + { + return; + } + + queryResultsListBox.Items.Clear(); + + try + { + ISession session = Results.DB.CreateSession(); + + IList batches; + + if (filterDateCheckBox.Checked) + { + batches = session.QueryOver() + .WhereRestrictionOn(x => x.EndTime) + .IsBetween(fromDateTimePicker.Value.Date) + .And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1)) + //.OrderBy(x => x.BatchNr).Asc + .List(); + } + else + { + batches = session.QueryOver() + .List(); + } + + if (procedureCheckBox.Checked) + { + IList batches2 = new List(); + foreach (var b in batches) + { + if (b.ProcedureName.Equals(procedureComboBox.Text)) batches2.Add(b); + } + batches = batches2; + } + + if (purchaseOrderCheckBox.Checked) + { + IList batches3 = new List(); + foreach (var b in batches) + { + if (b.WaterMeters[0].PurchaseOrder.Equals(purchaseOrderComboBox.Text)) batches3.Add(b); + } + batches = batches3; + } + + QueryBatches = batches; + batchesQueried = true; + RedrawQueryList(); + /// + } + catch (Exception exc) + { + MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void queryWatermetersButton_Click(object sender, EventArgs e) + { + if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked && + !filterDateCheckBox.Checked && !batchNrCheckBox.Checked) + { + return; + } + + queryResultsListBox.Items.Clear(); + + try + { + bool purchaseOrderFiltered = false; + bool procedureFiltered = false; + + ISession session = Results.DB.CreateSession(); + + IList waterMeters; + + if (filterDateCheckBox.Checked) + { + IList batches = session.QueryOver() + .WhereRestrictionOn(x => x.EndTime) + .IsBetween(fromDateTimePicker.Value.Date) + .And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1)) + //.OrderBy(x => x.BatchNr).Asc + .List(); + + waterMeters = new List(); + foreach (var b in batches) + { + foreach (var wm in b.WaterMeters) waterMeters.Add(wm); + } + } + else if (purchaseOrderCheckBox.Checked) + { + waterMeters = session.QueryOver() + .Where(x => (x.PurchaseOrder == purchaseOrderCheckBox.Text)) + .List(); + purchaseOrderFiltered = true; + } + else if (procedureCheckBox.Checked && !procedureFiltered) + { + waterMeters = session.QueryOver() + .Where(x => (x.Batch.ProcedureName == procedureComboBox.Text)) + .List(); + procedureFiltered = true; + } + else + { + waterMeters = session.QueryOver().List(); + } + + + if (purchaseOrderCheckBox.Checked && !purchaseOrderFiltered) + { + IList waterMeters3 = new List(); + foreach (var wm in waterMeters) + { + if (wm.PurchaseOrder.Equals(purchaseOrderComboBox.Text)) waterMeters3.Add(wm); + } + waterMeters = waterMeters3; + purchaseOrderFiltered = true; + } + + if (procedureCheckBox.Checked && !procedureFiltered) + { + IList waterMeters2 = new List(); + foreach (var wm in waterMeters) + { + if (wm.Batch.ProcedureName.Equals(procedureComboBox.Text)) waterMeters2.Add(wm); + } + waterMeters = waterMeters2; + procedureFiltered = true; + } + + QueryWaterMeters = waterMeters; + batchesQueried = false; + RedrawQueryList(); + } + catch (Exception exc) + { + MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void queryResultsListBox_DoubleClick(object sender, EventArgs e) + { + + } + + private void reportListBox_DoubleClick(object sender, EventArgs e) + { + + } + } +} diff --git a/ResultsBrowser/RBrowserWnd.resx b/ResultsBrowser/RBrowserWnd.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/ResultsBrowser/RBrowserWnd.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ResultsBrowser/ResultsBrowser.csproj b/ResultsBrowser/ResultsBrowser.csproj index 20e13cb14..28eca5517 100644 --- a/ResultsBrowser/ResultsBrowser.csproj +++ b/ResultsBrowser/ResultsBrowser.csproj @@ -100,6 +100,12 @@ + + Form + + + RBrowserWnd.cs + DatabaseSettings.cs @@ -123,6 +129,9 @@ Resources.resx True + + RBrowserWnd.cs +