Refactoring : TestBenchFramework --> TBF ver. 2.18.789

This commit is contained in:
Milan Hanajik
2018-01-29 09:48:01 +01:00
parent 06018303e7
commit 0d3ee53bd5
1300 changed files with 441 additions and 612 deletions
+112
View File
@@ -0,0 +1,112 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class AboutDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDlg));
this.copyrightLabel = new System.Windows.Forms.Label();
this.versionLabel = new System.Windows.Forms.Label();
this.buildDateLabel = new System.Windows.Forms.Label();
this.closeButton = new System.Windows.Forms.Button();
this.logoPictureBox = new System.Windows.Forms.PictureBox();
this.secureHashLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
this.SuspendLayout();
//
// copyrightLabel
//
resources.ApplyResources(this.copyrightLabel, "copyrightLabel");
this.copyrightLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.copyrightLabel.Name = "copyrightLabel";
//
// versionLabel
//
resources.ApplyResources(this.versionLabel, "versionLabel");
this.versionLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.versionLabel.Name = "versionLabel";
//
// buildDateLabel
//
resources.ApplyResources(this.buildDateLabel, "buildDateLabel");
this.buildDateLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.buildDateLabel.Name = "buildDateLabel";
//
// closeButton
//
resources.ApplyResources(this.closeButton, "closeButton");
this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.closeButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.closeButton.Name = "closeButton";
this.closeButton.UseVisualStyleBackColor = true;
//
// logoPictureBox
//
this.logoPictureBox.BackgroundImage = global::TBF.Properties.Resources.sensus_logo;
resources.ApplyResources(this.logoPictureBox, "logoPictureBox");
this.logoPictureBox.Name = "logoPictureBox";
this.logoPictureBox.TabStop = false;
//
// secureHashLabel
//
resources.ApplyResources(this.secureHashLabel, "secureHashLabel");
this.secureHashLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.secureHashLabel.Name = "secureHashLabel";
//
// AboutDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.Controls.Add(this.secureHashLabel);
this.Controls.Add(this.logoPictureBox);
this.Controls.Add(this.closeButton);
this.Controls.Add(this.buildDateLabel);
this.Controls.Add(this.versionLabel);
this.Controls.Add(this.copyrightLabel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "AboutDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label copyrightLabel;
private System.Windows.Forms.Label versionLabel;
private System.Windows.Forms.Label buildDateLabel;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.PictureBox logoPictureBox;
private System.Windows.Forms.Label secureHashLabel;
}
}
+40
View File
@@ -0,0 +1,40 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Security.Cryptography;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
/// <summary>
/// About dialog
/// </summary>
public partial class AboutDlg : Form
{
/// <summary>
/// Contsructor
/// </summary>
public AboutDlg()
{
InitializeComponent();
Text = Strings.About_Test_Bench_Framework;
copyrightLabel.Text = string.Format(Strings.CopyrightStr, DateTime.Now.Year);
versionLabel.Text = String.Format(Strings.VersionStr, Program.Version);
buildDateLabel.Text = String.Format(Strings.BuildDateStr, Program.BuildDateTime.ToShortDateString());
closeButton.Text = Strings.CloseBtnText;
byte[] sha1 = (new SHA1CryptoServiceProvider()).ComputeHash(Encoding.Default.GetBytes("nejaky text")); /// TODO: calculate SHA1 of real data
StringBuilder sb = new StringBuilder();
foreach (byte oneByte in sha1) { sb.Append(oneByte.ToString("X2")); }
secureHashLabel.Text = string.Format("SHA1: {0}", sb);
}
}
}
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="copyrightLabel.Text" xml:space="preserve">
<value>Prawo autorskie © 2013 - 2015</value>
</data>
<data name="versionLabel.Text" xml:space="preserve">
<value>Wersja</value>
</data>
<data name="buildDateLabel.Text" xml:space="preserve">
<value>Build date _BUILD_DATE_</value>
</data>
<data name="closeButton.Text" xml:space="preserve">
<value>&amp;Zamknąć</value>
</data>
<data name="secureHashLabel.Text" xml:space="preserve">
<value>Zabezpieczenia</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>O Framework stanowiska</value>
</data>
</root>
+321
View File
@@ -0,0 +1,321 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="copyrightLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="copyrightLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="copyrightLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>270, 27</value>
</data>
<data name="copyrightLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>123, 13</value>
</data>
<data name="copyrightLabel.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="copyrightLabel.Text" xml:space="preserve">
<value>Copyright © 2013 - 2015</value>
</data>
<data name="&gt;&gt;copyrightLabel.Name" xml:space="preserve">
<value>copyrightLabel</value>
</data>
<data name="&gt;&gt;copyrightLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyrightLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;copyrightLabel.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="versionLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="versionLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="versionLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>270, 48</value>
</data>
<data name="versionLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 13</value>
</data>
<data name="versionLabel.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="versionLabel.Text" xml:space="preserve">
<value>Version _VERSION_</value>
</data>
<data name="&gt;&gt;versionLabel.Name" xml:space="preserve">
<value>versionLabel</value>
</data>
<data name="&gt;&gt;versionLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;versionLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;versionLabel.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="buildDateLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="buildDateLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="buildDateLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>270, 70</value>
</data>
<data name="buildDateLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>136, 13</value>
</data>
<data name="buildDateLabel.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="buildDateLabel.Text" xml:space="preserve">
<value>Build date _BUILD_DATE_</value>
</data>
<data name="&gt;&gt;buildDateLabel.Name" xml:space="preserve">
<value>buildDateLabel</value>
</data>
<data name="&gt;&gt;buildDateLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buildDateLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buildDateLabel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="closeButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="closeButton.Location" type="System.Drawing.Point, System.Drawing">
<value>452, 26</value>
</data>
<data name="closeButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 35</value>
</data>
<data name="closeButton.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="closeButton.Text" xml:space="preserve">
<value>&amp;Close</value>
</data>
<data name="&gt;&gt;closeButton.Name" xml:space="preserve">
<value>closeButton</value>
</data>
<data name="&gt;&gt;closeButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;closeButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;closeButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="logoPictureBox.BackgroundImageLayout" type="System.Windows.Forms.ImageLayout, System.Windows.Forms">
<value>Stretch</value>
</data>
<data name="logoPictureBox.InitialImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="logoPictureBox.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 12</value>
</data>
<data name="logoPictureBox.Size" type="System.Drawing.Size, System.Drawing">
<value>244, 122</value>
</data>
<data name="logoPictureBox.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;logoPictureBox.Name" xml:space="preserve">
<value>logoPictureBox</value>
</data>
<data name="&gt;&gt;logoPictureBox.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;logoPictureBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;logoPictureBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="secureHashLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="secureHashLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="secureHashLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="secureHashLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>270, 93</value>
</data>
<data name="secureHashLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
</data>
<data name="secureHashLabel.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="secureHashLabel.Text" xml:space="preserve">
<value>Secure hash</value>
</data>
<data name="&gt;&gt;secureHashLabel.Name" xml:space="preserve">
<value>secureHashLabel</value>
</data>
<data name="&gt;&gt;secureHashLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;secureHashLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;secureHashLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>580, 140</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>About Test Bench Framework</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AboutDlg</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="copyrightLabel.Text" xml:space="preserve">
<value>Copyright © 2013 - 2015</value>
</data>
<data name="versionLabel.Text" xml:space="preserve">
<value>Version _VERSION_</value>
</data>
<data name="buildDateLabel.Text" xml:space="preserve">
<value>Build Дата _BUILD_Дата_</value>
</data>
<data name="closeButton.Text" xml:space="preserve">
<value>&amp;Закрыть</value>
</data>
<data name="secureHashLabel.Text" xml:space="preserve">
<value>Secure hash</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>О Framework поверочной установки</value>
</data>
</root>
+258
View File
@@ -0,0 +1,258 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class DatabaseSettingsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseSettingsDlg));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.benchNameTextBox = new System.Windows.Forms.TextBox();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.configDbConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.resultsDbConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.configLabel = new System.Windows.Forms.Label();
this.resultsLabel = new System.Windows.Forms.Label();
this.realBenchCheckBox = new System.Windows.Forms.CheckBox();
this.dbTypeLabel = new System.Windows.Forms.Label();
this.configDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.resultsDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.testConnConfigDbBtn = new System.Windows.Forms.Button();
this.testConnResultsDbBtn = new System.Windows.Forms.Button();
this.createConfigDbBtn = new System.Windows.Forms.Button();
this.createResultsDbBtn = new System.Windows.Forms.Button();
this.createUsersDbBtn = new System.Windows.Forms.Button();
this.testConnUsersDbBtn = new System.Windows.Forms.Button();
this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.usersLabel = new System.Windows.Forms.Label();
this.usersDbConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
resources.ApplyResources(this.okButton, "okButton");
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// benchNameTextBox
//
resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox");
this.benchNameTextBox.Name = "benchNameTextBox";
//
// connectionStringLabel
//
resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel");
this.connectionStringLabel.Name = "connectionStringLabel";
//
// configDbConnectionStringTextBox
//
resources.ApplyResources(this.configDbConnectionStringTextBox, "configDbConnectionStringTextBox");
this.configDbConnectionStringTextBox.Name = "configDbConnectionStringTextBox";
//
// resultsDbConnectionStringTextBox
//
resources.ApplyResources(this.resultsDbConnectionStringTextBox, "resultsDbConnectionStringTextBox");
this.resultsDbConnectionStringTextBox.Name = "resultsDbConnectionStringTextBox";
//
// configLabel
//
resources.ApplyResources(this.configLabel, "configLabel");
this.configLabel.Name = "configLabel";
//
// resultsLabel
//
resources.ApplyResources(this.resultsLabel, "resultsLabel");
this.resultsLabel.Name = "resultsLabel";
//
// realBenchCheckBox
//
resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox");
this.realBenchCheckBox.Name = "realBenchCheckBox";
this.realBenchCheckBox.UseVisualStyleBackColor = true;
//
// dbTypeLabel
//
resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel");
this.dbTypeLabel.Name = "dbTypeLabel";
//
// configDbTypeComboBox
//
this.configDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.configDbTypeComboBox, "configDbTypeComboBox");
this.configDbTypeComboBox.Name = "configDbTypeComboBox";
//
// resultsDbTypeComboBox
//
this.resultsDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.resultsDbTypeComboBox, "resultsDbTypeComboBox");
this.resultsDbTypeComboBox.Name = "resultsDbTypeComboBox";
//
// testConnConfigDbBtn
//
this.testConnConfigDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.testConnConfigDbBtn, "testConnConfigDbBtn");
this.testConnConfigDbBtn.Name = "testConnConfigDbBtn";
this.testConnConfigDbBtn.UseVisualStyleBackColor = true;
this.testConnConfigDbBtn.Click += new System.EventHandler(this.testConnConfigDbBtn_Click);
//
// testConnResultsDbBtn
//
this.testConnResultsDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.testConnResultsDbBtn, "testConnResultsDbBtn");
this.testConnResultsDbBtn.Name = "testConnResultsDbBtn";
this.testConnResultsDbBtn.UseVisualStyleBackColor = true;
this.testConnResultsDbBtn.Click += new System.EventHandler(this.testConnResultsDbBtn_Click);
//
// createConfigDbBtn
//
this.createConfigDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.createConfigDbBtn, "createConfigDbBtn");
this.createConfigDbBtn.Name = "createConfigDbBtn";
this.createConfigDbBtn.UseVisualStyleBackColor = true;
this.createConfigDbBtn.Click += new System.EventHandler(this.createConfigDbBtn_Click);
//
// createResultsDbBtn
//
this.createResultsDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.createResultsDbBtn, "createResultsDbBtn");
this.createResultsDbBtn.Name = "createResultsDbBtn";
this.createResultsDbBtn.UseVisualStyleBackColor = true;
this.createResultsDbBtn.Click += new System.EventHandler(this.createResultsDbBtn_Click);
//
// createUsersDbBtn
//
this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn");
this.createUsersDbBtn.Name = "createUsersDbBtn";
this.createUsersDbBtn.UseVisualStyleBackColor = true;
this.createUsersDbBtn.Click += new System.EventHandler(this.createUsersDbBtn_Click);
//
// testConnUsersDbBtn
//
this.testConnUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.testConnUsersDbBtn, "testConnUsersDbBtn");
this.testConnUsersDbBtn.Name = "testConnUsersDbBtn";
this.testConnUsersDbBtn.UseVisualStyleBackColor = true;
this.testConnUsersDbBtn.Click += new System.EventHandler(this.testConnUsersDbBtn_Click);
//
// usersDbTypeComboBox
//
this.usersDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox");
this.usersDbTypeComboBox.Name = "usersDbTypeComboBox";
//
// usersLabel
//
resources.ApplyResources(this.usersLabel, "usersLabel");
this.usersLabel.Name = "usersLabel";
//
// usersDbConnectionStringTextBox
//
resources.ApplyResources(this.usersDbConnectionStringTextBox, "usersDbConnectionStringTextBox");
this.usersDbConnectionStringTextBox.Name = "usersDbConnectionStringTextBox";
//
// DatabaseSettingsDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.createUsersDbBtn);
this.Controls.Add(this.testConnUsersDbBtn);
this.Controls.Add(this.usersDbTypeComboBox);
this.Controls.Add(this.usersLabel);
this.Controls.Add(this.usersDbConnectionStringTextBox);
this.Controls.Add(this.createResultsDbBtn);
this.Controls.Add(this.createConfigDbBtn);
this.Controls.Add(this.testConnResultsDbBtn);
this.Controls.Add(this.testConnConfigDbBtn);
this.Controls.Add(this.resultsDbTypeComboBox);
this.Controls.Add(this.configDbTypeComboBox);
this.Controls.Add(this.dbTypeLabel);
this.Controls.Add(this.realBenchCheckBox);
this.Controls.Add(this.resultsLabel);
this.Controls.Add(this.configLabel);
this.Controls.Add(this.resultsDbConnectionStringTextBox);
this.Controls.Add(this.configDbConnectionStringTextBox);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.benchNameTextBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MinimizeBox = false;
this.Name = "DatabaseSettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.BenchSettingsDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox benchNameTextBox;
private System.Windows.Forms.Label connectionStringLabel;
private System.Windows.Forms.TextBox configDbConnectionStringTextBox;
private System.Windows.Forms.TextBox resultsDbConnectionStringTextBox;
private System.Windows.Forms.Label configLabel;
private System.Windows.Forms.Label resultsLabel;
private System.Windows.Forms.CheckBox realBenchCheckBox;
private System.Windows.Forms.Label dbTypeLabel;
private System.Windows.Forms.ComboBox configDbTypeComboBox;
private System.Windows.Forms.ComboBox resultsDbTypeComboBox;
private System.Windows.Forms.Button testConnConfigDbBtn;
private System.Windows.Forms.Button testConnResultsDbBtn;
private System.Windows.Forms.Button createConfigDbBtn;
private System.Windows.Forms.Button createResultsDbBtn;
private System.Windows.Forms.Button createUsersDbBtn;
private System.Windows.Forms.Button testConnUsersDbBtn;
private System.Windows.Forms.ComboBox usersDbTypeComboBox;
private System.Windows.Forms.Label usersLabel;
private System.Windows.Forms.TextBox usersDbConnectionStringTextBox;
}
}
+226
View File
@@ -0,0 +1,226 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
/// <summary>
/// Dialog to process test bench name and database settings (BenchSettings)
/// </summary>
public partial class DatabaseSettingsDlg : Form
{
// Reference to bench DB settins (not a local copy)
Config.DatabaseSettings bench;
/// <summary>
/// Constructor
/// </summary>
/// <param name="bench">Test bench database settings</param>
public DatabaseSettingsDlg(Config.DatabaseSettings bench)
{
this.bench = bench;
InitializeComponent();
}
void Localize()
{
Text = Strings.Test_Bench_Databases_Specification;
label1.Text = Strings.Test_bench_name;
realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer;
dbTypeLabel.Text = Strings.Database_type;
connectionStringLabel.Text = Strings.Connection_string;
configLabel.Text = Strings.Configuration;
resultsLabel.Text = Strings.Results;
usersLabel.Text = Strings.Users;
testConnConfigDbBtn.Text = Strings.Test_connection;
testConnResultsDbBtn.Text = Strings.Test_connection;
testConnUsersDbBtn.Text = Strings.Test_connection;
createConfigDbBtn.Text = Strings.Create_DB;
createResultsDbBtn.Text = Strings.Create_DB;
createUsersDbBtn.Text = Strings.Create_DB;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
private void BenchSettingsDlg_Load(object sender, EventArgs e)
{
Localize();
benchNameTextBox.Text = bench.BenchName;
realBenchCheckBox.Checked = bench.IsRealBench;
/// Initialize 'Database type' combo-boxes
for (int i = 0; i < (int)Users.Entities.DBType.Count; i++)
{
Users.Entities.DBType dbType = (Users.Entities.DBType)i;
configDbTypeComboBox.Items.Add(dbType);
resultsDbTypeComboBox.Items.Add(dbType);
usersDbTypeComboBox.Items.Add(dbType);
}
configDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType;
resultsDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType;
usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType;
/// Initialize connection strings
configDbConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString;
resultsDbConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString;
usersDbConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString;
}
bool UpdateBenchFromUIControls()
{
/// TODO: The following code doesnot work as expected - error message shown!
//for (int i = 0; i < Program.LocalSettings.BenchesCount; i++)
//{
// if (bench != Program.LocalSettings.TestBenches[i] &&
// benchNameTextBox.Text == Program.LocalSettings.TestBenches[i].BenchName)
// {
// MessageBox.Show(Strings.Bench_name_conflict_Use_another_name_pls, Strings.Error, MessageBoxButtons.OK);
// return false;
// }
//}
bench.BenchName = benchNameTextBox.Text;
bench.IsRealBench = realBenchCheckBox.Checked;
bench.ProceduresDBSettings.ConnectionString = configDbConnectionStringTextBox.Text;
bench.WaterMetersDBSettings.ConnectionString = resultsDbConnectionStringTextBox.Text;
bench.UsersDBSettings.ConnectionString = usersDbConnectionStringTextBox.Text;
bench.ProceduresDBSettings.DbType = (Users.Entities.DBType)configDbTypeComboBox.SelectedIndex;
bench.WaterMetersDBSettings.DbType = (Users.Entities.DBType)resultsDbTypeComboBox.SelectedIndex;
bench.UsersDBSettings.DbType = (Users.Entities.DBType)usersDbTypeComboBox.SelectedIndex;
return true;
}
/// <summary>
/// Update bench DB setting, return 'OK'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void okButton_Click(object sender, EventArgs e)
{
if (UpdateBenchFromUIControls())
{
DialogResult = DialogResult.OK;
Close();
return;
}
DialogResult = DialogResult.None;
}
/// <summary>
/// Throw away changes, return 'Cancel'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void createConfigDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
Config.FluentCommon.CreateEmptyConfigDB(bench.ProceduresDBSettings.DbType, bench.ProceduresDBSettings.ConnectionString);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createResultsDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
Results.DB.DbType = bench.WaterMetersDBSettings.DbType;
Results.DB.ConnectionString = bench.WaterMetersDBSettings.ConnectionString;
Results.DB.CreateEmptyDB();
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
string msg = Strings.Error_while_creating_DB_Reason + Environment.NewLine + exception.Message;
if (exception.InnerException != null)
{
msg += Environment.NewLine + exception.InnerException.Message;
}
MessageBox.Show(msg, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void createUsersDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
Users.DB.DbType = bench.UsersDBSettings.DbType;
Users.DB.ConnectionString = bench.UsersDBSettings.ConnectionString;
Users.DB.CreateEmptyDB();
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
string msg = Strings.Error_while_creating_DB_Reason + Environment.NewLine + exception.Message;
if (exception.InnerException != null)
{
msg += Environment.NewLine + exception.InnerException.Message;
}
MessageBox.Show(msg, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void testConnConfigDbBtn_Click(object sender, EventArgs e)
{
}
private void testConnResultsDbBtn_Click(object sender, EventArgs e)
{
}
private void testConnUsersDbBtn_Click(object sender, EventArgs e)
{
}
}
}
+693
View File
@@ -0,0 +1,693 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 15</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>225, 28</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>20</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 49</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>225, 28</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>21</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 18</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 13</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Test Bench Name</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>19</value>
</data>
<data name="benchNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 15</value>
</data>
<data name="benchNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>315, 20</value>
</data>
<data name="benchNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Name" xml:space="preserve">
<value>benchNameTextBox</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchNameTextBox.ZOrder" xml:space="preserve">
<value>18</value>
</data>
<data name="connectionStringLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="connectionStringLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>199, 82</value>
</data>
<data name="connectionStringLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 13</value>
</data>
<data name="connectionStringLabel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="connectionStringLabel.Text" xml:space="preserve">
<value>Connection string</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Name" xml:space="preserve">
<value>connectionStringLabel</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;connectionStringLabel.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="configDbConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 107</value>
</data>
<data name="configDbConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="configDbConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>20</value>
</data>
<data name="&gt;&gt;configDbConnectionStringTextBox.Name" xml:space="preserve">
<value>configDbConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;configDbConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;configDbConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;configDbConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="resultsDbConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 137</value>
</data>
<data name="resultsDbConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="resultsDbConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;resultsDbConnectionStringTextBox.Name" xml:space="preserve">
<value>resultsDbConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;resultsDbConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;resultsDbConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;resultsDbConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="configLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="configLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 110</value>
</data>
<data name="configLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 13</value>
</data>
<data name="configLabel.TabIndex" type="System.Int32, mscorlib">
<value>49</value>
</data>
<data name="configLabel.Text" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="&gt;&gt;configLabel.Name" xml:space="preserve">
<value>configLabel</value>
</data>
<data name="&gt;&gt;configLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;configLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;configLabel.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="resultsLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="resultsLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 140</value>
</data>
<data name="resultsLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>42, 13</value>
</data>
<data name="resultsLabel.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
</data>
<data name="resultsLabel.Text" xml:space="preserve">
<value>Results</value>
</data>
<data name="&gt;&gt;resultsLabel.Name" xml:space="preserve">
<value>resultsLabel</value>
</data>
<data name="&gt;&gt;resultsLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;resultsLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;resultsLabel.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="realBenchCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="realBenchCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 47</value>
</data>
<data name="realBenchCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 17</value>
</data>
<data name="realBenchCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>54</value>
</data>
<data name="realBenchCheckBox.Text" xml:space="preserve">
<value>Test bench is controlled by this computer</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Name" xml:space="preserve">
<value>realBenchCheckBox</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="dbTypeLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="dbTypeLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 82</value>
</data>
<data name="dbTypeLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value>
</data>
<data name="dbTypeLabel.TabIndex" type="System.Int32, mscorlib">
<value>55</value>
</data>
<data name="dbTypeLabel.Text" xml:space="preserve">
<value>Database type</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Name" xml:space="preserve">
<value>dbTypeLabel</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;dbTypeLabel.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="configDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 107</value>
</data>
<data name="configDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="configDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>58</value>
</data>
<data name="&gt;&gt;configDbTypeComboBox.Name" xml:space="preserve">
<value>configDbTypeComboBox</value>
</data>
<data name="&gt;&gt;configDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;configDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;configDbTypeComboBox.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="resultsDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 137</value>
</data>
<data name="resultsDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="resultsDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>60</value>
</data>
<data name="&gt;&gt;resultsDbTypeComboBox.Name" xml:space="preserve">
<value>resultsDbTypeComboBox</value>
</data>
<data name="&gt;&gt;resultsDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;resultsDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;resultsDbTypeComboBox.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testConnConfigDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnConfigDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 105</value>
</data>
<data name="testConnConfigDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnConfigDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>62</value>
</data>
<data name="testConnConfigDbBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnConfigDbBtn.Name" xml:space="preserve">
<value>testConnConfigDbBtn</value>
</data>
<data name="&gt;&gt;testConnConfigDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnConfigDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnConfigDbBtn.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="testConnResultsDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnResultsDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 135</value>
</data>
<data name="testConnResultsDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnResultsDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>64</value>
</data>
<data name="testConnResultsDbBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnResultsDbBtn.Name" xml:space="preserve">
<value>testConnResultsDbBtn</value>
</data>
<data name="&gt;&gt;testConnResultsDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnResultsDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnResultsDbBtn.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="createConfigDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createConfigDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>715, 104</value>
</data>
<data name="createConfigDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 23</value>
</data>
<data name="createConfigDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>66</value>
</data>
<data name="createConfigDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createConfigDbBtn.Name" xml:space="preserve">
<value>createConfigDbBtn</value>
</data>
<data name="&gt;&gt;createConfigDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createConfigDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createConfigDbBtn.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="createResultsDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createResultsDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>715, 134</value>
</data>
<data name="createResultsDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 23</value>
</data>
<data name="createResultsDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>68</value>
</data>
<data name="createResultsDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createResultsDbBtn.Name" xml:space="preserve">
<value>createResultsDbBtn</value>
</data>
<data name="&gt;&gt;createResultsDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createResultsDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createResultsDbBtn.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="createUsersDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createUsersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>715, 164</value>
</data>
<data name="createUsersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 23</value>
</data>
<data name="createUsersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>73</value>
</data>
<data name="createUsersDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Name" xml:space="preserve">
<value>createUsersDbBtn</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="testConnUsersDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnUsersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 165</value>
</data>
<data name="testConnUsersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnUsersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>72</value>
</data>
<data name="testConnUsersDbBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnUsersDbBtn.Name" xml:space="preserve">
<value>testConnUsersDbBtn</value>
</data>
<data name="&gt;&gt;testConnUsersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnUsersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnUsersDbBtn.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="usersDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 167</value>
</data>
<data name="usersDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="usersDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>71</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Name" xml:space="preserve">
<value>usersDbTypeComboBox</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="usersLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="usersLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="usersLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 170</value>
</data>
<data name="usersLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 13</value>
</data>
<data name="usersLabel.TabIndex" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="usersLabel.Text" xml:space="preserve">
<value>Users</value>
</data>
<data name="&gt;&gt;usersLabel.Name" xml:space="preserve">
<value>usersLabel</value>
</data>
<data name="&gt;&gt;usersLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersLabel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="usersDbConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 167</value>
</data>
<data name="usersDbConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="usersDbConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>69</value>
</data>
<data name="&gt;&gt;usersDbConnectionStringTextBox.Name" xml:space="preserve">
<value>usersDbConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;usersDbConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersDbConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersDbConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>853, 202</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Test Bench Databases Specification</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>DatabaseSettingsDlg</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+60
View File
@@ -0,0 +1,60 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Drawing;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
public partial class EmergencyStopForm : Form
{
bool closingForm = false;
/// <summary>
/// Parameterless constructor (does the localization)
/// </summary>
public EmergencyStopForm()
{
Visible = true;
InitializeComponent();
emergencyStopMsgLabel.Text = Strings.Emergency_STOP;
emergencyStopMsgLabel.Enabled = true;
emergencyStopMsgLabel.Visible = true;
UiBridge.Bridge.EmergencyStopChangedHandler += delegate(object sender, UiBridge.EmergencyStopEventArgs args)
{
if (closingForm) return;
if (InvokeRequired)
{
Invoke(new EventHandler<UiBridge.EmergencyStopEventArgs>(OnEmergencyStopStateChanged), sender, args);
}
else OnEmergencyStopStateChanged(sender, args);
};
}
void OnEmergencyStopStateChanged(Object sender, UiBridge.EmergencyStopEventArgs args)
{
if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.CloseForm)
{
closingForm = true;
Close();
}
//else if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.Active)
//{
// Visible = true;
// emergencyStopMsgLabel.Enabled = true;
// emergencyStopMsgLabel.Visible = true;
//}
//else if (args.EmergencyStopState == UiBridge.EmergencyStopEventArgs.State.Inactive)
//{
// Visible = false;
// emergencyStopMsgLabel.Enabled = false;
// emergencyStopMsgLabel.Visible = false;
//}
}
}
}
+73
View File
@@ -0,0 +1,73 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class EmergencyStopForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.emergencyStopMsgLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// emergencyStopMsgLabel
//
this.emergencyStopMsgLabel.AutoSize = true;
this.emergencyStopMsgLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.emergencyStopMsgLabel.ForeColor = System.Drawing.Color.Yellow;
this.emergencyStopMsgLabel.Location = new System.Drawing.Point(67, 86);
this.emergencyStopMsgLabel.Name = "emergencyStopMsgLabel";
this.emergencyStopMsgLabel.Size = new System.Drawing.Size(287, 37);
this.emergencyStopMsgLabel.TabIndex = 1;
this.emergencyStopMsgLabel.Text = "Emergency STOP";
//
// EmergencyStopForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.Color.Red;
this.ClientSize = new System.Drawing.Size(412, 212);
this.Controls.Add(this.emergencyStopMsgLabel);
this.ForeColor = System.Drawing.Color.Transparent;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EmergencyStopForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Emergency STOP";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label emergencyStopMsgLabel;
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+110
View File
@@ -0,0 +1,110 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class ErrorDlg
{
private string m_message;
public string Message
{
get
{
return m_message;
}
set
{
m_message = value;
textBoxMessage.Text = m_message;
}
}
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorDlg));
this.btnCancel = new System.Windows.Forms.Button();
this.btnIgnore = new System.Windows.Forms.Button();
this.btnRetry = new System.Windows.Forms.Button();
this.textBoxMessage = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
resources.ApplyResources(this.btnCancel, "btnCancel");
this.btnCancel.Name = "btnCancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnIgnore
//
this.btnIgnore.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
resources.ApplyResources(this.btnIgnore, "btnIgnore");
this.btnIgnore.Name = "btnIgnore";
this.btnIgnore.UseVisualStyleBackColor = true;
this.btnIgnore.Click += new System.EventHandler(this.btnIgnore_Click);
//
// btnRetry
//
this.btnRetry.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
resources.ApplyResources(this.btnRetry, "btnRetry");
this.btnRetry.Name = "btnRetry";
this.btnRetry.UseVisualStyleBackColor = true;
this.btnRetry.Click += new System.EventHandler(this.btnRetry_Click);
//
// textBoxMessage
//
resources.ApplyResources(this.textBoxMessage, "textBoxMessage");
this.textBoxMessage.Name = "textBoxMessage";
//
// ErrorDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.textBoxMessage);
this.Controls.Add(this.btnRetry);
this.Controls.Add(this.btnIgnore);
this.Controls.Add(this.btnCancel);
this.Name = "ErrorDlg";
this.Load += new System.EventHandler(this.ErrorDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnIgnore;
private System.Windows.Forms.Button btnRetry;
private System.Windows.Forms.TextBox textBoxMessage;
}
}
+65
View File
@@ -0,0 +1,65 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TBF;
using TBF.ErrorHandler;
using TBF.Resources;
namespace TBF.Forms
{
public partial class ErrorDlg : Form
{
public DialogResult returnvalue;
public ErrorDlg()
{
InitializeComponent();
}
public ErrorDlg(string ErrorDescription)
: this()
{
textBoxMessage.Text = ErrorDescription;
}
private void ErrorDlg_Load(object sender, EventArgs e)
{
Text = Strings.An_unhandled_error_occured;
btnCancel.Text = Strings.CancelBtnText;
btnRetry.Text = Strings.RetryBtnText;
btnIgnore.Text = Strings.IgnoreBtnText;
}
private void btnOk_Click(object sender, EventArgs e)
{
returnvalue = DialogResult.OK;
this.Close();
}
private void btnIgnore_Click(object sender, EventArgs e)
{
returnvalue = DialogResult.Ignore;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
returnvalue = DialogResult.Cancel;
this.Close();
}
private void btnRetry_Click(object sender, EventArgs e)
{
returnvalue = DialogResult.Retry;
this.Close();
}
}
}
+240
View File
@@ -0,0 +1,240 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>187, 340</value>
</data>
<data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnCancel.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;btnCancel.Name" xml:space="preserve">
<value>btnCancel</value>
</data>
<data name="&gt;&gt;btnCancel.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnCancel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnCancel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="btnIgnore.Location" type="System.Drawing.Point, System.Drawing">
<value>399, 340</value>
</data>
<data name="btnIgnore.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 23</value>
</data>
<data name="btnIgnore.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="btnIgnore.Text" xml:space="preserve">
<value>Ignore</value>
</data>
<data name="&gt;&gt;btnIgnore.Name" xml:space="preserve">
<value>btnIgnore</value>
</data>
<data name="&gt;&gt;btnIgnore.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnIgnore.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnIgnore.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnRetry.Location" type="System.Drawing.Point, System.Drawing">
<value>293, 340</value>
</data>
<data name="btnRetry.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 23</value>
</data>
<data name="btnRetry.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="btnRetry.Text" xml:space="preserve">
<value>Retry</value>
</data>
<data name="&gt;&gt;btnRetry.Name" xml:space="preserve">
<value>btnRetry</value>
</data>
<data name="&gt;&gt;btnRetry.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnRetry.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnRetry.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="textBoxMessage.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 43</value>
</data>
<data name="textBoxMessage.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="textBoxMessage.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="textBoxMessage.Size" type="System.Drawing.Size, System.Drawing">
<value>508, 280</value>
</data>
<data name="textBoxMessage.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;textBoxMessage.Name" xml:space="preserve">
<value>textBoxMessage</value>
</data>
<data name="&gt;&gt;textBoxMessage.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxMessage.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;textBoxMessage.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>530, 375</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>An unhandled Error occured</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ErrorDlg</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+175
View File
@@ -0,0 +1,175 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
/// <summary>
/// Provides login dialog that includes test bench selection.
/// It is used only once on program startup. Does not do authorisation
/// as User.users have not been loadded from the DB yet.
/// </summary>
public partial class LoginDlgWithBenchSelection : Form
{
/// Private fields
string alias;
string password;
string benchName = null;
string legalizator;
/// Readonly public properties to do the authorization.
public string Alias { get { return alias; } }
public string Password { get { return password; } }
public string BenchName { get { return benchName; } }
public Users.Entities.LoginMethod Method;
public string Legalizator { get { return legalizator; } }
/// <summary>
/// Constructor.
/// </summary>
public LoginDlgWithBenchSelection()
{
InitializeComponent();
}
/// <summary>
/// Constructor with a predefined bench.
/// </summary>
public LoginDlgWithBenchSelection(string predefinedBench)
: this()
{
benchName = predefinedBench;
#if LANG_PL || BAHRAIN_50
Height = 156;
EnableAndPrepareLegalizatorCombo(legalizatorComboBox);
#else
legalizator = string.Empty;
#endif
}
/// <summary>
/// Load Legalizator order combo box items from the LocalSettings LastLegalizators array
/// </summary>
/// <param name="orderComboBox">Legalizator ComboBox</param>
void EnableAndPrepareLegalizatorCombo(ComboBox comboBox)
{
legalizatorLabel.Visible = true;
legalizatorComboBox.Visible = true;
legalizatorComboBox.Enabled = true;
for (int i = 0; i < Program.LocalSettings.LastLegalizatorsCount; i++)
{
comboBox.Items.Add(Program.LocalSettings.LastLegalizators[i]);
}
legalizator = (comboBox.Items.Count > 0) ? Program.LocalSettings.LastLegalizators[0] : string.Empty;
comboBox.Text = legalizator;
}
private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e)
{
Localize();
#if DEBUG
userNameTextBox.Text = "milan";
passwordTextBox.Text = "napajedla";
#endif
for (int i = 0; i < Program.LocalSettings.BenchesCount; i++)
{
testBenchComboBox.Items.Add(Program.LocalSettings.TestBenches[i].BenchName);
if (benchName != null && benchName == Program.LocalSettings.TestBenches[i].BenchName)
{
testBenchComboBox.Text = benchName;
}
}
}
void Localize()
{
Text = Strings.User_Login + " TBF v." + Program.Version;
aliasLabel.Text = GetAliasLabel();
passwordLabel.Text = Strings.Password;
testBenchLabel.Text = Strings.Test_bench;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
legalizatorLabel.Text = Strings.Legalizator;
}
string GetAliasLabel()
{
switch (Method)
{
default:
case Users.Entities.LoginMethod.UserName: return Strings.User_name;
case Users.Entities.LoginMethod.FullName: return Strings.Full_name;
case Users.Entities.LoginMethod.Number: return Strings.User_code;
}
}
/// <summary>
/// OK clicked (authorization is done outside this dialog).
/// </summary>
private void okButton_Click(object sender, EventArgs e)
{
if (testBenchComboBox.SelectedItem != null)
{
alias = userNameTextBox.Text;
password = passwordTextBox.Text;
benchName = testBenchComboBox.SelectedItem.ToString();
if (legalizatorComboBox.Enabled)
{
legalizator = legalizatorComboBox.Text;
Program.LocalSettings.UpdateHistory(legalizator, ref Program.LocalSettings.LastLegalizators);
}
DialogResult = DialogResult.OK;
Close();
return;
}
else
{
MessageBox.Show(Strings.PLs_select_testbench, Strings.Warning, MessageBoxButtons.OK);
}
}
/// <summary>
/// Cancel clicked.
/// </summary>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
return;
}
private void passwordTextBox_TextChanged(object sender, EventArgs e)
{
if (passwordTextBox.Text != "")
{
this.AcceptButton = okButton;
}
}
private void userNameTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (Convert.ToInt32(e.KeyChar) == 13)
{
passwordTextBox.Focus();
}
}
private void aliasLabel_Click(object sender, EventArgs e)
{
Method++;
if (Method == Users.Entities.LoginMethod.Count)
Method = 0;
aliasLabel.Text = GetAliasLabel();
}
}
}
+148
View File
@@ -0,0 +1,148 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class LoginDlgWithBenchSelection
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection));
this.aliasLabel = new System.Windows.Forms.Label();
this.passwordLabel = new System.Windows.Forms.Label();
this.testBenchLabel = new System.Windows.Forms.Label();
this.testBenchComboBox = new System.Windows.Forms.ComboBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userNameTextBox = new System.Windows.Forms.TextBox();
this.legalizatorComboBox = new System.Windows.Forms.ComboBox();
this.legalizatorLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// aliasLabel
//
resources.ApplyResources(this.aliasLabel, "aliasLabel");
this.aliasLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.aliasLabel.Name = "aliasLabel";
//
// passwordLabel
//
resources.ApplyResources(this.passwordLabel, "passwordLabel");
this.passwordLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.passwordLabel.Name = "passwordLabel";
//
// testBenchLabel
//
resources.ApplyResources(this.testBenchLabel, "testBenchLabel");
this.testBenchLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.testBenchLabel.Name = "testBenchLabel";
//
// testBenchComboBox
//
resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox");
this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.testBenchComboBox.FormattingEnabled = true;
this.testBenchComboBox.Name = "testBenchComboBox";
//
// passwordTextBox
//
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
//
// cancelButton
//
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userNameTextBox
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
//
// legalizatorComboBox
//
resources.ApplyResources(this.legalizatorComboBox, "legalizatorComboBox");
this.legalizatorComboBox.FormattingEnabled = true;
this.legalizatorComboBox.Name = "legalizatorComboBox";
//
// legalizatorLabel
//
resources.ApplyResources(this.legalizatorLabel, "legalizatorLabel");
this.legalizatorLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
this.legalizatorLabel.Name = "legalizatorLabel";
//
// LoginDlgWithBenchSelection
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.legalizatorComboBox);
this.Controls.Add(this.legalizatorLabel);
this.Controls.Add(this.userNameTextBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.testBenchComboBox);
this.Controls.Add(this.testBenchLabel);
this.Controls.Add(this.passwordLabel);
this.Controls.Add(this.aliasLabel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LoginDlgWithBenchSelection";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label aliasLabel;
private System.Windows.Forms.Label passwordLabel;
private System.Windows.Forms.Label testBenchLabel;
private System.Windows.Forms.TextBox userNameTextBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.ComboBox testBenchComboBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.ComboBox legalizatorComboBox;
private System.Windows.Forms.Label legalizatorLabel;
}
}
+411
View File
@@ -0,0 +1,411 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="aliasLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="aliasLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 17</value>
</data>
<data name="aliasLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="aliasLabel.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="aliasLabel.Text" xml:space="preserve">
<value>User name</value>
</data>
<data name="&gt;&gt;aliasLabel.Name" xml:space="preserve">
<value>aliasLabel</value>
</data>
<data name="&gt;&gt;aliasLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;aliasLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;aliasLabel.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="passwordLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="passwordLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 44</value>
</data>
<data name="passwordLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 13</value>
</data>
<data name="passwordLabel.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="passwordLabel.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="&gt;&gt;passwordLabel.Name" xml:space="preserve">
<value>passwordLabel</value>
</data>
<data name="&gt;&gt;passwordLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;passwordLabel.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="testBenchLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="testBenchLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 70</value>
</data>
<data name="testBenchLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="testBenchLabel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="testBenchLabel.Text" xml:space="preserve">
<value>Test bench</value>
</data>
<data name="&gt;&gt;testBenchLabel.Name" xml:space="preserve">
<value>testBenchLabel</value>
</data>
<data name="&gt;&gt;testBenchLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testBenchLabel.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testBenchComboBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="testBenchComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 67</value>
</data>
<data name="testBenchComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 21</value>
</data>
<data name="testBenchComboBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Name" xml:space="preserve">
<value>testBenchComboBox</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testBenchComboBox.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="passwordTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 41</value>
</data>
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="passwordTextBox.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;passwordTextBox.Name" xml:space="preserve">
<value>passwordTextBox</value>
</data>
<data name="&gt;&gt;passwordTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;passwordTextBox.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="cancelButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>334, 48</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="okButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>334, 14</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="userNameTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 15</value>
</data>
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="userNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;userNameTextBox.Name" xml:space="preserve">
<value>userNameTextBox</value>
</data>
<data name="&gt;&gt;userNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;userNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;userNameTextBox.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="legalizatorComboBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="legalizatorComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>148, 95</value>
</data>
<data name="legalizatorComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 21</value>
</data>
<data name="legalizatorComboBox.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="legalizatorComboBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;legalizatorComboBox.Name" xml:space="preserve">
<value>legalizatorComboBox</value>
</data>
<data name="&gt;&gt;legalizatorComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;legalizatorComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;legalizatorComboBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="legalizatorLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="legalizatorLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="legalizatorLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 98</value>
</data>
<data name="legalizatorLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="legalizatorLabel.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="legalizatorLabel.Text" xml:space="preserve">
<value>Legalizator</value>
</data>
<data name="legalizatorLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;legalizatorLabel.Name" xml:space="preserve">
<value>legalizatorLabel</value>
</data>
<data name="&gt;&gt;legalizatorLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;legalizatorLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;legalizatorLabel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>454, 102</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>User login</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>LoginDlgWithBenchSelection</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+89
View File
@@ -0,0 +1,89 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using TBF.UiBridge;
namespace TBF.Forms
{
public partial class ModelessActivityForm : Form
{
/// <summary>
/// Called from the state machine when an operation forces a modeless dialog close.
/// </summary>
public void CloseForm(object sender, EventArgs args)
{
if (CloseFormHandler == null) return;
try { CloseFormHandler(sender, null); }
catch (Exception) { }
}
public event EventHandler<EventArgs> CloseFormHandler;
public string Title;
public string Message;
public Color BackgroundColor;
public Color TextColor;
public Font TextFont;
public string FontFamily;
public int FontSize;
public FontStyle FontStyle;
public bool StartActivityHandler;
/// <summary>
/// Constructor to be used by the application
/// </summary>
/// <param name="title">Window title</param>
/// <param name="message">Displayed message</param>
public ModelessActivityForm()
{
InitializeComponent();
ControlBox = false;
CloseFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnCloseForm), sender, args); }
else OnCloseForm(sender, args);
};
}
private void ModelessForm_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Title)) Text = Title;
if (!string.IsNullOrEmpty(Message)) label1.Text = Message;
if (BackgroundColor != null) BackColor = BackgroundColor;
if (TextColor != null) ForeColor = TextColor;
if (!string.IsNullOrEmpty(FontFamily))
{
label1.Font = new Font(FontFamily, FontSize, FontStyle);
activityStatusLabel.Font = new Font(FontFamily, FontSize, FontStyle);
}
float textWidth = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(label1.Text, label1.Font).Width;
float textHeight = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(label1.Text, label1.Font).Height;
Width = (int)textWidth + 120; /// Form width calculated from the text width
if (StartActivityHandler)
{
Height += (int)textHeight; /// Form height calculated from the text width
Bridge.ActivityHandler += delegate(object sndr, ActivityEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<ActivityEventArgs>(OnActivity), sndr, args); }
else OnActivity(sndr, args);
};
}
}
void OnActivity(object sender, ActivityEventArgs args)
{
activityStatusLabel.Text = args.Activity;
}
void OnCloseForm(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+74
View File
@@ -0,0 +1,74 @@
namespace TBF.Forms
{
partial class ModelessActivityForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.activityStatusLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(64, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(0, 13);
this.label1.TabIndex = 0;
//
// activityStatusLabel
//
this.activityStatusLabel.AutoSize = true;
this.activityStatusLabel.Location = new System.Drawing.Point(64, 85);
this.activityStatusLabel.Name = "activityStatusLabel";
this.activityStatusLabel.Size = new System.Drawing.Size(0, 13);
this.activityStatusLabel.TabIndex = 1;
//
// ModelessActivityForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.OliveDrab;
this.ClientSize = new System.Drawing.Size(594, 101);
this.Controls.Add(this.activityStatusLabel);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MinimizeBox = false;
this.Name = "ModelessActivityForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Load += new System.EventHandler(this.ModelessForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label activityStatusLabel;
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+136
View File
@@ -0,0 +1,136 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class NoBenchOrDatabaseDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NoBenchOrDatabaseDlg));
this.exitButton = new System.Windows.Forms.Button();
this.retryButton = new System.Windows.Forms.Button();
this.configureButton = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.errorMessageLabel = new System.Windows.Forms.Label();
this.upgradeButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// exitButton
//
this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.exitButton.Location = new System.Drawing.Point(42, 68);
this.exitButton.Name = "exitButton";
this.exitButton.Size = new System.Drawing.Size(388, 33);
this.exitButton.TabIndex = 0;
this.exitButton.Text = "Exit";
this.exitButton.UseVisualStyleBackColor = true;
this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
//
// retryButton
//
this.retryButton.Location = new System.Drawing.Point(42, 146);
this.retryButton.Name = "retryButton";
this.retryButton.Size = new System.Drawing.Size(388, 33);
this.retryButton.TabIndex = 1;
this.retryButton.Text = "Retry database connection";
this.retryButton.UseVisualStyleBackColor = true;
this.retryButton.Click += new System.EventHandler(this.retryButton_Click);
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(42, 107);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(388, 33);
this.configureButton.TabIndex = 2;
this.configureButton.Text = "Configure test benches (password required)";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// pictureBox1
//
this.pictureBox1.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.ErrorImage")));
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(42, 21);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// errorMessageLabel
//
this.errorMessageLabel.AutoSize = true;
this.errorMessageLabel.Location = new System.Drawing.Point(80, 31);
this.errorMessageLabel.Name = "errorMessageLabel";
this.errorMessageLabel.Size = new System.Drawing.Size(160, 13);
this.errorMessageLabel.TabIndex = 4;
this.errorMessageLabel.Text = "Cannot connect to the database";
//
// upgradeButton
//
this.upgradeButton.Location = new System.Drawing.Point(42, 185);
this.upgradeButton.Name = "upgradeButton";
this.upgradeButton.Size = new System.Drawing.Size(388, 33);
this.upgradeButton.TabIndex = 5;
this.upgradeButton.Text = "Upgrade the database";
this.upgradeButton.UseVisualStyleBackColor = true;
this.upgradeButton.Click += new System.EventHandler(this.upgradeButton_Click);
//
// NoBenchOrDatabaseDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.exitButton;
this.ClientSize = new System.Drawing.Size(466, 240);
this.Controls.Add(this.upgradeButton);
this.Controls.Add(this.errorMessageLabel);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.retryButton);
this.Controls.Add(this.exitButton);
this.Name = "NoBenchOrDatabaseDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Error";
this.Load += new System.EventHandler(this.NoDatabaseMsgDlg_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button exitButton;
private System.Windows.Forms.Button retryButton;
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label errorMessageLabel;
private System.Windows.Forms.Button upgradeButton;
}
}
+41
View File
@@ -0,0 +1,41 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
public partial class NoBenchOrDatabaseDlg : Form
{
public string Message;
public bool ShowRetry;
public NoBenchOrDatabaseDlg()
{
InitializeComponent();
}
private void NoDatabaseMsgDlg_Load(object sender, EventArgs e)
{
Text = Strings.Error;
errorMessageLabel.Text = (Message != null) ? Message : Strings.Cannot_connect_to_the_database;
exitButton.Text = Strings.ExitBtnText;
retryButton.Text = Strings.RetryDatabaseText;
configureButton.Text = Strings.ConfigureDatabaseText;
if (!ShowRetry) retryButton.Enabled = false;
}
private void exitButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Abort; } /// Exit
private void configureButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; } /// Configure test benches
private void retryButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Retry; } /// Retry connection to the database
private void upgradeButton_Click(object sender, EventArgs e) { DialogResult = DialogResult.Yes; } /// Upgrade the database
}
}
+272
View File
@@ -0,0 +1,272 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.ErrorImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA0sAAALBCAIAAAAGeq0rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAF7tJREFUeF7t3Vtw
l/Wdx3HvCEkQldrOdJiOhx6o2GqrUEAQFDlExcNuW7fVqb2o3c44g9Orbhc7uDe7nemO2M5gdXWtBBYS
BA0oa1By4BwIIWAgIYEi4aCEJFhd123VKfvk0O1h2t274H7m9Zonmf/h9/s+t+95kv/zv+Dc/6qnp2fn
jh3VVVVLHn304UWLHlq4sDiKB8XT4sXirWLB8FIAAD4a/mLhdXZ2rq6ufmTx4srKysbGxq6urrP9/R8M
Kh4UT4sXi7eKBcWyYvHwNgAAzrc/U3i9vb01NTVLlixpaGjoK550HjpZV3dkVVXH0scP/OOP9/5o8Ws/
+efOymXd9Y1nOjv7zpwplhWLiy3F2uERAACcP39aeIc6OpYuXbqxtvatvr5TW7Z2P7/29L8+c+yhh7rv
u+/4X321++67Xr/zzsN33tl+192td9/ddP/9bcuWHWva+ebJk8WWYmOxfXgQAADnyR8V3v79+3/62GNt
bW19+/a9Xr26r7LyxAMPvHH33SfvvPPkgjuPLVjw+oIFRxYsOFxx+6Fbb22vmHdg3rzmioqtt92279FH
T+9pKTYW24shw+MAADgffl94hzo6ij7r7u4+vmHDyZWrTv3g704Ntt3xO+4o2u7o7bcfue22wxUVHfPn
H5w3r23OnP1z5rTOnr3n5pubZ87cMnv2v8+Ze2Tt2mJ7McSVPACA82i48Hp7e5cuXdrW1jaQd888c/y7
f/vGXXccmzu3a8aMI7fcMtB28+d3zpt/cO7cttm37J89u/Xmm1tm39Q0bdr2a760ddKkrdOn18+YsWHm
rCNr1hRDilH+Jw8A4HwZLryampqNtbV9+/YdXrLkxPe+d/yOOw7PurHngQf+a/36kw888NoNUzvmzj0w
e/ZQ2zXPmrV75sxt113XfMcdx595pvXe+1656vObJk+unTJ13Y0ze5qbi1HFwKHJAACMsIHC6+zsXLJk
yVt9fe2PP35i0aJjty04fNNNb9x//7k33xxY0tNz5Jvf3H3ddUNtt2vGjKYbZ2y59tpd8+f/srHx6Nm+
Y/v27fzq116cMOGlL3953fXXv/zXXy1GFQPdQgUA4LwYKLzV1dX19fVv7N51+Id///rttxd5d+yee86d
OTO0YsCbpzvuvXfHF7+468Ybt0+btvmLVzdV3PrLLVu6Tpw4cPBgW1dXZ/PuV+fNW/uZz6yZePXzX77u
0Ip/a2hoKMYObwcAYARd0NPT88jixb09PV2rVh3+9rcPz5vTPn360Xv+5tw77wwvGfTr06cP3Htv3YQJ
dROv2l5RcXjr1q6TJw8ePLhv795Tp0+/++67L1RUrLz88pVXXVU98erae77Wd+ZMMdY3XgAAjLwLdu7Y
UVlZeaazq/XBBztuuaV99k1tN9/ccv31h7/znXNvvVWs+PDDD9977713P/zwV93H99x11+ZZs4q8O9Td
ffDAgdbW1oG8e+edylmzniwvrxw79tmxY/917Njqa649vX//8uXLi+FDpwEAYMRcUF1V1djY2P1KXevX
vn7gpptemzlz78yZe2bM2HrV1W3f+tZ7vb3vnzv39ttvn+3v7/nVr9547bX2urq2rq6i7Xbv2nX81Kn/
ePvtZ6dNe6K8fHlZ2S/Kyp4ZPFaMH9/29NObN28uhg+fBwCAkXLBkkcf7erqOvjU0y0VFftm3Lh3xvTd
06c3TZu2c+oNdRMm7Lnvvv5Tp/rfffeNU6eOHj3aeeRIW2dnS0tLU1NT91DezZz5ZHn5itLSZWVlzw4e
RedVjhvX+OCDxdhi+PB5AAAYKRc8vGjR2f7+5kcW77lp1lDbNU2bsm3KlC2TJzdOnfrylZdvufXWo83N
R44da29vb3vttb0tLbt27eo+fvydt99efvPNQ3k3dCwvKyuOIvWWXXhhzexbirHF8OHzAAAwUi54aOHC
Dz74oP4b39h9ww1F3m37yle2TJrUOHly/eTJtVdeuW706FWlpfUVFQfa2/e3tQ1dvdu6bVt/f/+L99//
RHl58e7K3x1F5A39XlFWtvILXyjGFsOHzwMAwEgZKLzf/OY3m7/73YHrdkXbXX99/aRJm6699qVx49aO
Hl1VWvripz61b/Xqlra2PXv2DOTd1q2bt2xp2Latef36lyZOLHquWFMc1X94FIX3pS+9//77Cg8AYOQN
/JW290zvzod/1DBlSn2Rd5Mn1V51Vc3o0WsG827d+PH71q/f09HR3NzctHPn1qLwduzY3NBQV1e3afv2
vbW1Gz7/+WJZsbjIwRd+d9SUl78wb15/X5+/0gIAjLyBT1p0HOrc/+STr06Zsmny5JevvrpoterBP7a+
MH5867p1ze3tzXv27Ny5s/vkybN9fS+vWbNpy5aG+vrGxsYdra0HN2+u/dznisJbP3i8VBwlJRsuvLBh
4cKBr8rwSQsAgBE3cLeU+vr6I6++8vLUabXXXDOUdytLS9dcemnr2rVF3u1ubt6xY0eRd2+dPbtsypTK
K66ofW5NY1NT086dLS0tnd3d3bubNn3600XYbSwpeaWk5NWSkucuHHuwclmRgO6WAgAw8gbuePzssmdP
drS/OG3a2ksuqRq8erd63LjW554byLvdu4u8OzaYd0M3Rini77kJExrWr9976NCh9vZjx471/+d7/fv3
N47/VP2oUQ2jRjWOGrX6sst7DrYtX17pjscAACNv+FvLTp04sX7u3KqPfazIu2fLyqovv3x3XV3Tvn3b
t2/vPnHirf7+Z2688YnBvBv6UEXNxIktjY3Hz5zp7e399W9/e7a/v27ChG2jRu0cXbJt7NjmH/9TX2/v
PzzyiG8tAwAYeRcUP6urqxsaGg4+9dTK8eOXlZf/oqzsX8rKVk2aVL9hw+tvvFHk3dPTp/988L53ReEV
ebd29Oia0aM3fPazR/fu/eDcubfPnn1l/vxNJSUtpaV7y8qeu/jiY431DY0NxdihcwAAMJIGCm/gIxFL
lrzV17duzpwVH//4U2VlT5aXP15eXnnddfs2bnxq2tSl5eXLysqKwltVWvpcaWmRdy+VlLxcUrLlmmuO
P/98w2231Y8atb+srK28fM+4j62bP78YVQwsxg6dAwCAkTRQeIWampqNtbWnd+9e/unP/GLcuJ+XlxdV
Vxw/Hfz9zODXkRWFVzV4AW/96NG1JSWbSkoaR40qfm8fNapou44xY/Zfcsmqyy7rbWl5ZePGYuDQZAAA
Rthw4fX29i5durStra2zqmrFZZc9NW7czwbbrki9J/+g8Ab+A2/wAt6rg3m3o7R0z+jRRd4dGjOmbdy4
qk9+8uja5w8cOFCMKgYOTQYAYIQNF17hUEfHTx97rLu7u6uq6tkrr3z60kt/NmZMEXn/U3gDt1D5gwt4
W0tKdpWX7ysvbx8zpnXcuOorrjj6wgvF9mJIMWp4KAAAI+73hVfYv39/0WdtbW2nd++umX3Lk5/4xNMX
X/xEeflTf1x4r5SUNIwa1TS6bO+YMXsuvviFiy5aX3Frb2trsbHYXgwZHgcAwPnwR4VXONTRsXTp0o21
tW/19b3e2LjtBz989vIrnrrkkhUXXVRVXr6mtPSl0tKNpaX1Y8asGzt25cUX137960fWPl8sLrYUG129
AwA47/608Aq9vb01NTVLliypq6vr7enp6ez85YYNLT/5ycvf/EbV1K+suHriuopbN3//+x2Vy063tfWe
OdNQX18sLrb43zsAgI+CP1N4Qzo7O1dXVz+yeHFlZWVjY2NXV9fZ/v4PBhUPiqfFi8VbxYJimRujAAB8
dPzFwhvS09Ozc8eO6qqqJY8++vCiRQ8tXFgcxYPiafFi8ZZvrQAA+Kj5PwoPAID/dxQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe
AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa
hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA
kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe
AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa
hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA
kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
Wc6d+2/gNp2ukwoN8QAAAABJRU5ErkJggg==
</value>
</data>
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvgAA
Dr4B6kKxwAAACG1JREFUSEu1lmlQW9cVx/mG0GIZZCczGcZjvCQEiLHNYpABAQKEwBjTeqmXCfkQ3Mx4
xp58SlMnY/dLmxl3TJIZu3UhBAQBsYNsisBoByS0C21oMUhCYIQkbFzqxo4n9C89TElqt/3SM1dv3tM7
93fOPfecc1/M+n+UQCCgnJzs5PPrb9787OrVK5cvY+AGj/gTr6Cwofoaea0Bh8PR1dl5/do1Ho8nlUqd
TudKOPxDVHCDR/yJV1CAGpQ3pv2bvMJAMBgcGBior6+XSCQhPDhm/CKRu4Nvv3Xb8vsv9J9fm77xRwev
xSuWLjscoeVlqEEZU6C7gdgiPzcwY7ffunVrRCh8FAotyBXevt6lb5o8V654L1zw/eKkt+bEXHW1q7ra
dqLGUFOjqq01t7R4VMqHfj+mYCKmb4Beyk8MmEymr7780mw2h4zGuc6uEI83X1e3WFPjr672V1V7qqrm
qqrcVVUu7rGZigobl2PhcDRcrqKy0njz5pJWh4mYDsgGLir/MgDjeO31en1DQ/72joVPfrMQRfuOHwd6
9tgxd2Wli8u1l5dbORxzaamptNTAZmuLizUslpzN/mtpmbu3F9MB2bqODQMIHxYIFyL0pibfxV8vnjju
KStz5ue7S0oi6PJyB6fcWlZmZpeY2GxDcbGOXaRiMifSDymyshR5eeL8/CFWobunBxCgNvdjwwC2CEFE
ZFz19fMffQSvXYUFgbq6fwgE/rq66aO59rIyC5tNoDWFhWoWazwjQ3P8uK+pyXD+wmjKu2PZ2cKc3MEC
VkCjAQpAghwxgCRDGmBXbbdvz1+96qmschUVLdbWrj98GFEJBNznzqkzMgj0VH6+qiBffvDgVHn5A6l0
diXkMRqVJ0/dTU6+d/jwYGbm8C9PAgUgkbsRA0hksVi8qJ5yffrbuWPHQPecObO+vByhE/JwyX7+/OSB
A1MFBRNMpuxAmopb8UAud87PW6xWs9Pp0Kjvczi9+/f3pKb1Hc6YafsOuQsspsagFFEswUDA2dHh+uAD
F6fUlpc3e+ZX60+eEHBCvl9aspw/L0pOFqWmTHC5LoXC6fdbrVajXr+wtLS2ttbP5bYnJbWnpHSmpgnP
nEJ9AAt4DModBbnscBouXbKXlNjYRWZsYGam68MP1x89AvrFixdPnz5de/HisdenPXFCVlgI+ozXa7VY
DAZDhP7kCa+w8A6VyqPTm+n0b+j0zvSDSyZTa2sr4DFoKSh676jIcOq0pahomsXSs1ja/HxFSpr5/fef
BoPP19dXV1fRHgKPHy9OT9tEIsQEaPXUlG9h4W+rq81M5p+p1FYK5VsKpSk62hITzY2NMpkM8Bi0LTQW
a0Ojjss15hfo8/PUeXnIP2XuUQREe+FCeGEhvLa2uLAwOzvrcLvNDodOp1OpVF6CzmLB9zYyuYVCaY4O
mOExGNJLl4AFPAatEd5prl/TFhUSaBUzZzwnR56dLc3NHd6bJK+omNVo3B6PzWYzT0/rdbqpqSmvz/dk
dbW1uJigEwOLwICllm3bBtglwAIeg/aLBik+e1Z99Cjo40eOyLOypNnZYuT13r2DcXEdZLKYy7XYbCaz
mfBdMT4eDofv1tYiMnjb/nLABnFto1Da33sPWMAjBp49eya7eDHiNdCZmeKsrLGDB+8xGL1xcXwy+e6u
XcauLjQarVYboSsUMrlcMj6uEQjupaYCBx2Mzq0DBg4dev78ecQAVhFcDio/+1ySkyMGPTtLmJIyEBfX
E6UPJiYaBQKt3a7RaFRKpQIGJidlEolIJBqbmNALhUPvvgs1KMOb/pdjgErt53DCoVAkRNgH+4zDdOfO
/ZwclPtwWhpU4QVc609MNAwOamw2jVarVCq9fv9KKDTc0zOGFYjFyL1Jg8EqkwnfeQcGBNFxD4NEGtq2
TXL5cqRBYJORSShj9/3R4VymMD2doCOUPTt3Gnp7QVdrNJOTk6A/Wllpycnh7dkj7O6RIlhKJbbEgf6p
Vo3t2wfuCIk0SiLdJ5G6t9GtvBZ4EElT1EJzS7PfbrvLZPYmJGC98L2LwTB0d0foajXoniidyEjY7k5O
lggE+pmZGZvN4/GE//40bDJJE3eJY2MlsbHS2Niu3UkBq7m1lRcpNKJVLMzPC8rK+Dt2gI5c7kxKUotE
KqNxYmLCOz//KBxuKihAzoBO7OdAaqpOKvUtL6Mtf//jj8hIFM14bKwyjjROp2u++APO2t9dvx5pFWgG
6EroTdaGhvbExBYqFZXyFwqlIytLPDQ0t7gIemNe3p+i+Q4DoCOMyIKht9+e1et/QJ2vrIyWl4+RSDoy
WU+hdMfHe6RiifRls8Nvs10Plpa2vfFGA4WCUNxGb8nIMI6MNDBzb1GpKB8YQNZ3w/3oTg6TSPL0dF9f
n6SyEsExUShmKlXL2DFYXv7zdg0hDpwltbp13/5vGQz4CyjGV9Er2gviBgOID9xHtghJJLiMcOM6ERsL
tJ1GMyUkdOzeHdTpRkdGfnLgQDaPTAef37Z7dwOD8XUUDUtYzaaBSPSj7iNVQJ8kk7VxcaDP0GhmBoP/
1luzvX0Wi+UVRyZk89B38vnNe/c27tz5NY0GG5sGIrm7xX0FiTRFpRqpVBuNZmAwOvfsme3vf+2hT8jm
ZwtihW515803G+PjkTzYla0GkOxIR1UcRU+jaePj+7dvF3ArggbDf/lsIQTGsUDiw2tOKh3/5NPmpD0N
CQlt27fzqdQeMvkemTyC9kejDdLp7fHxwtOn3b19UP6fPrwIQfiwRUgDNBwcpQGH48HQkO7GjeFzZ/m5
R9rSUge5FbKPP7bzWpbM5iA+HcViKGPKZty3yisMEIIkQyL/Xz5+twoWgHJHS0HbQmtE+8XADR7xJ15B
YUP1lbK+/k8KJ49ubHudCAAAAABJRU5ErkJggg==
</value>
</data>
</root>
+171
View File
@@ -0,0 +1,171 @@
namespace TBF.Forms
{
partial class PreviousResultCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.sendReloadButton = new System.Windows.Forms.Button();
this.sentCheckBox = new System.Windows.Forms.CheckBox();
this.failedCountLabel = new System.Windows.Forms.Label();
this.passedCountLabel = new System.Windows.Forms.Label();
this.purchaseOrderLabel = new System.Windows.Forms.Label();
this.procedureLabel = new System.Windows.Forms.Label();
this.endTimeLabel = new System.Windows.Forms.Label();
this.startTimeLabel = new System.Windows.Forms.Label();
this.batchNrLabel = new System.Windows.Forms.Label();
this.showButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// sendReloadButton
//
this.sendReloadButton.Location = new System.Drawing.Point(832, 2);
this.sendReloadButton.Name = "sendReloadButton";
this.sendReloadButton.Size = new System.Drawing.Size(104, 23);
this.sendReloadButton.TabIndex = 15;
this.sendReloadButton.Text = "Again";
this.sendReloadButton.UseVisualStyleBackColor = true;
this.sendReloadButton.Click += new System.EventHandler(this.sendReloadButton_Click);
//
// sentCheckBox
//
this.sentCheckBox.AutoSize = true;
this.sentCheckBox.Location = new System.Drawing.Point(748, 6);
this.sentCheckBox.Name = "sentCheckBox";
this.sentCheckBox.Size = new System.Drawing.Size(48, 17);
this.sentCheckBox.TabIndex = 14;
this.sentCheckBox.Text = "Sent";
this.sentCheckBox.UseVisualStyleBackColor = true;
//
// failedCountLabel
//
this.failedCountLabel.AutoSize = true;
this.failedCountLabel.Location = new System.Drawing.Point(681, 7);
this.failedCountLabel.Name = "failedCountLabel";
this.failedCountLabel.Size = new System.Drawing.Size(48, 13);
this.failedCountLabel.TabIndex = 13;
this.failedCountLabel.Text = "failedCnt";
//
// passedCountLabel
//
this.passedCountLabel.AutoSize = true;
this.passedCountLabel.Location = new System.Drawing.Point(590, 7);
this.passedCountLabel.Name = "passedCountLabel";
this.passedCountLabel.Size = new System.Drawing.Size(57, 13);
this.passedCountLabel.TabIndex = 12;
this.passedCountLabel.Text = "passedCnt";
//
// purchaseOrderLabel
//
this.purchaseOrderLabel.AutoSize = true;
this.purchaseOrderLabel.Location = new System.Drawing.Point(481, 7);
this.purchaseOrderLabel.Name = "purchaseOrderLabel";
this.purchaseOrderLabel.Size = new System.Drawing.Size(77, 13);
this.purchaseOrderLabel.TabIndex = 11;
this.purchaseOrderLabel.Text = "purchaseOrder";
//
// procedureLabel
//
this.procedureLabel.AutoSize = true;
this.procedureLabel.Location = new System.Drawing.Point(328, 7);
this.procedureLabel.Name = "procedureLabel";
this.procedureLabel.Size = new System.Drawing.Size(55, 13);
this.procedureLabel.TabIndex = 10;
this.procedureLabel.Text = "procedure";
//
// endTimeLabel
//
this.endTimeLabel.AutoSize = true;
this.endTimeLabel.Location = new System.Drawing.Point(185, 7);
this.endTimeLabel.Name = "endTimeLabel";
this.endTimeLabel.Size = new System.Drawing.Size(48, 13);
this.endTimeLabel.TabIndex = 9;
this.endTimeLabel.Text = "endTime";
//
// startTimeLabel
//
this.startTimeLabel.AutoSize = true;
this.startTimeLabel.Location = new System.Drawing.Point(54, 7);
this.startTimeLabel.Name = "startTimeLabel";
this.startTimeLabel.Size = new System.Drawing.Size(50, 13);
this.startTimeLabel.TabIndex = 8;
this.startTimeLabel.Text = "startTime";
//
// batchNrLabel
//
this.batchNrLabel.AutoSize = true;
this.batchNrLabel.Location = new System.Drawing.Point(3, 7);
this.batchNrLabel.Name = "batchNrLabel";
this.batchNrLabel.Size = new System.Drawing.Size(24, 13);
this.batchNrLabel.TabIndex = 16;
this.batchNrLabel.Text = "bNr";
//
// showButton
//
this.showButton.Location = new System.Drawing.Point(939, 2);
this.showButton.Name = "showButton";
this.showButton.Size = new System.Drawing.Size(104, 23);
this.showButton.TabIndex = 17;
this.showButton.Text = "Show";
this.showButton.UseVisualStyleBackColor = true;
this.showButton.Click += new System.EventHandler(this.showButton_Click);
//
// PreviousResultCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showButton);
this.Controls.Add(this.batchNrLabel);
this.Controls.Add(this.sendReloadButton);
this.Controls.Add(this.sentCheckBox);
this.Controls.Add(this.failedCountLabel);
this.Controls.Add(this.passedCountLabel);
this.Controls.Add(this.purchaseOrderLabel);
this.Controls.Add(this.procedureLabel);
this.Controls.Add(this.endTimeLabel);
this.Controls.Add(this.startTimeLabel);
this.Name = "PreviousResultCtrl";
this.Size = new System.Drawing.Size(1048, 26);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button sendReloadButton;
private System.Windows.Forms.CheckBox sentCheckBox;
private System.Windows.Forms.Label failedCountLabel;
private System.Windows.Forms.Label passedCountLabel;
private System.Windows.Forms.Label purchaseOrderLabel;
private System.Windows.Forms.Label procedureLabel;
private System.Windows.Forms.Label endTimeLabel;
private System.Windows.Forms.Label startTimeLabel;
private System.Windows.Forms.Label batchNrLabel;
private System.Windows.Forms.Button showButton;
}
}
+96
View File
@@ -0,0 +1,96 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
public partial class PreviousResultCtrl : UserControl
{
readonly PreviousResultsDlg parent;
readonly bool reloadEn;
public int BatchNr;
public DateTime StarTime;
public DateTime EndTime;
public string ProcedureName;
public string PurchaseOrder;
public int PassedCount;
public int FailedCount;
public bool Sent;
protected PreviousResultCtrl()
{
InitializeComponent();
}
public PreviousResultCtrl(PreviousResultsDlg parent, int bnr, DateTime s, DateTime e, string proc, string pOrd, int passCnt, int failCnt, bool sent, bool reloadEn)
: this()
{
this.parent = parent;
this.reloadEn = reloadEn;
BatchNr = bnr;
StarTime = s;
EndTime = e;
ProcedureName = proc;
PurchaseOrder = pOrd;
PassedCount = passCnt;
FailedCount = failCnt;
Sent = sent;
batchNrLabel.Text = BatchNr.ToString();
startTimeLabel.Text = string.Format("{0} {1}", StarTime.ToShortDateString(), StarTime.ToShortTimeString());
endTimeLabel.Text = string.Format("{0} {1}", EndTime.ToShortDateString(), EndTime.ToShortTimeString());
procedureLabel.Text = ProcedureName;
purchaseOrderLabel.Text = string.Format("{0}: {1}", Strings.PO, PurchaseOrder);
passedCountLabel.Text = string.Format("{0}: {1}", Strings.Passed, PassedCount);
failedCountLabel.Text = string.Format("{0}: {1}", Strings.Failed, FailedCount);
#if MUNICH
sentCheckBox.Text = Strings.Printed;
sentCheckBox.Checked = Sent;
sendReloadButton.Enabled = true; /// 'Print again' function always available
sendReloadButton.Text = reloadEn ? Strings.Restore : Strings.Print_again;
#elif ORACLE_DB
sentCheckBox.Text = Strings.Sent;
sentCheckBox.Checked = Sent;
sendReloadButton.Enabled = reloadEn || !Sent;
sendReloadButton.Text = reloadEn ? Strings.Restore : Strings.Save_again;
#else
sentCheckBox.Visible = false;
sendReloadButton.Enabled = reloadEn;
sendReloadButton.Visible = reloadEn;
sendReloadButton.Text = Strings.Restore;
#endif
showButton.Text = Strings.Show;
}
public void UpdateSentState(bool sent)
{
this.Sent = sent;
#if MUNICH
sentCheckBox.Checked = sent;
sendReloadButton.Enabled = true;
#elif ORACLE_DB
sentCheckBox.Checked = sent;
sendReloadButton.Enabled = !sent;
#endif
}
private void sendReloadButton_Click(object sender, EventArgs e)
{
if (reloadEn)
parent.OnReload(this, new PreviousResultIdEventArgs(BatchNr));
else
parent.OnSendAgain(this, new PreviousResultIdEventArgs(BatchNr));
}
private void showButton_Click(object sender, EventArgs e)
{
parent.OnShowResults(this, new PreviousResultIdEventArgs(BatchNr));
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+14
View File
@@ -0,0 +1,14 @@
using System;
namespace TBF.Forms
{
public class PreviousResultIdEventArgs : EventArgs
{
public int BatchNr;
public PreviousResultIdEventArgs(int batchNr)
{
BatchNr = batchNr;
}
}
}
+78
View File
@@ -0,0 +1,78 @@
namespace TBF.Forms
{
partial class PreviousResultsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.closeButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1073, 897);
this.flowLayoutPanel1.TabIndex = 0;
//
// closeButton
//
this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.closeButton.Location = new System.Drawing.Point(1079, 12);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(103, 37);
this.closeButton.TabIndex = 1;
this.closeButton.Text = "Close";
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// PreviousResultsDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.closeButton;
this.ClientSize = new System.Drawing.Size(1194, 892);
this.Controls.Add(this.closeButton);
this.Controls.Add(this.flowLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "PreviousResultsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Previous results";
this.Load += new System.EventHandler(this.PreviousResultsDlg_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button closeButton;
}
}
+282
View File
@@ -0,0 +1,282 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Results.Entities;
using NHibernate;
using log4net;
using TBF.Resources;
using TBF.BenchControl.DB.SensusOracle;
using Oracle.DataAccess.Client;
namespace TBF.Forms
{
public partial class PreviousResultsDlg : Form
{
static readonly ILog log = LogManager.GetLogger(typeof(PreviousResultsDlg));
ISession session;
int currentBatchNr;
IList<Batch> batches;
bool reloadEn;
public PreviousResultsDlg(bool reloadEn)
{
InitializeComponent();
this.reloadEn = reloadEn;
currentBatchNr = Program.LocalSettings.BatchNr;
SendAgainHandler += delegate(object sndr, PreviousResultIdEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<PreviousResultIdEventArgs>(DoSendAgain), sndr, args); }
else DoSendAgain(sndr, args);
};
ShowResultsHandler += delegate(object sndr, PreviousResultIdEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<PreviousResultIdEventArgs>(DoShowResults), sndr, args); }
else DoShowResults(sndr, args);
};
}
public PreviousResultsDlg()
: this(false)
{
}
private void PreviousResultsDlg_Load(object sender, EventArgs e)
{
Localize();
session = Results.DB.CreateSession();
batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.BatchNr)
.IsBetween(Math.Max(1, currentBatchNr - 25))
.And(Math.Max(1, currentBatchNr - 1))
.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
Redraw();
}
void Localize()
{
Text = Strings.Previous_results;
closeButton.Text = TBF.Resources.Strings.CloseBtnText;
}
public void OnReload(object sender, PreviousResultIdEventArgs data)
{
foreach (var batch in batches)
{
if (batch.BatchNr == data.BatchNr)
{
TBF.UiBridge.Bridge.BatchNr = batch.BatchNr;
Program.MainWnd.UpdateProcedure(batch.ProcedureName);
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.ReloadBatch);
break;
}
}
DialogResult = DialogResult.Cancel;
Close();
}
public event EventHandler<PreviousResultIdEventArgs> SendAgainHandler;
/// <summary>
/// Called from PreviousResultCtrl when 'Send again' button pressed.
/// </summary>
public void OnSendAgain(object sender, PreviousResultIdEventArgs data)
{
if (SendAgainHandler == null) return;
try
{
SendAgainHandler(sender, data);
}
catch (Exception e)
{
log.Error("SendAgainHandler(...) failed", e);
}
}
public void DoSendAgain(object sender, PreviousResultIdEventArgs data)
{
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
#if ORACLE_DB
//System.IO.StreamWriter logger;
//string fname = "C:\\TBF\\Logs\\test.log";
//try { logger = new System.IO.StreamWriter(System.IO.File.Create(fname)); }
//catch
//{
// logger = null;
// log.ErrorFormat("Was not able to open LU log file {0}", fname);
//}
//Database.WriteLogsToDisk(logger, b);
using (ISession configSession = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config))
{
IList<Config.Entities.Component> cmpntEntities = configSession.QueryOver<Config.Entities.Component>()
.OrderBy(x => x.ItemNr).Asc
.Where(x => (x.ClassName == "Sensus-Oracle-Database"))
.List<Config.Entities.Component>();
if (cmpntEntities.Count == 0)
{
MessageBox.Show("Nepodarilo sa uložiť, neviem načítať nastavenia Oracle databázy",
Strings.Error,
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}
TBF.BenchControl.DB.SensusOracle.DatabaseCfg cfg = TBF.BenchControl.ComponentCfgBase.CreateFromDbEntity(DatabaseCfg.Serializer, cmpntEntities[0], null)
as TBF.BenchControl.DB.SensusOracle.DatabaseCfg;
MessageBox.Show(string.Format("Výsledky budú zapísané do '{0}' databázy", cfg.DBUsed),
Strings.Information,
MessageBoxButtons.OK,
MessageBoxIcon.Information);
OracleConnection conn = (cfg.DBUsed == DBUsed.Production)
? new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;")
: new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
if (Database.WriteResultsToDatabase(conn, b, true) == Retv.OK)
{
b.RsltsSent = true; /// Result was successfully sent
session.SaveOrUpdate(b); /// Update MySQL DB
session.Flush();
(sender as PreviousResultCtrl).Sent = true; /// Update UI
Redraw();
}
}
#elif MUNICH
string docVersion = string.Empty;
foreach (var cmp in TBF.BenchControl.StateMachine.Components)
{
if (cmp.ClassName == "ResultsPrinter4Munich")
{
docVersion = (cmp as TBF.BenchControl.ResultsPrinters.Munich.Printer).Version;
break;
}
}
foreach (var wm in b.WaterMeters)
{
new Results.Output.Printers.Munich.MunichPrintDocument(docVersion, wm, Config.Entities.PageOrientation.Portrait).Print();
}
#endif
}
}
}
public event EventHandler<PreviousResultIdEventArgs> ShowResultsHandler;
/// <summary>
/// Called from PreviousResultCtrl when 'Show' button pressed.
/// </summary>
public void OnShowResults(object sender, PreviousResultIdEventArgs data)
{
if (ShowResultsHandler == null) return;
try { ShowResultsHandler(sender, data); }
catch (Exception e) { log.Error("ShowResultsHandler(...) failed", e); }
}
public void DoShowResults(object sender, PreviousResultIdEventArgs data)
{
Results.Forms.BatchResultsDlg dlg = new Results.Forms.BatchResultsDlg();
dlg.PopupResultsLeft = Program.LocalSettings.PopupResultsLeft;
dlg.PopupResultsTop = Program.LocalSettings.PopupResultsTop;
dlg.PopupResultsWidth = Program.LocalSettings.PopupResultsWidth;
dlg.PopupResultsHeight = Program.LocalSettings.PopupResultsHeight;
dlg.MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
dlg.TestsArrangement = Program.LocalSettings.ResultsConfigTests;
dlg.NrMetersInOneGroup = Math.Max(1, Program.LocalSettings.ResultsConfigMetersInOneGroup);
dlg.RsltItems_Screen_SingleWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_SingleWM);
dlg.RsltItems_Screen_CombinedWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_CombinedWM);
dlg.RsltItems_Screen_HeatM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_HeatM);
dlg.RsltsClmnWidths = Program.LocalSettings.RsltsClmnWidths;
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
dlg.Results = Results.BatchResults.FromBatch(b);
dlg.Text = string.Format(Strings.Results_of_batch_0, b.BatchNr);
dlg.Show();
break;
}
}
//if (dlg.PopupResultsLeft != Program.LocalSettings.PopupResultsLeft ||
// dlg.PopupResultsTop != Program.LocalSettings.PopupResultsTop ||
// dlg.PopupResultsWidth != Program.LocalSettings.PopupResultsWidth ||
// dlg.PopupResultsHeight != Program.LocalSettings.PopupResultsHeight)
//{
// Program.LocalSettings.PopupResultsLeft = dlg.PopupResultsLeft;
// Program.LocalSettings.PopupResultsTop = dlg.PopupResultsTop;
// Program.LocalSettings.PopupResultsWidth = dlg.PopupResultsWidth;
// Program.LocalSettings.PopupResultsHeight = dlg.PopupResultsHeight;
// Program.LocalSettings.Save();
//}
}
void Redraw()
{
SuspendLayout();
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
flowLayoutPanel1.Controls.Clear();
if (batches == null || batches.Count == 0) return;
foreach (var b in batches)
{
int passedCount = 0;
int failedCount = 0;
foreach (var wm in b.WaterMeters)
{
if (wm.Passed) { passedCount++; } else { failedCount++; }
}
if (passedCount + failedCount == 0) continue;
flowLayoutPanel1.Controls.Add(new PreviousResultCtrl(this,
b.BatchNr,
b.StartTime,
b.EndTime,
b.ProcedureName,
b.WaterMeters[0].PurchaseOrder,
passedCount,
failedCount,
b.RsltsSent,
reloadEn));
}
ResumeLayout();
}
private void closeButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+161
View File
@@ -0,0 +1,161 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class PrintOrderForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.purchaseOrderComboBox = new System.Windows.Forms.ComboBox();
this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox();
this.printButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.testerGroupBox = new System.Windows.Forms.GroupBox();
this.testerComboBox = new System.Windows.Forms.ComboBox();
this.onlyLastCheckBox = new System.Windows.Forms.CheckBox();
this.onlyGoodCheckBox = new System.Windows.Forms.CheckBox();
this.purchaseOrderGroupBox.SuspendLayout();
this.testerGroupBox.SuspendLayout();
this.SuspendLayout();
//
// purchaseOrderComboBox
//
this.purchaseOrderComboBox.FormattingEnabled = true;
this.purchaseOrderComboBox.Location = new System.Drawing.Point(47, 41);
this.purchaseOrderComboBox.Name = "purchaseOrderComboBox";
this.purchaseOrderComboBox.Size = new System.Drawing.Size(380, 31);
this.purchaseOrderComboBox.TabIndex = 0;
//
// purchaseOrderGroupBox
//
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox);
this.purchaseOrderGroupBox.Location = new System.Drawing.Point(59, 38);
this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox";
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(481, 96);
this.purchaseOrderGroupBox.TabIndex = 1;
this.purchaseOrderGroupBox.TabStop = false;
this.purchaseOrderGroupBox.Text = "Purchase order";
//
// printButton
//
this.printButton.Location = new System.Drawing.Point(106, 348);
this.printButton.Name = "printButton";
this.printButton.Size = new System.Drawing.Size(144, 64);
this.printButton.TabIndex = 2;
this.printButton.Text = "Print";
this.printButton.UseVisualStyleBackColor = true;
this.printButton.Click += new System.EventHandler(this.printButton_Click);
//
// cancelButton
//
this.cancelButton.Location = new System.Drawing.Point(342, 348);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(144, 64);
this.cancelButton.TabIndex = 3;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// testerGroupBox
//
this.testerGroupBox.Controls.Add(this.testerComboBox);
this.testerGroupBox.Location = new System.Drawing.Point(58, 142);
this.testerGroupBox.Name = "testerGroupBox";
this.testerGroupBox.Size = new System.Drawing.Size(481, 96);
this.testerGroupBox.TabIndex = 4;
this.testerGroupBox.TabStop = false;
this.testerGroupBox.Text = "Tester";
//
// testerComboBox
//
this.testerComboBox.FormattingEnabled = true;
this.testerComboBox.Location = new System.Drawing.Point(47, 41);
this.testerComboBox.Name = "testerComboBox";
this.testerComboBox.Size = new System.Drawing.Size(380, 31);
this.testerComboBox.TabIndex = 0;
//
// onlyLastCheckBox
//
this.onlyLastCheckBox.AutoSize = true;
this.onlyLastCheckBox.Location = new System.Drawing.Point(106, 277);
this.onlyLastCheckBox.Name = "onlyLastCheckBox";
this.onlyLastCheckBox.Size = new System.Drawing.Size(335, 27);
this.onlyLastCheckBox.TabIndex = 5;
this.onlyLastCheckBox.Text = "Print only the last measurement";
this.onlyLastCheckBox.UseVisualStyleBackColor = true;
//
// onlyGoodCheckBox
//
this.onlyGoodCheckBox.AutoSize = true;
this.onlyGoodCheckBox.Location = new System.Drawing.Point(106, 244);
this.onlyGoodCheckBox.Name = "onlyGoodCheckBox";
this.onlyGoodCheckBox.Size = new System.Drawing.Size(247, 27);
this.onlyGoodCheckBox.TabIndex = 6;
this.onlyGoodCheckBox.Text = "Print only good results";
this.onlyGoodCheckBox.UseVisualStyleBackColor = true;
this.onlyGoodCheckBox.Visible = false;
//
// PrintOrderForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 23F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(597, 451);
this.Controls.Add(this.onlyGoodCheckBox);
this.Controls.Add(this.onlyLastCheckBox);
this.Controls.Add(this.testerGroupBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.printButton);
this.Controls.Add(this.purchaseOrderGroupBox);
this.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "PrintOrderForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Print watermeter results";
this.Load += new System.EventHandler(this.PrintOrderForm_Load);
this.purchaseOrderGroupBox.ResumeLayout(false);
this.testerGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox purchaseOrderComboBox;
private System.Windows.Forms.GroupBox purchaseOrderGroupBox;
private System.Windows.Forms.Button printButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.GroupBox testerGroupBox;
private System.Windows.Forms.ComboBox testerComboBox;
private System.Windows.Forms.CheckBox onlyLastCheckBox;
private System.Windows.Forms.CheckBox onlyGoodCheckBox;
}
}
+121
View File
@@ -0,0 +1,121 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
public partial class PrintOrderForm : Form
{
public string PurchaseOrder;
public string Tester;
public bool OnlyGoodResults;
public bool OnlyLastResult;
public PrintOrderForm()
{
InitializeComponent();
}
private void PrintOrderForm_Load(object sender, EventArgs e)
{
Localize();
TBF.LocalSettings ls = Program.LocalSettings;
Left = (ls.PrintOrderLeft != 0) ? ls.PrintOrderLeft : 200;
Top = (ls.PrintOrderTop != 0) ? ls.PrintOrderTop : 100;
onlyGoodCheckBox.Checked = OnlyGoodResults = Program.LocalSettings.PrintOrderOnlyGoodResult;
onlyLastCheckBox.Checked = OnlyLastResult = Program.LocalSettings.PrintOrderOnlyLastResult;
PrepareOrderCombo(purchaseOrderComboBox);
PrepareTesterCombo(testerComboBox);
}
void Localize()
{
Text = Strings.Print_watermeter_results;
purchaseOrderGroupBox.Text = Strings.Purchase_order;
testerGroupBox.Text = Strings.Tester;
onlyGoodCheckBox.Text = Strings.Print_only_good_results;
onlyLastCheckBox.Text = Strings.Print_only_the_last_measurement;
printButton.Text = Strings.PrintBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderCombo(ComboBox orderComboBox)
{
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
{
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
}
if (orderComboBox.Items.Count > 0)
{
orderComboBox.Text = orderComboBox.Items[0].ToString();
}
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareTesterCombo(ComboBox testerComboBox)
{
for (int i = 0; i < Program.LocalSettings.TesterHistoryCount; i++)
{
testerComboBox.Items.Add(Program.LocalSettings.TesterHistory[i]);
}
if (testerComboBox.Items.Count > 0)
{
testerComboBox.Text = testerComboBox.Items[0].ToString();
}
}
private void printButton_Click(object sender, EventArgs e)
{
PurchaseOrder = purchaseOrderComboBox.Text;
Tester = testerComboBox.Text;
Program.LocalSettings.PrintOrderOnlyGoodResult = OnlyGoodResults = onlyGoodCheckBox.Checked;
Program.LocalSettings.PrintOrderOnlyLastResult = OnlyLastResult = onlyLastCheckBox.Checked;
Program.LocalSettings.PrintOrderLeft = Location.X;
Program.LocalSettings.PrintOrderTop = Location.Y;
bool b1 = Program.LocalSettings.UpdateHistory(testerComboBox.Text,
ref Program.LocalSettings.TesterHistory);
bool b2 = Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
, 20
#endif
);
if (!b1 && !b2)
{
Program.LocalSettings.Save();
}
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
PurchaseOrder = string.Empty;
Tester = string.Empty;
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+221
View File
@@ -0,0 +1,221 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class ResultsArrangementDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.testsRowsRadioButton = new System.Windows.Forms.RadioButton();
this.testsColumnsRadioButton = new System.Windows.Forms.RadioButton();
this.testsArangementGroupBox = new System.Windows.Forms.GroupBox();
this.metersArangementGroupBox = new System.Windows.Forms.GroupBox();
this.nrMetersTextBox = new System.Windows.Forms.TextBox();
this.nrMetersLabel = new System.Windows.Forms.Label();
this.verticallyRadioButton = new System.Windows.Forms.RadioButton();
this.horizontallyRadioButton = new System.Windows.Forms.RadioButton();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.unlockButton = new System.Windows.Forms.Button();
this.resultsConfigCtrl = new Results.Forms.ResultsConfigCtrl();
this.testsArangementGroupBox.SuspendLayout();
this.metersArangementGroupBox.SuspendLayout();
this.SuspendLayout();
//
// testsRowsRadioButton
//
this.testsRowsRadioButton.AutoSize = true;
this.testsRowsRadioButton.Enabled = false;
this.testsRowsRadioButton.Location = new System.Drawing.Point(21, 21);
this.testsRowsRadioButton.Name = "testsRowsRadioButton";
this.testsRowsRadioButton.Size = new System.Drawing.Size(120, 17);
this.testsRowsRadioButton.TabIndex = 0;
this.testsRowsRadioButton.TabStop = true;
this.testsRowsRadioButton.Text = "Tests are table rows";
this.testsRowsRadioButton.UseVisualStyleBackColor = true;
//
// testsColumnsRadioButton
//
this.testsColumnsRadioButton.AutoSize = true;
this.testsColumnsRadioButton.Enabled = false;
this.testsColumnsRadioButton.Location = new System.Drawing.Point(21, 43);
this.testsColumnsRadioButton.Name = "testsColumnsRadioButton";
this.testsColumnsRadioButton.Size = new System.Drawing.Size(137, 17);
this.testsColumnsRadioButton.TabIndex = 1;
this.testsColumnsRadioButton.TabStop = true;
this.testsColumnsRadioButton.Text = "Tests are table columns";
this.testsColumnsRadioButton.UseVisualStyleBackColor = true;
//
// testsArangementGroupBox
//
this.testsArangementGroupBox.Controls.Add(this.testsColumnsRadioButton);
this.testsArangementGroupBox.Controls.Add(this.testsRowsRadioButton);
this.testsArangementGroupBox.Location = new System.Drawing.Point(14, 12);
this.testsArangementGroupBox.Name = "testsArangementGroupBox";
this.testsArangementGroupBox.Size = new System.Drawing.Size(305, 70);
this.testsArangementGroupBox.TabIndex = 2;
this.testsArangementGroupBox.TabStop = false;
this.testsArangementGroupBox.Text = "Arangement of tests";
//
// metersArangementGroupBox
//
this.metersArangementGroupBox.Controls.Add(this.nrMetersTextBox);
this.metersArangementGroupBox.Controls.Add(this.nrMetersLabel);
this.metersArangementGroupBox.Controls.Add(this.verticallyRadioButton);
this.metersArangementGroupBox.Controls.Add(this.horizontallyRadioButton);
this.metersArangementGroupBox.Location = new System.Drawing.Point(325, 12);
this.metersArangementGroupBox.Name = "metersArangementGroupBox";
this.metersArangementGroupBox.Size = new System.Drawing.Size(593, 70);
this.metersArangementGroupBox.TabIndex = 3;
this.metersArangementGroupBox.TabStop = false;
this.metersArangementGroupBox.Text = "Arangement of tested meters";
//
// nrMetersTextBox
//
this.nrMetersTextBox.Enabled = false;
this.nrMetersTextBox.Location = new System.Drawing.Point(409, 23);
this.nrMetersTextBox.Name = "nrMetersTextBox";
this.nrMetersTextBox.Size = new System.Drawing.Size(41, 20);
this.nrMetersTextBox.TabIndex = 5;
//
// nrMetersLabel
//
this.nrMetersLabel.AutoSize = true;
this.nrMetersLabel.Location = new System.Drawing.Point(263, 23);
this.nrMetersLabel.Name = "nrMetersLabel";
this.nrMetersLabel.Size = new System.Drawing.Size(108, 13);
this.nrMetersLabel.TabIndex = 4;
this.nrMetersLabel.Text = "Nr. meters in a group:";
//
// verticallyRadioButton
//
this.verticallyRadioButton.AutoSize = true;
this.verticallyRadioButton.Enabled = false;
this.verticallyRadioButton.Location = new System.Drawing.Point(21, 21);
this.verticallyRadioButton.Name = "verticallyRadioButton";
this.verticallyRadioButton.Size = new System.Drawing.Size(67, 17);
this.verticallyRadioButton.TabIndex = 3;
this.verticallyRadioButton.TabStop = true;
this.verticallyRadioButton.Text = "Vertically";
this.verticallyRadioButton.UseVisualStyleBackColor = true;
//
// horizontallyRadioButton
//
this.horizontallyRadioButton.AutoSize = true;
this.horizontallyRadioButton.Enabled = false;
this.horizontallyRadioButton.Location = new System.Drawing.Point(21, 43);
this.horizontallyRadioButton.Name = "horizontallyRadioButton";
this.horizontallyRadioButton.Size = new System.Drawing.Size(79, 17);
this.horizontallyRadioButton.TabIndex = 2;
this.horizontallyRadioButton.TabStop = true;
this.horizontallyRadioButton.Text = "Horizontally";
this.horizontallyRadioButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(937, 57);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(104, 30);
this.okButton.TabIndex = 4;
this.okButton.Text = "Close";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(937, 94);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Visible = false;
//
// unlockButton
//
this.unlockButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.unlockButton.Location = new System.Drawing.Point(937, 21);
this.unlockButton.Name = "unlockButton";
this.unlockButton.Size = new System.Drawing.Size(104, 30);
this.unlockButton.TabIndex = 47;
this.unlockButton.Text = "Unlock";
this.unlockButton.UseVisualStyleBackColor = true;
this.unlockButton.Click += new System.EventHandler(this.unlockButton_Click);
//
// resultsConfigCtrl
//
this.resultsConfigCtrl.Location = new System.Drawing.Point(3, 85);
this.resultsConfigCtrl.Name = "resultsConfigCtrl";
this.resultsConfigCtrl.Size = new System.Drawing.Size(925, 496);
this.resultsConfigCtrl.TabIndex = 53;
this.resultsConfigCtrl.Unlocked = false;
//
// ResultsArrangementDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(1056, 579);
this.Controls.Add(this.resultsConfigCtrl);
this.Controls.Add(this.unlockButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.metersArangementGroupBox);
this.Controls.Add(this.testsArangementGroupBox);
this.Name = "ResultsArrangementDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.testsArangementGroupBox.ResumeLayout(false);
this.testsArangementGroupBox.PerformLayout();
this.metersArangementGroupBox.ResumeLayout(false);
this.metersArangementGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RadioButton testsRowsRadioButton;
private System.Windows.Forms.RadioButton testsColumnsRadioButton;
private System.Windows.Forms.GroupBox testsArangementGroupBox;
private System.Windows.Forms.GroupBox metersArangementGroupBox;
private System.Windows.Forms.RadioButton verticallyRadioButton;
private System.Windows.Forms.RadioButton horizontallyRadioButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button unlockButton;
private System.Windows.Forms.TextBox nrMetersTextBox;
private System.Windows.Forms.Label nrMetersLabel;
private Results.Forms.ResultsConfigCtrl resultsConfigCtrl;
}
}
+132
View File
@@ -0,0 +1,132 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Config.Entities;
using Results;
using TBF.Resources;
namespace TBF.Forms
{
public partial class ResultsArrangementDlg : Form
{
/// <summary>
/// Required access rights to make changes with this form
/// </summary>
const Users.Grp.GID RequiredGroupMembership = Users.Grp.GID.Metrologists;
public bool Unlocked; /// true = changes enabled
public TestsArrangement TestsArrangement;
public MetersArrangement MetersArrangement;
public int NrMetersInOneGroup;
public IList<WMeterRsltItemSpec> SelectedItems
{
set { resultsConfigCtrl.SelectedItems = value; }
get { return resultsConfigCtrl.SelectedItems; }
}
public MetersKind MetersKind
{
set
{
resultsConfigCtrl.MetersKind = mtrsKind = value;
Text = string.Format("{0} ({1})", Strings.Configuration, mtrsKind.ToDescription());
}
}
MetersKind mtrsKind;
public ResultsArrangementDlg()
{
InitializeComponent();
resultsConfigCtrl.SupressTestIDColumn = true;
Unlocked = false;
cancelButton.Visible = false;
}
void Localize()
{
Text = string.Format("{0} ({1})", Strings.Configuration, mtrsKind.ToDescription());
testsArangementGroupBox.Text = Strings.Arrangement_of_tests;
metersArangementGroupBox.Text = Strings.Arrangement_of_meters;
testsRowsRadioButton.Text = Strings.Tests_are_rows;
testsColumnsRadioButton.Text = Strings.Tests_are_columns;
horizontallyRadioButton.Text = Strings.Horizontally;
verticallyRadioButton.Text = Strings.Vertically;
nrMetersLabel.Text = Strings.Nr_meters_in_a_group;
unlockButton.Text = Strings.UnlockBtnText;
okButton.Text = Strings.CloseBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
testsRowsRadioButton.Checked = (TestsArrangement == TestsArrangement.Rows);
testsColumnsRadioButton.Checked = (TestsArrangement == TestsArrangement.Columns);
horizontallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Horizontally);
verticallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Vertically);
nrMetersTextBox.Text = NrMetersInOneGroup.ToString();
}
void unlockButton_Click(object sender, EventArgs e)
{
if (!Unlocked)
{
if (!Users.GlobalData.CurrentUser.IsMemberOf(RequiredGroupMembership))
{
if ((new Users.Forms.LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking)
{
if ((new Users.Forms.LoginDlg(Users.GlobalData.CurrentUser.UserName, RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
Unlocked = true;
///
/// Unlock user interface controls
///
unlockButton.Enabled = false;
okButton.Text = Strings.OkBtnText;
cancelButton.Visible = true;
testsRowsRadioButton.Enabled = true;
testsColumnsRadioButton.Enabled = true;
verticallyRadioButton.Enabled = true;
horizontallyRadioButton.Enabled = true;
nrMetersTextBox.Enabled = true;
resultsConfigCtrl.Unlocked = true;
}
}
void okButton_Click(object sender, EventArgs e)
{
if (testsColumnsRadioButton.Checked) TestsArrangement = TestsArrangement.Columns;
else TestsArrangement = TestsArrangement.Rows;
if (horizontallyRadioButton.Checked) MetersArrangement = MetersArrangement.Horizontally;
else MetersArrangement = MetersArrangement.Vertically;
int nrInGroup;
if (int.TryParse(nrMetersTextBox.Text, out nrInGroup) && nrInGroup > 0)
{
NrMetersInOneGroup = nrInGroup;
}
DialogResult = DialogResult.OK;
Close();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+107
View File
@@ -0,0 +1,107 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class TabNameDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabNameTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.SuspendLayout();
//
// tabNameTextBox
//
this.tabNameTextBox.Location = new System.Drawing.Point(33, 25);
this.tabNameTextBox.Name = "tabNameTextBox";
this.tabNameTextBox.Size = new System.Drawing.Size(145, 20);
this.tabNameTextBox.TabIndex = 1;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(209, 18);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(85, 33);
this.okButton.TabIndex = 2;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(37, 63);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(121, 17);
this.radioButton1.TabIndex = 3;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Transition sequence";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(37, 86);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(137, 17);
this.radioButton2.TabIndex = 4;
this.radioButton2.Text = "Virtual bench sequence";
this.radioButton2.UseVisualStyleBackColor = true;
//
// TabNameDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(316, 122);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.okButton);
this.Controls.Add(this.tabNameTextBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TabNameDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "TabName";
this.Load += new System.EventHandler(this.TabNameDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox tabNameTextBox;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
}
}
+59
View File
@@ -0,0 +1,59 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.Forms
{
public partial class TabNameDlg : Form
{
public string TabNameLabel;
public string TabName;
public bool IsVirtualBenchSeq;
public TabNameDlg()
{
InitializeComponent();
TabNameLabel = string.Empty;
TabName = string.Empty;
IsVirtualBenchSeq = false;
}
public TabNameDlg(bool nameOnly)
{
InitializeComponent();
TabNameLabel = string.Empty;
TabName = string.Empty;
IsVirtualBenchSeq = false;
if (nameOnly == true)
{
radioButton1.Visible = false;
radioButton2.Visible = false;
Height -= 50;
}
}
private void TabNameDlg_Load(object sender, EventArgs e)
{
Text = TabNameLabel;
tabNameTextBox.Text = TabName;
radioButton1.Text = Strings.Transition_sequence;
radioButton2.Text = Strings.Virtual_bench_sequence;
okButton.Text = Strings.OkBtnText;
}
private void okButton_Click(object sender, EventArgs e)
{
TabName = tabNameTextBox.Text;
IsVirtualBenchSeq = radioButton2.Checked;
DialogResult = DialogResult.OK;
Close();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+100
View File
@@ -0,0 +1,100 @@
namespace TBF.Forms
{
partial class UpgradeSelectionDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.upgradeDb_215_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_216_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_212_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_217_218_Button = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// upgradeDb_215_217_Button
//
this.upgradeDb_215_217_Button.Location = new System.Drawing.Point(12, 52);
this.upgradeDb_215_217_Button.Name = "upgradeDb_215_217_Button";
this.upgradeDb_215_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_215_217_Button.TabIndex = 1;
this.upgradeDb_215_217_Button.Text = "Upgrade database from ver. 2.15 to ver. 2.17";
this.upgradeDb_215_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_215_217_Button.Click += new System.EventHandler(this.upgradeDb_215_217_Button_Click);
//
// upgradeDb_216_217_Button
//
this.upgradeDb_216_217_Button.Location = new System.Drawing.Point(12, 92);
this.upgradeDb_216_217_Button.Name = "upgradeDb_216_217_Button";
this.upgradeDb_216_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_216_217_Button.TabIndex = 2;
this.upgradeDb_216_217_Button.Text = "Upgrade database from ver. 2.16 to ver. 2.17";
this.upgradeDb_216_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_216_217_Button.Click += new System.EventHandler(this.upgradeDb_216_217_Button_Click);
//
// upgradeDb_212_217_Button
//
this.upgradeDb_212_217_Button.Location = new System.Drawing.Point(12, 12);
this.upgradeDb_212_217_Button.Name = "upgradeDb_212_217_Button";
this.upgradeDb_212_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_212_217_Button.TabIndex = 0;
this.upgradeDb_212_217_Button.Text = "Upgrade database from ver. 2.12 to ver. 2.17";
this.upgradeDb_212_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_212_217_Button.Click += new System.EventHandler(this.upgradeDb_212_217_Button_Click);
//
// upgradeDb_217_218_Button
//
this.upgradeDb_217_218_Button.Location = new System.Drawing.Point(12, 132);
this.upgradeDb_217_218_Button.Name = "upgradeDb_217_218_Button";
this.upgradeDb_217_218_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_217_218_Button.TabIndex = 3;
this.upgradeDb_217_218_Button.Text = "Upgrade database from ver. 2.17 to ver. 2.18";
this.upgradeDb_217_218_Button.UseVisualStyleBackColor = true;
this.upgradeDb_217_218_Button.Click += new System.EventHandler(this.upgradeDb_217_218_Button_Click);
//
// UpgradeSelectionDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.upgradeDb_217_218_Button);
this.Controls.Add(this.upgradeDb_212_217_Button);
this.Controls.Add(this.upgradeDb_216_217_Button);
this.Controls.Add(this.upgradeDb_215_217_Button);
this.Name = "UpgradeSelectionDlg";
this.Text = "Upgrade selection";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button upgradeDb_215_217_Button;
private System.Windows.Forms.Button upgradeDb_216_217_Button;
private System.Windows.Forms.Button upgradeDb_212_217_Button;
private System.Windows.Forms.Button upgradeDb_217_218_Button;
}
}
+265
View File
@@ -0,0 +1,265 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using log4net;
using MySql.Data.MySqlClient;
namespace TBF.Forms
{
public partial class UpgradeSelectionDlg : Form
{
private static readonly ILog log = LogManager.GetLogger(typeof(UpgradeSelectionDlg));
public UpgradeSelectionDlg()
{
InitializeComponent();
}
/// <summary>
/// Common part of database upgrade code
/// </summary>
/// <param name="dbConn">Database connection</param>
/// <param name="commands">Array of SQL commands to be executed</param>
/// <returns>true = successful</returns>
bool UpgradeCommon(MySqlConnection dbConn, string[] commands)
{
bool success = false;
try
{
dbConn.Open();
foreach (var cmdText in commands)
{
MySqlCommand cmd = dbConn.CreateCommand();
cmd.CommandText = cmdText;
cmd.ExecuteNonQuery();
cmd.Dispose();
}
success = true;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
dbConn.Close();
}
return success;
}
///---------------------------------------------------------------------
private void upgradeDb_212_217_Button_Click(object sender, EventArgs e)
{
string[] configDbCommands = new string[]
{
/// 2.12 -> 2.13
"ALTER TABLE `procedure` ADD `Protected` BOOLEAN NOT NULL DEFAULT '0' AFTER `ProtocolTitle`, ADD `MustBeComplete` BOOLEAN NOT NULL DEFAULT '0' AFTER `Protected`, ADD `ManualCtrlDisabled` BOOLEAN NOT NULL DEFAULT '0' AFTER `MustBeComplete`",
/// 2.13 -> 2.14
"ALTER TABLE `test` ADD `DoControlWaterTemp` BOOLEAN NOT NULL DEFAULT '0' AFTER `Zeroing`, ADD `TempLimLo` FLOAT NOT NULL DEFAULT '15' AFTER `DoControlWaterTemp`, ADD `TempLimHi` FLOAT NOT NULL DEFAULT '25' AFTER `TempLimLo`",
/// 2.14 -> 2.15
"ALTER TABLE `procedure` ADD `AltProcName` VARCHAR(255) NULL DEFAULT NULL , ADD `AltProcPeriod` INT NOT NULL DEFAULT '0';",
//"ALTER TABLE `procedure` DROP `ProtocolTitle`;", /// Commented out to maintain compatibility with an old ResultsBrowser
};
string[] resultsDbCommands = new string[]
{
/// 2.12 -> 2.13
"ALTER TABLE `watermeter` ADD `Remark` VARCHAR( 2000 ) NULL DEFAULT NULL AFTER `ResultCode`",
"ALTER TABLE `batch` ADD `Dirty` BOOLEAN NOT NULL DEFAULT '0' AFTER `EndTime`",
/// 2.13 -> 2.14
#if !IPERL
"ALTER TABLE `testrslt` ADD `FlowMean` FLOAT NOT NULL DEFAULT '0' AFTER `TempDivMax`",
#endif
"ALTER TABLE `testrslt` ADD `TestDone` BOOLEAN NOT NULL DEFAULT '1' AFTER `RepetitionNr`, ADD `Remark` VARCHAR( 2000 ) NULL DEFAULT NULL AFTER `TestDone`",
"ALTER TABLE `testdata` ADD `DoControlWaterTemp` BOOLEAN NOT NULL DEFAULT '0' AFTER `Uncertainty`, ADD `TempLimLo` FLOAT NOT NULL DEFAULT '15' AFTER `DoControlWaterTemp`, ADD `TempLimHi` FLOAT NOT NULL DEFAULT '25' AFTER `TempLimLo`",
/// 2.14 -> 2.15
"ALTER TABLE `watermeter` ADD `ArchivePath` VARCHAR(255) NULL DEFAULT NULL AFTER `ResultCode`;",
/// 2.15 -> 2.17
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`, ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
};
if (UpgradeCommon(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands) &&
UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), resultsDbCommands))
{
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
try
{
dbConn.Open();
int maxItemNr = 0;
MySqlCommand cmd = dbConn.CreateCommand();
cmd.CommandText = "SELECT ItemNr FROM component";
MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int itemNr = dr.GetInt32(0);
if (itemNr > maxItemNr) maxItemNr = itemNr;
}
dr.Close();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'RegisterReader for standing start/stop' WHERE ClassName = 'Fixed-Start-Register-Reader'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.iPerlCommunication' WHERE ClassName = 'iPerlCommunication'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'WaterMeter' WHERE ClassName = 'iPerl'";
cmd.ExecuteNonQuery();
cmd.Dispose();
for (int i = 1; i <= 40; i++)
{
Text = string.Format("Upgrade selection: {0}/40", i);
/// Read original iPerl water meter parameters
int id = 0;
string parameters = string.Empty;
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("SELECT Id, Parameters FROM Component WHERE Name = 'iPerl{0}' AND ClassName = 'WaterMeter'", i);
dr = cmd.ExecuteReader();
if (dr.Read())
{
id = dr.GetInt32(0);
parameters = dr.GetString(1);
}
dr.Close();
cmd.Dispose();
if (id != 0)
{
/// Rename iPerl water meter
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("UPDATE component SET Name = 'WM{0}' WHERE Name = 'iPerl{0}'", i);
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Create iPerl Head
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO component(ItemNr, Name, ClassName, Parentname, Mode, Logging, Parameters) VALUES ({0}, 'iPerl{1}', 'RegisterReader for iPerl', '', 'Normal', 'Off', @params)",
maxItemNr + 1, i);
cmd.Parameters.AddWithValue("@params", parameters.Replace("WaterMeterCfg", "IperlHeadCfg"));
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Clone procedure parameters
IList<int> idList = new List<int>();
IList<string> parList = new List<string>();
IList<int> procIdList = new List<int>();
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("SELECT Id, Parameters, Procedure_id FROM componentprocedure WHERE CmpntName = 'iPerl{0}'", i);
dr = cmd.ExecuteReader();
while (dr.Read())
{
idList.Add(dr.GetInt32(0));
parList.Add(dr.GetString(1));
procIdList.Add(dr.GetInt32(2));
}
dr.Close();
cmd.Dispose();
if ((idList.Count == parList.Count) && (parList.Count == procIdList.Count))
{
for (int j = 0; j < parList.Count; j++)
{
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO componentprocedure(CmpntName, Parameters, Procedure_id) VALUES ('WM{0}', @params, {1})",
i, procIdList[j]);
cmd.Parameters.AddWithValue("@params", parList[j].Replace("Q4", "Qmax")
.Replace("Q3", "Qn")
.Replace("Q2", "Qt")
.Replace("Q1", "Qmin")
.Replace("<Qmax>", "<NewQnames>true</NewQnames>\r\n <Qmax>"));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
}
}
}
/// Delete 'Parmeters' of iPerl water meters
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET Parameters = '<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<WaterMeterCfg xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n</WaterMeterCfg>' WHERE ClassName = 'WaterMeter'";
cmd.ExecuteNonQuery();
cmd.Dispose();
Text = string.Format("Upgrade selection");
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_212_217_Button.Enabled = false;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
dbConn.Close();
}
}
}
///---------------------------------------------------------------------
private void upgradeDb_215_217_Button_Click(object sender, EventArgs e)
{
string[] commands = new string[]
{
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`, ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
};
if (UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), commands))
{
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_215_217_Button.Enabled = false;
}
}
///---------------------------------------------------------------------
private void upgradeDb_216_217_Button_Click(object sender, EventArgs e)
{
string[] commands = new string[]
{
"ALTER TABLE `testrslt` ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
};
if (UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), commands))
{
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_216_217_Button.Enabled = false;
}
}
private void upgradeDb_217_218_Button_Click(object sender, EventArgs e)
{
string[] commands = new string[]
{
"ALTER TABLE `measurementcorrection` ADD `RangeIx` INT NOT NULL DEFAULT '0' AFTER `Id`;",
};
if (UpgradeCommon(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
{
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_217_218_Button.Enabled = false;
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>