OrderManagement project added, ver. 3.1.1809
This commit is contained in:
parent
5f7a80b826
commit
44761ff411
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,6 +26,8 @@ GraphLib/bin
|
||||
GraphLib/obj
|
||||
MergeResultsDBs/bin
|
||||
MergeResultsDBs/obj
|
||||
OrderManagement/bin
|
||||
OrderManagement/obj
|
||||
TracingDB/bin
|
||||
TracingDB/obj
|
||||
ResetBatchNr/bin
|
||||
|
||||
6
OrderManagement/App.config
Normal file
6
OrderManagement/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
99
OrderManagement/EditOrderDlg.Designer.cs
generated
Normal file
99
OrderManagement/EditOrderDlg.Designer.cs
generated
Normal file
@ -0,0 +1,99 @@
|
||||
namespace OrderManagement
|
||||
{
|
||||
partial class EditOrderDlg
|
||||
{
|
||||
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.cancelButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.okButton);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(685, 352);
|
||||
this.splitContainer1.SplitterDistance = 555;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.cancelButton.Location = new System.Drawing.Point(21, 70);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.cancelButton.TabIndex = 6;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.okButton.Location = new System.Drawing.Point(21, 20);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.okButton.TabIndex = 5;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// EditOrderDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(685, 352);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "EditOrderDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "EditOrderDlg";
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
|
||||
}
|
||||
}
|
||||
92
OrderManagement/EditOrderDlg.cs
Normal file
92
OrderManagement/EditOrderDlg.cs
Normal file
@ -0,0 +1,92 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using SharedDatabase.Entities;
|
||||
using OrderManagement.Resources;
|
||||
using NHibernate;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
public partial class EditOrderDlg : Form
|
||||
{
|
||||
ISession session;
|
||||
OrderInfo order;
|
||||
IList<OrderInfo> listOfOrders;
|
||||
bool editMode;
|
||||
string oriPOName;
|
||||
|
||||
EditParametersCtrl editParametersCtrl;
|
||||
|
||||
public EditOrderDlg(ISession session, OrderInfo order, IList<OrderInfo> listOfOrders, bool editMode = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.session = session;
|
||||
this.order = order;
|
||||
this.listOfOrders = listOfOrders;
|
||||
this.editMode = editMode;
|
||||
oriPOName = order.POName;
|
||||
|
||||
editParametersCtrl = new EditParametersCtrl(this.order);
|
||||
editParametersCtrl.Dock = DockStyle.Fill;
|
||||
editParametersCtrl.Unlock();
|
||||
splitContainer1.Panel1.Controls.Add(editParametersCtrl);
|
||||
|
||||
Localize();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
okButton.Text = Strings.OK;
|
||||
cancelButton.Text = Strings.Cancel;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
OrderInfo orderWithTheSameName = listOfOrders.FirstOrDefault(x => (x.POName == order.POName));
|
||||
|
||||
if (orderWithTheSameName != null && (!editMode || order.POName != oriPOName))
|
||||
{
|
||||
MessageBox.Show(Strings.Order_with_the_same_ID_already_exists);
|
||||
return;
|
||||
}
|
||||
|
||||
DialogResult = Save() ? DialogResult.OK : DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
bool Save()
|
||||
{
|
||||
ITransaction transaction = session.BeginTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
session.SaveOrUpdate(order);
|
||||
transaction.Commit();
|
||||
session.Flush();
|
||||
Cursor.Current = Cursors.Default;
|
||||
return true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
transaction.Rollback();
|
||||
MessageBox.Show(string.Format("{0}{1}{2}", Strings.Saving_order_failed, Environment.NewLine, exc.Message),
|
||||
Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
Cursor.Current = Cursors.Default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
OrderManagement/EditOrderDlg.resx
Normal file
120
OrderManagement/EditOrderDlg.resx
Normal 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>
|
||||
131
OrderManagement/EditParametersCtrl.cs
Normal file
131
OrderManagement/EditParametersCtrl.cs
Normal file
@ -0,0 +1,131 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Common;
|
||||
using OrderManagement.Resources;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
public partial class EditParametersCtrl : UserControl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EditParametersCtrl));
|
||||
|
||||
IParamsProvider paramsProvider;
|
||||
Control[] editors;
|
||||
CfgUpdateFlags flags;
|
||||
|
||||
public EditParametersCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="paramsProvider">Parameters provider implementing IComponentCfg and IParamsProvider</param>
|
||||
/// <param name="parents">A list of parents or null, null hides parentComboBox</param>
|
||||
public EditParametersCtrl(object paramsProvider)
|
||||
: this()
|
||||
{
|
||||
this.paramsProvider = paramsProvider as IParamsProvider;
|
||||
if (this.paramsProvider == null) throw(new ArgumentException("paramsProvider"));
|
||||
|
||||
editors = new Control[this.paramsProvider.ParamsCount()];
|
||||
for (int i = 0; i < this.paramsProvider.ParamsCount(); i++)
|
||||
{
|
||||
ICollection<string> values = this.paramsProvider.ParamValues(i);
|
||||
if (values == null)
|
||||
{
|
||||
editors[i] = new TextBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
ComboBox cb = new ComboBox();
|
||||
foreach (var v in values) cb.Items.Add(v);
|
||||
editors[i] = cb;
|
||||
}
|
||||
editors[i].Visible = false;
|
||||
this.Controls.Add(editors[i]);
|
||||
}
|
||||
|
||||
flags = CfgUpdateFlags.None;
|
||||
|
||||
paramsListViewEx.SubItemClicked += new Common.Forms.SubItemEventHandler(paramsListViewEx_SubItemClicked);
|
||||
paramsListViewEx.SubItemEndEditing += new Common.Forms.SubItemEndEditingEventHandler(paramsListViewEx_SubItemEndEditing);
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
paramsListViewEx.Columns.Add(Strings.Parameter, 150);
|
||||
paramsListViewEx.Columns.Add(Strings.Value, 400);
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
/// Close CmdResponse handlers here
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (paramsProvider == null) return; /// Control was not loaded, settings were not changed
|
||||
|
||||
paramsListViewEx.Items.Clear();
|
||||
for (int i = 0; i < paramsProvider.ParamsCount(); i++)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(paramsProvider.ParamName(i));
|
||||
lvi.SubItems.Add(paramsProvider.ToString(i));
|
||||
lvi.Tag = i;
|
||||
paramsListViewEx.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
paramsListViewEx.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
return CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
if (paramsProvider == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
CfgUpdateFlags f = this.flags;
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
private void paramsListViewEx_SubItemClicked(object sender, Common.Forms.SubItemEventArgs e)
|
||||
{
|
||||
if (e.SubItem != 1) return;
|
||||
int itemNr = (int)e.Item.Tag;
|
||||
paramsListViewEx.StartEditing(editors[itemNr], e.Item, e.SubItem);
|
||||
}
|
||||
|
||||
private void paramsListViewEx_SubItemEndEditing(object sender, Common.Forms.SubItemEndEditingEventArgs e)
|
||||
{
|
||||
if (e.SubItem != 1) return;
|
||||
int itemNr = (int)e.Item.Tag;
|
||||
|
||||
string message;
|
||||
if (paramsProvider.ValidateParam(itemNr, e.DisplayText, out message))
|
||||
{
|
||||
flags |= paramsProvider.UpdateParam(itemNr, e.DisplayText);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(message);
|
||||
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
71
OrderManagement/EditParametersCtrl.designer.cs
generated
Normal file
71
OrderManagement/EditParametersCtrl.designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace OrderManagement
|
||||
{
|
||||
partial class EditParametersCtrl
|
||||
{
|
||||
/// <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.paramsListViewEx = new Common.Forms.ListViewEx();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// paramsListViewEx
|
||||
//
|
||||
this.paramsListViewEx.AllowColumnReorder = true;
|
||||
this.paramsListViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.paramsListViewEx.DoubleClickActivation = false;
|
||||
this.paramsListViewEx.Enabled = false;
|
||||
this.paramsListViewEx.FullRowSelect = true;
|
||||
this.paramsListViewEx.GridLines = true;
|
||||
this.paramsListViewEx.LabelWrap = false;
|
||||
this.paramsListViewEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.paramsListViewEx.Name = "paramsListViewEx";
|
||||
this.paramsListViewEx.Size = new System.Drawing.Size(491, 356);
|
||||
this.paramsListViewEx.TabIndex = 0;
|
||||
this.paramsListViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.paramsListViewEx.View = System.Windows.Forms.View.Details;
|
||||
this.paramsListViewEx.SubItemClicked += new Common.Forms.SubItemEventHandler(this.paramsListViewEx_SubItemClicked);
|
||||
this.paramsListViewEx.SubItemEndEditing += new Common.Forms.SubItemEndEditingEventHandler(this.paramsListViewEx_SubItemEndEditing);
|
||||
//
|
||||
// EditParametersCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.paramsListViewEx);
|
||||
this.Name = "EditParametersCtrl";
|
||||
this.Size = new System.Drawing.Size(491, 356);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Common.Forms.ListViewEx paramsListViewEx;
|
||||
}
|
||||
}
|
||||
120
OrderManagement/EditParametersCtrl.resx
Normal file
120
OrderManagement/EditParametersCtrl.resx
Normal 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>
|
||||
243
OrderManagement/LocalSettings.cs
Normal file
243
OrderManagement/LocalSettings.cs
Normal file
@ -0,0 +1,243 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to be serialized to an XML file...
|
||||
/// </summary>
|
||||
[XmlRootAttribute("SNPrinting")]
|
||||
public class LocalSettings
|
||||
{
|
||||
static XmlSerializer serializer = XmlSerializer.FromTypes(new[] { typeof(LocalSettings) })[0];
|
||||
|
||||
/// Configuration file ecryption/decryption key and initialization vector
|
||||
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
|
||||
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
|
||||
|
||||
public Mode Mode;
|
||||
public string Language; /// User interface language used as CultureInfo(..) constructor argument
|
||||
public int DelayBetweenLabels; /// Delay between printing two consecutive labels in ms
|
||||
public bool IsUserLoginRequired; /// true = require user login on program start-up
|
||||
public string TracingDBConnString; /// Connection string to MySQL database with production tracing records
|
||||
public string UsersDBConnString; /// Connection string to MySQL database with authorized users
|
||||
public string[] SapNumberHistory; /// SAP number history
|
||||
public string[] SeparatorHistory; /// Separator history
|
||||
public int CurrentSNTrail; /// Serial number trail to be printed now
|
||||
public int RemainingSNsCount; /// Remaining count of serial numbers to be printed in this session
|
||||
|
||||
|
||||
/// Parameterless constructor required by serialization
|
||||
public LocalSettings() { }
|
||||
|
||||
public LocalSettings(bool createNew)
|
||||
{
|
||||
if (createNew)
|
||||
{
|
||||
Mode = Mode.Standalone;
|
||||
Language = "EN";
|
||||
DelayBetweenLabels = 1000;
|
||||
IsUserLoginRequired = false;
|
||||
TracingDBConnString = string.Empty;
|
||||
UsersDBConnString = string.Empty;
|
||||
SapNumberHistory = new string[] { };
|
||||
SeparatorHistory = new string[] { "4VQ" };
|
||||
CurrentSNTrail = 1;
|
||||
RemainingSNsCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load public fields of this class from the XML file.
|
||||
/// </summary>
|
||||
/// <returns>LocalSettings object or null when Load() fails</returns>
|
||||
public static LocalSettings Load(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isEncrypted = true;
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
isEncrypted = !reader.ReadLine().StartsWith("<?xml version=");
|
||||
reader.Close();
|
||||
}
|
||||
|
||||
if (isEncrypted)
|
||||
{
|
||||
/// Write settings to a string
|
||||
StringBuilder plain = new StringBuilder();
|
||||
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
using (ICryptoTransform decryptor = aes.CreateDecryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, decryptor, CryptoStreamMode.Read))
|
||||
{
|
||||
using (MemoryStream mStream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new BinaryWriter(mStream))
|
||||
{
|
||||
int data;
|
||||
while ((data = cs.ReadByte()) != -1)
|
||||
{
|
||||
if (data != 0) writer.Write((byte)data);
|
||||
}
|
||||
writer.Flush();
|
||||
mStream.Position = 0;
|
||||
|
||||
using (var reader = new StreamReader(mStream))
|
||||
{
|
||||
return serializer.Deserialize(reader) as LocalSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
return serializer.Deserialize(reader) as LocalSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string msg = e.Message;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save public fields of this class to the XML file.
|
||||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
/// Encrypt and write to file 'Program.LocalSettingsFileName'
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(Program.LocalSettingsFileName, FileMode.Create))
|
||||
{
|
||||
using (ICryptoTransform encryptor = aes.CreateEncryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, encryptor, CryptoStreamMode.Write))
|
||||
{
|
||||
using (MemoryStream mStream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new StreamWriter(mStream))
|
||||
{
|
||||
/// Serialize and write settings to a memory stream
|
||||
serializer.Serialize(writer, this);
|
||||
writer.Flush();
|
||||
mStream.Position = 0;
|
||||
|
||||
using (var reader = new StreamReader(mStream))
|
||||
{
|
||||
/// Encrypt and write to file 'Program.LocalSettingsFileName'
|
||||
int data;
|
||||
while ((data = mStream.ReadByte()) != -1) cs.WriteByte((byte)data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string msg = e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates history stored in a string array by a new latest string.
|
||||
/// </summary>
|
||||
/// <param name="lastStrValue">Last entered string</param>
|
||||
/// <returns>true = history updated</returns>
|
||||
public static bool UpdateHistory(string lastStrValue, ref string[] history)
|
||||
{
|
||||
const int MaxHistoryLen = 10;
|
||||
|
||||
if (string.IsNullOrEmpty(lastStrValue)) return false;
|
||||
|
||||
int currentHistoryLength = (history != null) ? history.Length : 0;
|
||||
|
||||
int match = -1;
|
||||
for (int i = 0; i < currentHistoryLength; i++)
|
||||
{
|
||||
if (history[i] == lastStrValue)
|
||||
{
|
||||
match = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (match >= 0 || currentHistoryLength >= MaxHistoryLen)
|
||||
{
|
||||
/// History does not have to be extended (because of a match) or should not be extended (because of the lenght)
|
||||
if (match < 0) match = currentHistoryLength - 1;
|
||||
|
||||
for (int j = match; j > 0; j--)
|
||||
{
|
||||
history[j] = history[j - 1];
|
||||
}
|
||||
history[0] = lastStrValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// History wiil be extended, new item inserted at the beginning
|
||||
string[] newHistory = new string[currentHistoryLength + 1];
|
||||
newHistory[0] = lastStrValue;
|
||||
for (int j = 1; j <= currentHistoryLength; j++)
|
||||
{
|
||||
newHistory[j] = history[j - 1];
|
||||
}
|
||||
history = newHistory;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="comboBox">Puchase order ComboBox</param>
|
||||
public static void PrepareCombo(string[] history, System.Windows.Forms.ComboBox comboBox)
|
||||
{
|
||||
if (history != null)
|
||||
{
|
||||
for (int i = 0; i < history.Length; i++)
|
||||
{
|
||||
comboBox.Items.Add(history[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (comboBox.Items.Count > 0)
|
||||
{
|
||||
comboBox.Text = comboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum Mode
|
||||
{
|
||||
Standalone,
|
||||
WithDatabase,
|
||||
}
|
||||
}
|
||||
163
OrderManagement/OrderManagement.csproj
Normal file
163
OrderManagement/OrderManagement.csproj
Normal file
@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OrderManagement</RootNamespace>
|
||||
<AssemblyName>OrderManagement</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>OrderManagement.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentNHibernate">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="EditParametersCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EditParametersCtrl.designer.cs">
|
||||
<DependentUpon>EditParametersCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EditOrderDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EditOrderDlg.Designer.cs">
|
||||
<DependentUpon>EditOrderDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LocalSettings.cs" />
|
||||
<Compile Include="OrderManagementDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="OrderManagementDlg.Designer.cs">
|
||||
<DependentUpon>OrderManagementDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Resources\Strings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Strings.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SettingsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SettingsDlg.designer.cs">
|
||||
<DependentUpon>SettingsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="EditParametersCtrl.resx">
|
||||
<DependentUpon>EditParametersCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="EditOrderDlg.resx">
|
||||
<DependentUpon>EditOrderDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="OrderManagementDlg.resx">
|
||||
<DependentUpon>OrderManagementDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Resources\Strings.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\Strings.sk.resx" />
|
||||
<EmbeddedResource Include="SettingsDlg.resx">
|
||||
<DependentUpon>SettingsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SharedDatabase\SharedDatabase.csproj">
|
||||
<Project>{211b5e3f-9996-48a7-abde-c878dd2d71c2}</Project>
|
||||
<Name>SharedDatabase</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="SampleConfig\log4netConfig.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
180
OrderManagement/OrderManagementDlg.Designer.cs
generated
Normal file
180
OrderManagement/OrderManagementDlg.Designer.cs
generated
Normal file
@ -0,0 +1,180 @@
|
||||
namespace OrderManagement
|
||||
{
|
||||
partial class OrderManagementDlg
|
||||
{
|
||||
/// <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.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.listViewEx1 = new Common.Forms.ListViewEx();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.editButton = new System.Windows.Forms.Button();
|
||||
this.closeButton = new System.Windows.Forms.Button();
|
||||
this.deleteButton = new System.Windows.Forms.Button();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.settingsToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(1349, 24);
|
||||
this.menuStrip1.TabIndex = 0;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.settingsToolStripMenuItem.Text = "Settings";
|
||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.listViewEx1);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.addButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.editButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.closeButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.deleteButton);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1349, 481);
|
||||
this.splitContainer1.SplitterDistance = 1214;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// listViewEx1
|
||||
//
|
||||
this.listViewEx1.AllowColumnReorder = true;
|
||||
this.listViewEx1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listViewEx1.DoubleClickActivation = false;
|
||||
this.listViewEx1.FullRowSelect = true;
|
||||
this.listViewEx1.GridLines = true;
|
||||
this.listViewEx1.Location = new System.Drawing.Point(0, 0);
|
||||
this.listViewEx1.Name = "listViewEx1";
|
||||
this.listViewEx1.Size = new System.Drawing.Size(1214, 481);
|
||||
this.listViewEx1.TabIndex = 0;
|
||||
this.listViewEx1.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx1.View = System.Windows.Forms.View.Details;
|
||||
this.listViewEx1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewEx1_ColumnClick);
|
||||
this.listViewEx1.DoubleClick += new System.EventHandler(this.listViewEx1_DoubleClick);
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.addButton.Location = new System.Drawing.Point(23, 88);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.addButton.TabIndex = 2;
|
||||
this.addButton.Text = "Add";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// editButton
|
||||
//
|
||||
this.editButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.editButton.Location = new System.Drawing.Point(23, 133);
|
||||
this.editButton.Name = "editButton";
|
||||
this.editButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.editButton.TabIndex = 3;
|
||||
this.editButton.Text = "Edit";
|
||||
this.editButton.UseVisualStyleBackColor = true;
|
||||
this.editButton.Click += new System.EventHandler(this.editButton_Click);
|
||||
//
|
||||
// closeButton
|
||||
//
|
||||
this.closeButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.closeButton.Location = new System.Drawing.Point(23, 21);
|
||||
this.closeButton.Name = "closeButton";
|
||||
this.closeButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.closeButton.TabIndex = 4;
|
||||
this.closeButton.Text = "Close";
|
||||
this.closeButton.UseVisualStyleBackColor = true;
|
||||
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||
//
|
||||
// deleteButton
|
||||
//
|
||||
this.deleteButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.deleteButton.Location = new System.Drawing.Point(23, 178);
|
||||
this.deleteButton.Name = "deleteButton";
|
||||
this.deleteButton.Size = new System.Drawing.Size(85, 40);
|
||||
this.deleteButton.TabIndex = 5;
|
||||
this.deleteButton.Text = "Delete";
|
||||
this.deleteButton.UseVisualStyleBackColor = true;
|
||||
this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
|
||||
//
|
||||
// OrderManagementDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoScroll = true;
|
||||
this.ClientSize = new System.Drawing.Size(1349, 505);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "OrderManagementDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Order Management";
|
||||
this.Load += new System.EventHandler(this.OrderManagementDlg_Load);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.Button editButton;
|
||||
private System.Windows.Forms.Button closeButton;
|
||||
private System.Windows.Forms.Button deleteButton;
|
||||
private Common.Forms.ListViewEx listViewEx1;
|
||||
}
|
||||
}
|
||||
|
||||
276
OrderManagement/OrderManagementDlg.cs
Normal file
276
OrderManagement/OrderManagementDlg.cs
Normal file
@ -0,0 +1,276 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Common;
|
||||
using SharedDatabase.Entities;
|
||||
using OrderManagement.Resources;
|
||||
using Common.Forms;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
public partial class OrderManagementDlg : Form
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(OrderManagementDlg));
|
||||
|
||||
NHibernate.ISession session;
|
||||
IList<OrderInfo> listOfOrders; /// null in Standalone mode
|
||||
|
||||
MySortOrder sortOrder = MySortOrder.Ascending;
|
||||
int sortColumn = -1; /// 0-based index of column to be used for sorting
|
||||
|
||||
public OrderManagementDlg()
|
||||
{
|
||||
try
|
||||
{
|
||||
string culture = Program.LocalSettings.Language.Replace('_', '-');
|
||||
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Selected language is not supported.\nUsing English.",
|
||||
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
System.Threading.Thread.CurrentThread.CurrentUICulture =
|
||||
new System.Globalization.CultureInfo("en");
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Text = string.Format("{0} v.{1}", Program.ProgramName, Program.Version); ;
|
||||
}
|
||||
|
||||
public OrderManagementDlg(NHibernate.ISession session, IList<OrderInfo> listOfOrders)
|
||||
: this()
|
||||
{
|
||||
this.session = session;
|
||||
this.listOfOrders = listOfOrders;
|
||||
}
|
||||
|
||||
private void OrderManagementDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
InitializeColumns(listViewEx1);
|
||||
foreach (var oi in listOfOrders) AddRow(listViewEx1, oi);
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
settingsToolStripMenuItem.Text = Strings.Settings;
|
||||
}
|
||||
|
||||
enum Clmn
|
||||
{
|
||||
Order,
|
||||
State,
|
||||
Workflow,
|
||||
Procedure,
|
||||
Variant,
|
||||
Pieces,
|
||||
SNPrefix,
|
||||
SNFirst,
|
||||
SNDigitsCount,
|
||||
SNSuffix,
|
||||
RAPrefix,
|
||||
RAFirst,
|
||||
RADigitsCount,
|
||||
RASuffix,
|
||||
Remark,
|
||||
Count
|
||||
}
|
||||
|
||||
void InitializeColumns(ListView lv)
|
||||
{
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Order, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.State, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Workflow, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Test_procedure, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Variant_code, Width = 150 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Pieces_count, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.prefix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.first, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.digits_count, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.SN + " " + Strings.suffix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.prefix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.first, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.digits_count, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.RA + " " + Strings.suffix, Width = 80 });
|
||||
lv.Columns.Add(new ColumnHeader { Text = Strings.Remark, Width = 200 });
|
||||
}
|
||||
|
||||
void AddRow(ListView lv, OrderInfo o)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(o.POName);
|
||||
lvi.SubItems.Add(((OrderState)o.POState).ToString());
|
||||
lvi.SubItems.Add(o.Workflow);
|
||||
lvi.SubItems.Add(o.TestProcedure);
|
||||
lvi.SubItems.Add(o.VariantCode);
|
||||
lvi.SubItems.Add(o.PiecesCount.ToString());
|
||||
lvi.SubItems.Add(o.SNPrefix);
|
||||
lvi.SubItems.Add(o.SNFirst.ToString(string.Format("D{0}", o.SNDigitsCount)));
|
||||
lvi.SubItems.Add(o.SNDigitsCount.ToString());
|
||||
lvi.SubItems.Add(o.SNSuffix);
|
||||
lvi.SubItems.Add(o.RAPrefix);
|
||||
lvi.SubItems.Add(o.RAFirst.ToString(string.Format("D{0}", o.RADigitsCount)));
|
||||
lvi.SubItems.Add(o.RADigitsCount.ToString());
|
||||
lvi.SubItems.Add(o.RASuffix);
|
||||
lvi.SubItems.Add(o.Remark);
|
||||
lvi.Tag = o;
|
||||
lv.Items.Add(lvi);
|
||||
}
|
||||
|
||||
void UpdateRow(ListViewItem lvi, OrderInfo o)
|
||||
{
|
||||
int i = 0;
|
||||
lvi.SubItems[i++].Text = o.POName;
|
||||
lvi.SubItems[i++].Text = ((OrderState)o.POState).ToString();
|
||||
lvi.SubItems[i++].Text = o.Workflow;
|
||||
lvi.SubItems[i++].Text = o.TestProcedure;
|
||||
lvi.SubItems[i++].Text = o.VariantCode;
|
||||
lvi.SubItems[i++].Text = o.PiecesCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.SNPrefix;
|
||||
lvi.SubItems[i++].Text = o.SNFirst.ToString(string.Format("D{0}", o.SNDigitsCount));
|
||||
lvi.SubItems[i++].Text = o.SNDigitsCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.SNSuffix;
|
||||
lvi.SubItems[i++].Text = o.RAPrefix;
|
||||
lvi.SubItems[i++].Text = o.RAFirst.ToString(string.Format("D{0}", o.RADigitsCount));
|
||||
lvi.SubItems[i++].Text = o.RADigitsCount.ToString();
|
||||
lvi.SubItems[i++].Text = o.RASuffix;
|
||||
lvi.SubItems[i++].Text = o.Remark;
|
||||
}
|
||||
|
||||
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Common.GlobalData.RemoteUsersDB = new Common.DBSettings(Common.DBType.MySql, Program.LocalSettings.UsersDBConnString);
|
||||
|
||||
DialogResult dr = new SharedDatabase.Forms.LoginDlg().ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
|
||||
dr = new SettingsDlg(Program.LocalSettings).ShowDialog();
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
Program.LocalSettings.Save();
|
||||
MessageBox.Show(Strings.Program_restart_is_required);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Failed to connect to the database of users: {0}", exc.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
///
|
||||
/// Determine the next production order name
|
||||
///
|
||||
string candidatePOName = string.Empty;
|
||||
int candidatePONr;
|
||||
foreach (var o in listOfOrders)
|
||||
{
|
||||
if (string.Compare(candidatePOName, o.POName, StringComparison.InvariantCulture) < 0) candidatePOName = o.POName;
|
||||
}
|
||||
if (int.TryParse(candidatePOName, out candidatePONr))
|
||||
{
|
||||
candidatePONr++;
|
||||
candidatePOName = candidatePONr.ToString(string.Format("D{0}", candidatePOName.Length));
|
||||
}
|
||||
|
||||
///
|
||||
/// Create and edit the order
|
||||
///
|
||||
var order = new OrderInfo(candidatePOName);
|
||||
|
||||
if (new EditOrderDlg(session, order, listOfOrders).ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
listOfOrders.Add(order);
|
||||
AddRow(listViewEx1, order);
|
||||
}
|
||||
}
|
||||
|
||||
private void listViewEx1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
editButton_Click(sender, e);
|
||||
}
|
||||
|
||||
private void editButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx1.SelectedItems.Count == 1 && listViewEx1.SelectedItems[0].Tag is OrderInfo)
|
||||
{
|
||||
OrderInfo order = listViewEx1.SelectedItems[0].Tag as OrderInfo;
|
||||
if (order.POState == (sbyte)OrderState.New)
|
||||
{
|
||||
if (new EditOrderDlg(session, order, listOfOrders, true).ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
UpdateRow(listViewEx1.SelectedItems[0], order);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Strings.You_can_only_edit_New_porduction_orders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx1.SelectedItems.Count == 1 && listViewEx1.SelectedItems[0].Tag is OrderInfo)
|
||||
{
|
||||
OrderInfo order = listViewEx1.SelectedItems[0].Tag as OrderInfo;
|
||||
if (order.POState == (sbyte)OrderState.New)
|
||||
{
|
||||
if (MessageBox.Show(Strings.Are_you_sure, Strings.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
|
||||
{
|
||||
if (new EditOrderDlg(session, order, listOfOrders).ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
UpdateRow(listViewEx1.SelectedItems[0], order);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Strings.You_can_only_delete_New_porduction_orders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void listViewEx1_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||
{
|
||||
if (e.Column == sortColumn)
|
||||
{
|
||||
/// Clicked on the same column header => increment to the next applicable MySortOrder
|
||||
sortOrder = (sortOrder == MySortOrder.Ascending) ? MySortOrder.Descending : MySortOrder.Ascending;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Clicked on another column header => set sortOrder to MySortOrder.Ascending
|
||||
sortColumn = e.Column;
|
||||
sortOrder = MySortOrder.Ascending;
|
||||
}
|
||||
|
||||
if (sortColumn == (int)Clmn.State || sortColumn == (int)Clmn.Pieces || sortColumn == (int)Clmn.SNFirst || sortColumn == (int)Clmn.SNDigitsCount)
|
||||
{
|
||||
listViewEx1.ListViewItemSorter = new LviIntColumnComparer(sortColumn, sortOrder);
|
||||
}
|
||||
else
|
||||
{
|
||||
listViewEx1.ListViewItemSorter = new LviTextColumnComparer(sortColumn, sortOrder);
|
||||
}
|
||||
|
||||
listViewEx1.SetSortIcon(sortColumn, sortOrder);
|
||||
listViewEx1.Sort();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
OrderManagement/OrderManagementDlg.resx
Normal file
123
OrderManagement/OrderManagementDlg.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
251
OrderManagement/Program.cs
Normal file
251
OrderManagement/Program.cs
Normal file
@ -0,0 +1,251 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using Common;
|
||||
using SharedDatabase;
|
||||
using SharedDatabase.Entities;
|
||||
using OrderManagement.Resources;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// Constants
|
||||
public static GID[] SettingsAccessLevel = new GID[] { GID.TraceabilityManagement }; /// Group membership to access settings
|
||||
public const string ProgramName = "Order Management";
|
||||
public const string ConfigFName = "config.xml";
|
||||
public const string BackupConfigFName = "config.backup.xml";
|
||||
public const string Log4NetConfigFName = "log4netConfig.xml";
|
||||
|
||||
/// Program information
|
||||
public static readonly string Version; /// version string
|
||||
public static readonly DateTime BuildDateTime; /// date and time of program build
|
||||
public static readonly string ExeDirectory;
|
||||
public static readonly string ConfigDirectory;
|
||||
public static readonly string LogDirectory;
|
||||
public static readonly string LocalSettingsFileName;
|
||||
public static readonly string LocalSettingsBackupName;
|
||||
|
||||
/// Local settings
|
||||
public static LocalSettings LocalSettings;
|
||||
|
||||
/// log4net
|
||||
static ILog log;
|
||||
|
||||
|
||||
static Program()
|
||||
{
|
||||
/// Program version string
|
||||
Assembly thisAssembly = Assembly.GetExecutingAssembly();
|
||||
Version ver = thisAssembly.GetName().Version;
|
||||
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
|
||||
BuildDateTime = new FileInfo(thisAssembly.Location).LastWriteTime;
|
||||
|
||||
/// Local program configuration directory including the trailing backslash
|
||||
ExeDirectory = Path.GetDirectoryName(thisAssembly.Location);
|
||||
ConfigDirectory = Path.Combine(ExeDirectory, "..\\Cfg");
|
||||
LogDirectory = Path.Combine(ExeDirectory, "..", "Logs");
|
||||
LocalSettingsFileName = Path.Combine(ConfigDirectory, ConfigFName);
|
||||
LocalSettingsBackupName = Path.Combine(ConfigDirectory, BackupConfigFName);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
///
|
||||
/// Check if another instance is running
|
||||
///
|
||||
Assembly thisAssembly = Assembly.GetExecutingAssembly();
|
||||
string processName = Path.GetFileNameWithoutExtension(thisAssembly.Location);
|
||||
if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
|
||||
{
|
||||
MessageBox.Show(string.Format("{0}{1}{2}", string.Format(Strings.Program_0_is_running_already, ProgramName),
|
||||
Environment.NewLine,
|
||||
Strings.Close_it_please),
|
||||
Strings.Error,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Asterisk);
|
||||
return;
|
||||
}
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
|
||||
|
||||
bool configDirectoryCreated = false;
|
||||
if (!Directory.Exists(ConfigDirectory) || new DirectoryInfo(ConfigDirectory).GetFileSystemInfos().Length == 0)
|
||||
{
|
||||
MessageBox.Show(string.Format("{0}{1}{2}", Strings.Program_is_running_for_the_1st_time_on_this_PC,
|
||||
Environment.NewLine,
|
||||
Strings.Default_settings_are_used),
|
||||
Strings.Warning,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
///
|
||||
/// Create a new config subdirectory
|
||||
///
|
||||
Directory.CreateDirectory(ConfigDirectory);
|
||||
configDirectoryCreated = true;
|
||||
|
||||
Program.LocalSettings = new LocalSettings(true);
|
||||
Program.LocalSettings.Save();
|
||||
|
||||
if (File.Exists(Path.Combine(ExeDirectory, "SampleConfig", Log4NetConfigFName)))
|
||||
{
|
||||
File.Copy(Path.Combine(ExeDirectory, "SampleConfig", Log4NetConfigFName),
|
||||
Path.Combine(ConfigDirectory, Log4NetConfigFName));
|
||||
}
|
||||
|
||||
File.SetAttributes(Path.Combine(ConfigDirectory, Log4NetConfigFName), FileAttributes.Normal);
|
||||
}
|
||||
|
||||
///
|
||||
/// Configue and start logging
|
||||
///
|
||||
log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.Combine(ConfigDirectory, Log4NetConfigFName)));
|
||||
log = LogManager.GetLogger(typeof(Program));
|
||||
log.Fatal("--------------------------------------------------------------------------------");
|
||||
log.FatalFormat("{0} ver.{1}", ProgramName, Version);
|
||||
log.FatalFormat("Executable directory is {0}", ExeDirectory);
|
||||
if (configDirectoryCreated)
|
||||
{
|
||||
log.Fatal("A new config directory and configuration files created !");
|
||||
}
|
||||
|
||||
///
|
||||
/// Load the local settings
|
||||
///
|
||||
LocalSettings = LocalSettings.Load(Program.LocalSettingsFileName);
|
||||
if (LocalSettings == null)
|
||||
{
|
||||
/// Loading local seetings from regular config file failed. Use the backup
|
||||
LocalSettings = LocalSettings.Load(Program.LocalSettingsBackupName);
|
||||
if (LocalSettings == null)
|
||||
{
|
||||
log.FatalFormat("Local settings: Could not load file {0}, nor {1}.", ConfigFName, BackupConfigFName);
|
||||
log.Fatal("Application terminated.");
|
||||
MessageBox.Show(string.Format("Could not load file {0}, nor {1}.", ConfigFName, BackupConfigFName), "Fatal error");
|
||||
return; /// Fatal error
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalSettings.Save(); /// Save the settings to overwrite the wrong file
|
||||
log.FatalFormat("Local settings: Could not load file {0}, successfully loaded {1}", ConfigFName, BackupConfigFName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Loading local seetings from the regular config file was successful. Update the backup
|
||||
File.Copy(Program.LocalSettingsFileName, Program.LocalSettingsBackupName, true);
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
///
|
||||
/// User login
|
||||
///
|
||||
if (LocalSettings.IsUserLoginRequired && !string.IsNullOrEmpty(LocalSettings.UsersDBConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
Common.GlobalData.RemoteUsersDB = new DBSettings(Common.DBType.MySql, LocalSettings.UsersDBConnString);
|
||||
|
||||
DialogResult dr = new SharedDatabase.Forms.LoginDlg().ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Failed to connect to the database of users: {0}", exc.Message);
|
||||
}
|
||||
}
|
||||
|
||||
ISession session;
|
||||
IList<OrderInfo> listOfOrders = null;
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
session = SharedDatabase.TracingDB.CreateSession(LocalSettings.TracingDBConnString);
|
||||
listOfOrders = session.QueryOver<OrderInfo>().List();
|
||||
break;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.FatalFormat("Failed to connect to production tracing database: {0}", exc.Message);
|
||||
if (exc.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerException: {0}", exc.InnerException.Message);
|
||||
}
|
||||
|
||||
MessageBox.Show(string.Format("Failed to connect to production tracing database:{0}{1}", Environment.NewLine, exc.Message));
|
||||
|
||||
if (new SettingsDlg(Program.LocalSettings).ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LocalSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
OrderManagementDlg dlg = new OrderManagementDlg(session, listOfOrders);
|
||||
Application.Run(dlg);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogException(log, "Exception in Application.Run(MainWnd)", e);
|
||||
|
||||
MessageBox.Show("Program crashed:" +
|
||||
Environment.NewLine + Environment.NewLine + e.Message +
|
||||
((e.InnerException == null) ? string.Empty : (Environment.NewLine + e.InnerException.Message)) +
|
||||
Environment.NewLine + e.StackTrace,
|
||||
"Fatal error",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MyHandler(object sender, UnhandledExceptionEventArgs args)
|
||||
{
|
||||
Exception e = args.ExceptionObject as Exception;
|
||||
if (e == null) return;
|
||||
|
||||
LogException(log, "Unhandled exception", e);
|
||||
|
||||
MessageBox.Show("Program crashed:" +
|
||||
Environment.NewLine + Environment.NewLine + e.Message +
|
||||
((e.InnerException == null) ? string.Empty : (Environment.NewLine + e.InnerException.Message)) +
|
||||
Environment.NewLine + e.StackTrace,
|
||||
"Fatal error",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
}
|
||||
|
||||
static void LogException(ILog log, string description, Exception e)
|
||||
{
|
||||
log.FatalFormat("---------------( {0} )---------------", description);
|
||||
log.FatalFormat("Message : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
|
||||
log.Fatal("--------------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
36
OrderManagement/Properties/AssemblyInfo.cs
Normal file
36
OrderManagement/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OrderManagement")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OrderManagement")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f6b32e4f-1445-4970-bafa-dcd39d36f9b3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
OrderManagement/Properties/Resources.Designer.cs
generated
Normal file
71
OrderManagement/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OrderManagement.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OrderManagement.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
OrderManagement/Properties/Resources.resx
Normal file
117
OrderManagement/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
OrderManagement/Properties/Settings.Designer.cs
generated
Normal file
30
OrderManagement/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OrderManagement.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
OrderManagement/Properties/Settings.settings
Normal file
7
OrderManagement/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
396
OrderManagement/Resources/Strings.Designer.cs
generated
Normal file
396
OrderManagement/Resources/Strings.Designer.cs
generated
Normal file
@ -0,0 +1,396 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OrderManagement.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Strings {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Strings() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OrderManagement.Resources.Strings", typeof(Strings).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure ?.
|
||||
/// </summary>
|
||||
internal static string Are_you_sure {
|
||||
get {
|
||||
return ResourceManager.GetString("Are_you_sure", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
internal static string Cancel {
|
||||
get {
|
||||
return ResourceManager.GetString("Cancel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Close it please using 'Task manager'.
|
||||
/// </summary>
|
||||
internal static string Close_it_please {
|
||||
get {
|
||||
return ResourceManager.GetString("Close_it_please", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connection string for production tracing database.
|
||||
/// </summary>
|
||||
internal static string Connection_string_tracing_DB {
|
||||
get {
|
||||
return ResourceManager.GetString("Connection_string_tracing_DB", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connection string for database of users.
|
||||
/// </summary>
|
||||
internal static string Connection_string_users_DB {
|
||||
get {
|
||||
return ResourceManager.GetString("Connection_string_users_DB", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Database.
|
||||
/// </summary>
|
||||
internal static string Database {
|
||||
get {
|
||||
return ResourceManager.GetString("Database", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default settings are used..
|
||||
/// </summary>
|
||||
internal static string Default_settings_are_used {
|
||||
get {
|
||||
return ResourceManager.GetString("Default_settings_are_used", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to digits count.
|
||||
/// </summary>
|
||||
internal static string digits_count {
|
||||
get {
|
||||
return ResourceManager.GetString("digits_count", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error.
|
||||
/// </summary>
|
||||
internal static string Error {
|
||||
get {
|
||||
return ResourceManager.GetString("Error", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to first.
|
||||
/// </summary>
|
||||
internal static string first {
|
||||
get {
|
||||
return ResourceManager.GetString("first", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid '{0}'.
|
||||
/// </summary>
|
||||
internal static string Invalid_0 {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_0", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Language, 语言, Sprache, jazyk.
|
||||
/// </summary>
|
||||
internal static string Language_etc {
|
||||
get {
|
||||
return ResourceManager.GetString("Language_etc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
internal static string OK {
|
||||
get {
|
||||
return ResourceManager.GetString("OK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Order.
|
||||
/// </summary>
|
||||
internal static string Order {
|
||||
get {
|
||||
return ResourceManager.GetString("Order", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Order with the same ID already exists.
|
||||
/// </summary>
|
||||
internal static string Order_with_the_same_ID_already_exists {
|
||||
get {
|
||||
return ResourceManager.GetString("Order_with_the_same_ID_already_exists", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Parameter.
|
||||
/// </summary>
|
||||
internal static string Parameter {
|
||||
get {
|
||||
return ResourceManager.GetString("Parameter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pieces count.
|
||||
/// </summary>
|
||||
internal static string Pieces_count {
|
||||
get {
|
||||
return ResourceManager.GetString("Pieces_count", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to prefix.
|
||||
/// </summary>
|
||||
internal static string prefix {
|
||||
get {
|
||||
return ResourceManager.GetString("prefix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program '{0}' is running already..
|
||||
/// </summary>
|
||||
internal static string Program_0_is_running_already {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_0_is_running_already", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program is running for the 1st time on this PC..
|
||||
/// </summary>
|
||||
internal static string Program_is_running_for_the_1st_time_on_this_PC {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_is_running_for_the_1st_time_on_this_PC", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program restart is required.
|
||||
/// </summary>
|
||||
internal static string Program_restart_is_required {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_restart_is_required", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to R.A..
|
||||
/// </summary>
|
||||
internal static string RA {
|
||||
get {
|
||||
return ResourceManager.GetString("RA", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Remark.
|
||||
/// </summary>
|
||||
internal static string Remark {
|
||||
get {
|
||||
return ResourceManager.GetString("Remark", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Save.
|
||||
/// </summary>
|
||||
internal static string Save {
|
||||
get {
|
||||
return ResourceManager.GetString("Save", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Saving an order failed.
|
||||
/// </summary>
|
||||
internal static string Saving_order_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Saving_order_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Settings.
|
||||
/// </summary>
|
||||
internal static string Settings {
|
||||
get {
|
||||
return ResourceManager.GetString("Settings", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to S/N.
|
||||
/// </summary>
|
||||
internal static string SN {
|
||||
get {
|
||||
return ResourceManager.GetString("SN", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to State.
|
||||
/// </summary>
|
||||
internal static string State {
|
||||
get {
|
||||
return ResourceManager.GetString("State", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to suffix.
|
||||
/// </summary>
|
||||
internal static string suffix {
|
||||
get {
|
||||
return ResourceManager.GetString("suffix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test procedure.
|
||||
/// </summary>
|
||||
internal static string Test_procedure {
|
||||
get {
|
||||
return ResourceManager.GetString("Test_procedure", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User login is required.
|
||||
/// </summary>
|
||||
internal static string User_login_is_required {
|
||||
get {
|
||||
return ResourceManager.GetString("User_login_is_required", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Value.
|
||||
/// </summary>
|
||||
internal static string Value {
|
||||
get {
|
||||
return ResourceManager.GetString("Value", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Variant code.
|
||||
/// </summary>
|
||||
internal static string Variant_code {
|
||||
get {
|
||||
return ResourceManager.GetString("Variant_code", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Warning.
|
||||
/// </summary>
|
||||
internal static string Warning {
|
||||
get {
|
||||
return ResourceManager.GetString("Warning", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Workflow.
|
||||
/// </summary>
|
||||
internal static string Workflow {
|
||||
get {
|
||||
return ResourceManager.GetString("Workflow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to You can only delete 'New' porduction orders.
|
||||
/// </summary>
|
||||
internal static string You_can_only_delete_New_porduction_orders {
|
||||
get {
|
||||
return ResourceManager.GetString("You_can_only_delete_New_porduction_orders", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to You can only edit 'New' porduction orders.
|
||||
/// </summary>
|
||||
internal static string You_can_only_edit_New_porduction_orders {
|
||||
get {
|
||||
return ResourceManager.GetString("You_can_only_edit_New_porduction_orders", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
231
OrderManagement/Resources/Strings.resx
Normal file
231
OrderManagement/Resources/Strings.resx
Normal file
@ -0,0 +1,231 @@
|
||||
<?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="Are_you_sure" xml:space="preserve">
|
||||
<value>Are you sure ?</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="Close_it_please" xml:space="preserve">
|
||||
<value>Close it please using 'Task manager'</value>
|
||||
</data>
|
||||
<data name="Connection_string_tracing_DB" xml:space="preserve">
|
||||
<value>Connection string for production tracing database</value>
|
||||
</data>
|
||||
<data name="Connection_string_users_DB" xml:space="preserve">
|
||||
<value>Connection string for database of users</value>
|
||||
</data>
|
||||
<data name="Database" xml:space="preserve">
|
||||
<value>Database</value>
|
||||
</data>
|
||||
<data name="Default_settings_are_used" xml:space="preserve">
|
||||
<value>Default settings are used.</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Error</value>
|
||||
</data>
|
||||
<data name="first" xml:space="preserve">
|
||||
<value>first</value>
|
||||
</data>
|
||||
<data name="Invalid_0" xml:space="preserve">
|
||||
<value>Invalid '{0}'</value>
|
||||
</data>
|
||||
<data name="Language_etc" xml:space="preserve">
|
||||
<value>Language, 语言, Sprache, jazyk</value>
|
||||
</data>
|
||||
<data name="Order" xml:space="preserve">
|
||||
<value>Order</value>
|
||||
</data>
|
||||
<data name="State" xml:space="preserve">
|
||||
<value>State</value>
|
||||
</data>
|
||||
<data name="Pieces_count" xml:space="preserve">
|
||||
<value>Pieces count</value>
|
||||
</data>
|
||||
<data name="prefix" xml:space="preserve">
|
||||
<value>prefix</value>
|
||||
</data>
|
||||
<data name="Program_0_is_running_already" xml:space="preserve">
|
||||
<value>Program '{0}' is running already.</value>
|
||||
</data>
|
||||
<data name="Program_is_running_for_the_1st_time_on_this_PC" xml:space="preserve">
|
||||
<value>Program is running for the 1st time on this PC.</value>
|
||||
</data>
|
||||
<data name="Program_restart_is_required" xml:space="preserve">
|
||||
<value>Program restart is required</value>
|
||||
</data>
|
||||
<data name="Remark" xml:space="preserve">
|
||||
<value>Remark</value>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Save</value>
|
||||
</data>
|
||||
<data name="Settings" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="digits_count" xml:space="preserve">
|
||||
<value>digits count</value>
|
||||
</data>
|
||||
<data name="suffix" xml:space="preserve">
|
||||
<value>suffix</value>
|
||||
</data>
|
||||
<data name="Test_procedure" xml:space="preserve">
|
||||
<value>Test procedure</value>
|
||||
</data>
|
||||
<data name="User_login_is_required" xml:space="preserve">
|
||||
<value>User login is required</value>
|
||||
</data>
|
||||
<data name="Variant_code" xml:space="preserve">
|
||||
<value>Variant code</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Warning</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Workflow</value>
|
||||
</data>
|
||||
<data name="OK" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Parameter" xml:space="preserve">
|
||||
<value>Parameter</value>
|
||||
</data>
|
||||
<data name="Value" xml:space="preserve">
|
||||
<value>Value</value>
|
||||
</data>
|
||||
<data name="Saving_order_failed" xml:space="preserve">
|
||||
<value>Saving an order failed</value>
|
||||
</data>
|
||||
<data name="Order_with_the_same_ID_already_exists" xml:space="preserve">
|
||||
<value>Order with the same ID already exists</value>
|
||||
</data>
|
||||
<data name="RA" xml:space="preserve">
|
||||
<value>R.A.</value>
|
||||
</data>
|
||||
<data name="SN" xml:space="preserve">
|
||||
<value>S/N</value>
|
||||
</data>
|
||||
<data name="You_can_only_edit_New_porduction_orders" xml:space="preserve">
|
||||
<value>You can only edit 'New' porduction orders</value>
|
||||
</data>
|
||||
<data name="You_can_only_delete_New_porduction_orders" xml:space="preserve">
|
||||
<value>You can only delete 'New' porduction orders</value>
|
||||
</data>
|
||||
</root>
|
||||
219
OrderManagement/Resources/Strings.sk.resx
Normal file
219
OrderManagement/Resources/Strings.sk.resx
Normal file
@ -0,0 +1,219 @@
|
||||
<?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="Are_you_sure" xml:space="preserve">
|
||||
<value>Ste si istí ?</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Zrušiť</value>
|
||||
</data>
|
||||
<data name="Close_it_please" xml:space="preserve">
|
||||
<value>Zavrite ho prosím 'Správcom úloh' (Task manager).</value>
|
||||
</data>
|
||||
<data name="Connection_string_tracing_DB" xml:space="preserve">
|
||||
<value>Konfigurácia databázy sledovania výroby</value>
|
||||
</data>
|
||||
<data name="Connection_string_users_DB" xml:space="preserve">
|
||||
<value>Konfigurácia databázy používateľov</value>
|
||||
</data>
|
||||
<data name="Database" xml:space="preserve">
|
||||
<value>Databáza</value>
|
||||
</data>
|
||||
<data name="Default_settings_are_used" xml:space="preserve">
|
||||
<value>Použijú sa základné nastavenia</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Chyba</value>
|
||||
</data>
|
||||
<data name="first" xml:space="preserve">
|
||||
<value>prvá/é</value>
|
||||
</data>
|
||||
<data name="Invalid_0" xml:space="preserve">
|
||||
<value>Neplatný(á,é) {0}</value>
|
||||
</data>
|
||||
<data name="Language_etc" xml:space="preserve">
|
||||
<value>Language, 语言, Sprache, jazyk</value>
|
||||
</data>
|
||||
<data name="Order" xml:space="preserve">
|
||||
<value>Zákazka</value>
|
||||
</data>
|
||||
<data name="State" xml:space="preserve">
|
||||
<value>Stav</value>
|
||||
</data>
|
||||
<data name="Pieces_count" xml:space="preserve">
|
||||
<value>Počet kusov</value>
|
||||
</data>
|
||||
<data name="prefix" xml:space="preserve">
|
||||
<value>Prefix</value>
|
||||
</data>
|
||||
<data name="Program_0_is_running_already" xml:space="preserve">
|
||||
<value>Program '[0}' už beží.</value>
|
||||
</data>
|
||||
<data name="Program_is_running_for_the_1st_time_on_this_PC" xml:space="preserve">
|
||||
<value>Program bol spustený na tomto počítači prvý krát.</value>
|
||||
</data>
|
||||
<data name="Program_restart_is_required" xml:space="preserve">
|
||||
<value>je potrebný reštart programu</value>
|
||||
</data>
|
||||
<data name="Remark" xml:space="preserve">
|
||||
<value>Poznámka</value>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Uložíť</value>
|
||||
</data>
|
||||
<data name="Settings" xml:space="preserve">
|
||||
<value>Nastavenia</value>
|
||||
</data>
|
||||
<data name="digits_count" xml:space="preserve">
|
||||
<value>počet číslic</value>
|
||||
</data>
|
||||
<data name="suffix" xml:space="preserve">
|
||||
<value>Suffix</value>
|
||||
</data>
|
||||
<data name="Test_procedure" xml:space="preserve">
|
||||
<value>Testovacia procedúra</value>
|
||||
</data>
|
||||
<data name="User_login_is_required" xml:space="preserve">
|
||||
<value>Vyžaduje sa prihlásenie používateľa</value>
|
||||
</data>
|
||||
<data name="Variant_code" xml:space="preserve">
|
||||
<value>Kód variantu</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Upozornenie</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Pracovný postup</value>
|
||||
</data>
|
||||
<data name="OK" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Parameter" xml:space="preserve">
|
||||
<value>Parameter</value>
|
||||
</data>
|
||||
<data name="Value" xml:space="preserve">
|
||||
<value>Hodnota</value>
|
||||
</data>
|
||||
<data name="Saving_order_failed" xml:space="preserve">
|
||||
<value>Chyba pri ukladaní zákazky</value>
|
||||
</data>
|
||||
<data name="Order_with_the_same_ID_already_exists" xml:space="preserve">
|
||||
<value>Existuje zákazka s rovnakým ID</value>
|
||||
</data>
|
||||
</root>
|
||||
23
OrderManagement/SampleConfig/log4netConfig.xml
Normal file
23
OrderManagement/SampleConfig/log4netConfig.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<log4net>
|
||||
<!-- Program log appenders -->
|
||||
<appender name="OrderManagementLog" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="..\Logs\OrderManagementLog.txt" />
|
||||
<appendToFile value="true" />
|
||||
<rollingMode value="Date" />
|
||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date %-5level %logger - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger -->
|
||||
<root>
|
||||
<level value="WARN" />
|
||||
</root>
|
||||
|
||||
<!-- Set program loggers -->
|
||||
<logger name="OrderManagement"> <appender-ref ref="OrderManagementLog" /> <level value="WARN" /> </logger>
|
||||
|
||||
<!-- Set program logging levels -->
|
||||
<logger name="OrderManagement.OrderManagementDlg"> <level value="INFO" /> </logger>
|
||||
</log4net>
|
||||
179
OrderManagement/SettingsDlg.Designer.cs
generated
Normal file
179
OrderManagement/SettingsDlg.Designer.cs
generated
Normal file
@ -0,0 +1,179 @@
|
||||
namespace OrderManagement
|
||||
{
|
||||
partial class SettingsDlg
|
||||
{
|
||||
/// <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.commonGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.loginRequiredCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.languageComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.languageLabel = new System.Windows.Forms.Label();
|
||||
this.connStrForTracingGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.tracingDBConnStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.connStrForUsersGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.usersDBConnStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.saveButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.commonGroupBox.SuspendLayout();
|
||||
this.connStrForTracingGroupBox.SuspendLayout();
|
||||
this.connStrForUsersGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// commonGroupBox
|
||||
//
|
||||
this.commonGroupBox.Controls.Add(this.loginRequiredCheckBox);
|
||||
this.commonGroupBox.Controls.Add(this.languageComboBox);
|
||||
this.commonGroupBox.Controls.Add(this.languageLabel);
|
||||
this.commonGroupBox.Location = new System.Drawing.Point(12, 12);
|
||||
this.commonGroupBox.Name = "commonGroupBox";
|
||||
this.commonGroupBox.Size = new System.Drawing.Size(418, 87);
|
||||
this.commonGroupBox.TabIndex = 16;
|
||||
this.commonGroupBox.TabStop = false;
|
||||
//
|
||||
// loginRequiredCheckBox
|
||||
//
|
||||
this.loginRequiredCheckBox.AutoSize = true;
|
||||
this.loginRequiredCheckBox.Location = new System.Drawing.Point(22, 53);
|
||||
this.loginRequiredCheckBox.Name = "loginRequiredCheckBox";
|
||||
this.loginRequiredCheckBox.Size = new System.Drawing.Size(114, 17);
|
||||
this.loginRequiredCheckBox.TabIndex = 2;
|
||||
this.loginRequiredCheckBox.Text = "User login required";
|
||||
this.loginRequiredCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// languageComboBox
|
||||
//
|
||||
this.languageComboBox.FormattingEnabled = true;
|
||||
this.languageComboBox.Location = new System.Drawing.Point(292, 17);
|
||||
this.languageComboBox.Name = "languageComboBox";
|
||||
this.languageComboBox.Size = new System.Drawing.Size(80, 21);
|
||||
this.languageComboBox.TabIndex = 1;
|
||||
//
|
||||
// languageLabel
|
||||
//
|
||||
this.languageLabel.AutoSize = true;
|
||||
this.languageLabel.Location = new System.Drawing.Point(19, 20);
|
||||
this.languageLabel.Name = "languageLabel";
|
||||
this.languageLabel.Size = new System.Drawing.Size(134, 13);
|
||||
this.languageLabel.TabIndex = 0;
|
||||
this.languageLabel.Text = "Language, Sprache, Jazyk";
|
||||
//
|
||||
// connStrForTracingGroupBox
|
||||
//
|
||||
this.connStrForTracingGroupBox.Controls.Add(this.tracingDBConnStringTextBox);
|
||||
this.connStrForTracingGroupBox.Location = new System.Drawing.Point(12, 108);
|
||||
this.connStrForTracingGroupBox.Name = "connStrForTracingGroupBox";
|
||||
this.connStrForTracingGroupBox.Size = new System.Drawing.Size(660, 50);
|
||||
this.connStrForTracingGroupBox.TabIndex = 17;
|
||||
this.connStrForTracingGroupBox.TabStop = false;
|
||||
this.connStrForTracingGroupBox.Text = "Connection string for production tracing records";
|
||||
//
|
||||
// tracingDBConnStringTextBox
|
||||
//
|
||||
this.tracingDBConnStringTextBox.Location = new System.Drawing.Point(19, 18);
|
||||
this.tracingDBConnStringTextBox.Name = "tracingDBConnStringTextBox";
|
||||
this.tracingDBConnStringTextBox.Size = new System.Drawing.Size(617, 20);
|
||||
this.tracingDBConnStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// connStrForUsersGroupBox
|
||||
//
|
||||
this.connStrForUsersGroupBox.Controls.Add(this.usersDBConnStringTextBox);
|
||||
this.connStrForUsersGroupBox.Location = new System.Drawing.Point(12, 167);
|
||||
this.connStrForUsersGroupBox.Name = "connStrForUsersGroupBox";
|
||||
this.connStrForUsersGroupBox.Size = new System.Drawing.Size(660, 50);
|
||||
this.connStrForUsersGroupBox.TabIndex = 18;
|
||||
this.connStrForUsersGroupBox.TabStop = false;
|
||||
this.connStrForUsersGroupBox.Text = "Connection string for central DB of users";
|
||||
//
|
||||
// usersDBConnStringTextBox
|
||||
//
|
||||
this.usersDBConnStringTextBox.Location = new System.Drawing.Point(19, 18);
|
||||
this.usersDBConnStringTextBox.Name = "usersDBConnStringTextBox";
|
||||
this.usersDBConnStringTextBox.Size = new System.Drawing.Size(617, 20);
|
||||
this.usersDBConnStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// saveButton
|
||||
//
|
||||
this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.saveButton.Location = new System.Drawing.Point(475, 29);
|
||||
this.saveButton.Name = "saveButton";
|
||||
this.saveButton.Size = new System.Drawing.Size(74, 47);
|
||||
this.saveButton.TabIndex = 19;
|
||||
this.saveButton.Text = "Save";
|
||||
this.saveButton.UseVisualStyleBackColor = true;
|
||||
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.Location = new System.Drawing.Point(577, 29);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(71, 47);
|
||||
this.cancelButton.TabIndex = 20;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// SettingsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(688, 232);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.saveButton);
|
||||
this.Controls.Add(this.connStrForUsersGroupBox);
|
||||
this.Controls.Add(this.connStrForTracingGroupBox);
|
||||
this.Controls.Add(this.commonGroupBox);
|
||||
this.Name = "SettingsDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Settings";
|
||||
this.Load += new System.EventHandler(this.SettingsDlg_Load);
|
||||
this.commonGroupBox.ResumeLayout(false);
|
||||
this.commonGroupBox.PerformLayout();
|
||||
this.connStrForTracingGroupBox.ResumeLayout(false);
|
||||
this.connStrForTracingGroupBox.PerformLayout();
|
||||
this.connStrForUsersGroupBox.ResumeLayout(false);
|
||||
this.connStrForUsersGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox commonGroupBox;
|
||||
private System.Windows.Forms.ComboBox languageComboBox;
|
||||
private System.Windows.Forms.Label languageLabel;
|
||||
private System.Windows.Forms.CheckBox loginRequiredCheckBox;
|
||||
private System.Windows.Forms.GroupBox connStrForTracingGroupBox;
|
||||
private System.Windows.Forms.TextBox tracingDBConnStringTextBox;
|
||||
private System.Windows.Forms.GroupBox connStrForUsersGroupBox;
|
||||
private System.Windows.Forms.TextBox usersDBConnStringTextBox;
|
||||
private System.Windows.Forms.Button saveButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
}
|
||||
}
|
||||
126
OrderManagement/SettingsDlg.cs
Normal file
126
OrderManagement/SettingsDlg.cs
Normal file
@ -0,0 +1,126 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using OrderManagement.Resources;
|
||||
|
||||
namespace OrderManagement
|
||||
{
|
||||
public partial class SettingsDlg : Form
|
||||
{
|
||||
private LocalSettings ls;
|
||||
|
||||
public SettingsDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public SettingsDlg(LocalSettings localSettings)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.ls = localSettings;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Settings;
|
||||
languageLabel.Text = Strings.Language_etc;
|
||||
loginRequiredCheckBox.Text = Strings.User_login_is_required;
|
||||
saveButton.Text = Strings.Save;
|
||||
cancelButton.Text = Strings.Cancel;
|
||||
connStrForTracingGroupBox.Text = Strings.Connection_string_tracing_DB;
|
||||
connStrForUsersGroupBox.Text = Strings.Connection_string_users_DB;
|
||||
}
|
||||
|
||||
private void SettingsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
languageComboBox.Items.Add("EN");
|
||||
languageComboBox.Items.Add("ZH_CN");
|
||||
languageComboBox.Items.Add("DE");
|
||||
languageComboBox.Items.Add("SK");
|
||||
languageComboBox.Text = ls.Language;
|
||||
|
||||
if (ls == null) return;
|
||||
|
||||
loginRequiredCheckBox.Checked = ls.IsUserLoginRequired;
|
||||
|
||||
tracingDBConnStringTextBox.Text = ls.TracingDBConnString;
|
||||
usersDBConnStringTextBox.Text = ls.UsersDBConnString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies UI content
|
||||
/// </summary>
|
||||
/// <returns>None-empty string (message) when invalid</returns>
|
||||
string IsUIContentValid()
|
||||
{
|
||||
if (!languageComboBox.Items.Contains(languageComboBox.Text))
|
||||
{
|
||||
return "Invalid language";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates settings, checks for differences compared to previous setrtings
|
||||
/// </summary>
|
||||
/// <returns>true when settings are different</returns>
|
||||
bool UpdateSettings()
|
||||
{
|
||||
if (ls == null) return false;
|
||||
|
||||
bool isDifferent = false;
|
||||
|
||||
if (ls.Language != languageComboBox.Text)
|
||||
{
|
||||
ls.Language = languageComboBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.IsUserLoginRequired != loginRequiredCheckBox.Checked)
|
||||
{
|
||||
ls.IsUserLoginRequired = loginRequiredCheckBox.Checked;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.TracingDBConnString != tracingDBConnStringTextBox.Text)
|
||||
{
|
||||
ls.TracingDBConnString = tracingDBConnStringTextBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.UsersDBConnString != usersDBConnStringTextBox.Text)
|
||||
{
|
||||
ls.UsersDBConnString = usersDBConnStringTextBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
private void saveButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
string message = IsUIContentValid();
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
UpdateSettings();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
OrderManagement/SettingsDlg.resx
Normal file
120
OrderManagement/SettingsDlg.resx
Normal 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>
|
||||
12
TBF.sln
12
TBF.sln
@ -78,6 +78,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedDatabase", "SharedDat
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureVectorCalculator", "FeatureVectorCalculator\FeatureVectorCalculator.csproj", "{6280F3F9-139A-48E3-8C88-25EB4124E982}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderManagement", "OrderManagement\OrderManagement.csproj", "{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -332,6 +334,16 @@ Global
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7DF40C07-9A1D-403B-91D3-D45660E6D3B1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.1.1806.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1806.0")]
|
||||
[assembly: AssemblyVersion("3.1.1809.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1809.0")]
|
||||
|
||||
@ -26,6 +26,10 @@ rmdir /s /q GraphLib\bin
|
||||
rmdir /s /q GraphLib\obj
|
||||
rmdir /s /q MergeResultsDBs\bin
|
||||
rmdir /s /q MergeResultsDBs\obj
|
||||
rmdir /s /q OrderManagement\bin\Debug
|
||||
rmdir /s /q OrderManagement\bin\Release
|
||||
rmdir /s /q OrderManagement\bin\Logs
|
||||
rmdir /s /q OrderManagement\obj
|
||||
rmdir /s /q TracingDB\bin
|
||||
rmdir /s /q TracingDB\obj
|
||||
rmdir /s /q ResetBatchNr\bin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user