ResultsBrowser : Searching for a list of water meters added, ver. 2.18 1115
This commit is contained in:
parent
550fe20094
commit
1eebb3b4a1
@ -48,7 +48,7 @@
|
||||
//
|
||||
this.batchNrTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.batchNrTextBox.Name = "batchNrTextBox";
|
||||
this.batchNrTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.batchNrTextBox.Size = new System.Drawing.Size(80, 20);
|
||||
this.batchNrTextBox.TabIndex = 0;
|
||||
//
|
||||
// BatchNrFilterUI
|
||||
|
||||
@ -48,15 +48,15 @@
|
||||
//
|
||||
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.procedureTextBox.Name = "procedureTextBox";
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(360, 20);
|
||||
this.procedureTextBox.TabIndex = 0;
|
||||
//
|
||||
// ProcedureFilter
|
||||
// ProcedureFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "ProcedureFilter";
|
||||
this.Name = "ProcedureFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
6
ResultsBrowser/Filters/QnFilterUI.Designer.cs
generated
6
ResultsBrowser/Filters/QnFilterUI.Designer.cs
generated
@ -48,15 +48,15 @@
|
||||
//
|
||||
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.procedureTextBox.Name = "procedureTextBox";
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(80, 20);
|
||||
this.procedureTextBox.TabIndex = 0;
|
||||
//
|
||||
// QnFilter
|
||||
// QnFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "QnFilter";
|
||||
this.Name = "QnFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
@ -30,7 +30,6 @@ namespace ResultsBrowser.Filters
|
||||
///
|
||||
public string SerialNr;
|
||||
|
||||
|
||||
private SerialNrFilterUI userIface;
|
||||
|
||||
public SerialNrFilter()
|
||||
@ -42,21 +41,50 @@ namespace ResultsBrowser.Filters
|
||||
{
|
||||
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
|
||||
|
||||
if (string.IsNullOrEmpty(SerialNr)) return filteredWaterMeters; /// Empty s/n => Return an empty list of WM-s
|
||||
|
||||
IList<string> serialNumbers = new List<string>();
|
||||
///
|
||||
if (SerialNr[0] == '@')
|
||||
{
|
||||
try
|
||||
{
|
||||
TextReader rdr = new StreamReader(SerialNr.Substring(1));
|
||||
string line = rdr.ReadLine();
|
||||
while (!string.IsNullOrEmpty(line))
|
||||
{
|
||||
serialNumbers.Add(line);
|
||||
line = rdr.ReadLine();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return filteredWaterMeters;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
serialNumbers.Add(SerialNr);
|
||||
}
|
||||
|
||||
if (waterMeters == null)
|
||||
{
|
||||
foreach (var se in sessions)
|
||||
{
|
||||
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.SerialNr == SerialNr))
|
||||
.List<WaterMeter>();
|
||||
foreach (var wm in wms) filteredWaterMeters.Add(wm);
|
||||
foreach (var oneSerialNr in serialNumbers)
|
||||
{
|
||||
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.SerialNr == oneSerialNr))
|
||||
.List<WaterMeter>();
|
||||
foreach (var wm in wms) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
if (wm.SerialNr == SerialNr) filteredWaterMeters.Add(wm);
|
||||
if (serialNumbers.Contains(wm.SerialNr)) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -48,15 +48,16 @@
|
||||
//
|
||||
this.serialNrTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.serialNrTextBox.Name = "serialNrTextBox";
|
||||
this.serialNrTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.serialNrTextBox.Size = new System.Drawing.Size(360, 20);
|
||||
this.serialNrTextBox.TabIndex = 0;
|
||||
this.serialNrTextBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.serialNrTextBox_MouseDoubleClick);
|
||||
//
|
||||
// SerialNrFilter
|
||||
// SerialNrFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "SerialNrFilter";
|
||||
this.Name = "SerialNrFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
@ -35,5 +35,14 @@ namespace ResultsBrowser.Filters
|
||||
{
|
||||
data.SerialNr = serialNrTextBox.Text;
|
||||
}
|
||||
|
||||
private void serialNrTextBox_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
serialNrTextBox.Text = string.Format("@{0}", dlg.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
//
|
||||
this.wmPositionTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.wmPositionTextBox.Name = "wmPositionTextBox";
|
||||
this.wmPositionTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.wmPositionTextBox.Size = new System.Drawing.Size(80, 20);
|
||||
this.wmPositionTextBox.TabIndex = 0;
|
||||
//
|
||||
// WMPositionFilterUI
|
||||
|
||||
@ -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.18.1114.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1114.0")]
|
||||
[assembly: AssemblyVersion("2.18.1115.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1115.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user