ResultsBrowser changes, ver. 2.1.187

This commit is contained in:
Milan Hanajik
2016-01-14 23:59:53 +01:00
parent ffc70efaf4
commit f3f6ad4291
4 changed files with 47 additions and 10 deletions
+3
View File
@@ -44,11 +44,13 @@ namespace ResultsBrowser
public bool ManiWndMaximized;
/// Purchase order history
public string LastPurchaseOrder;
public string[] PurchaseOrderHistory;
[XmlIgnore]
public int PurchaseOrderHistoryCount { get { return (PurchaseOrderHistory != null) ? PurchaseOrderHistory.Length : 0; } }
/// Procedure history
public string LastProcedure;
public string[] ProcedureHistory;
[XmlIgnore]
public int ProcedureHistoryCount { get { return (ProcedureHistory != null) ? ProcedureHistory.Length : 0; } }
@@ -58,6 +60,7 @@ namespace ResultsBrowser
public string BatchTo;
/// Report file name history
public string LastReportFileName;
public string[] ReportFileNameHistory;
[XmlIgnore]
public int ReportFileNameHistoryCount { get { return (ReportFileNameHistory != null) ? ReportFileNameHistory.Length : 0; } }
+3 -1
View File
@@ -340,6 +340,7 @@
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
//
@@ -482,6 +483,7 @@
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);
//
// MainWnd
//
@@ -490,7 +492,7 @@
this.ClientSize = new System.Drawing.Size(1284, 624);
this.Controls.Add(this.splitContainer2);
this.Name = "MainWnd";
this.Text = "Form1";
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);
+39 -7
View File
@@ -46,6 +46,9 @@ namespace ResultsBrowser
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);
@@ -68,6 +71,9 @@ namespace ResultsBrowser
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);
@@ -149,13 +155,27 @@ namespace ResultsBrowser
private void removeFromQueryButton_Click(object sender, EventArgs e)
{
/// 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--)
try
{
QueryWaterMeters.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
/// 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();
RedrawLists();
}
catch
{
MessageBox.Show("Something strange happened", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
@@ -208,13 +228,14 @@ namespace ResultsBrowser
#if IPERLST
if (ReportWaterMeters.Count == 0) return;
/// Oracle database connection
OracleConnection conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
const int Step = 100;
for (int i = 0; i < ReportWaterMeters.Count; i += Step)
{
try
{
/// Oracle database connection
OracleConnection conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
conn.Open();
for (int j = i; j < Math.Min(j + Step, ReportWaterMeters.Count); j++)
@@ -240,6 +261,7 @@ namespace ResultsBrowser
}
conn.Close();
conn.Dispose();
}
catch (Exception exc)
{
@@ -550,5 +572,15 @@ namespace ResultsBrowser
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)
{
}
}
}
+2 -2
View File
@@ -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.186.0")]
[assembly: AssemblyFileVersion("2.1.186.0")]
[assembly: AssemblyVersion("2.1.187.0")]
[assembly: AssemblyFileVersion("2.1.187.0")]