diff --git a/AboutBox.Designer.cs b/AboutBox.Designer.cs index 82dd05a..c8f7313 100644 --- a/AboutBox.Designer.cs +++ b/AboutBox.Designer.cs @@ -29,13 +29,13 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox)); this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.logoPictureBox = new System.Windows.Forms.PictureBox(); this.labelProductName = new System.Windows.Forms.Label(); this.labelVersion = new System.Windows.Forms.Label(); this.labelCopyright = new System.Windows.Forms.Label(); this.labelCompanyName = new System.Windows.Forms.Label(); this.textBoxDescription = new System.Windows.Forms.TextBox(); this.okButton = new System.Windows.Forms.Button(); - this.logoPictureBox = new System.Windows.Forms.PictureBox(); this.tableLayoutPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); this.SuspendLayout(); @@ -65,6 +65,17 @@ private void InitializeComponent() this.tableLayoutPanel.Size = new System.Drawing.Size(432, 254); this.tableLayoutPanel.TabIndex = 0; // + // logoPictureBox + // + this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.logoPictureBox.Image = global::DSA_lims.Properties.Resources.dsa_logo_1461; + this.logoPictureBox.Location = new System.Drawing.Point(3, 3); + this.logoPictureBox.Name = "logoPictureBox"; + this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); + this.logoPictureBox.Size = new System.Drawing.Size(141, 248); + this.logoPictureBox.TabIndex = 12; + this.logoPictureBox.TabStop = false; + // // labelProductName // this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; @@ -136,17 +147,7 @@ private void InitializeComponent() this.okButton.Size = new System.Drawing.Size(75, 21); this.okButton.TabIndex = 24; this.okButton.Text = "&OK"; - // - // logoPictureBox - // - this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.logoPictureBox.Image = global::DSA_lims.Properties.Resources.dsa_logo_1461; - this.logoPictureBox.Location = new System.Drawing.Point(3, 3); - this.logoPictureBox.Name = "logoPictureBox"; - this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); - this.logoPictureBox.Size = new System.Drawing.Size(141, 248); - this.logoPictureBox.TabIndex = 12; - this.logoPictureBox.TabStop = false; + this.okButton.Click += new System.EventHandler(this.okButton_Click); // // AboutBox // diff --git a/AboutBox.cs b/AboutBox.cs index e486f91..2f44815 100644 --- a/AboutBox.cs +++ b/AboutBox.cs @@ -101,5 +101,10 @@ public string AssemblyCompany } } #endregion + + private void okButton_Click(object sender, EventArgs e) + { + + } } } diff --git a/DSA-LIMS_MANUAL.pdf b/DSA-LIMS_MANUAL.pdf index 1b03b8e..82c7d9f 100644 Binary files a/DSA-LIMS_MANUAL.pdf and b/DSA-LIMS_MANUAL.pdf differ diff --git a/FormLogin.cs b/FormLogin.cs index 4fd5d82..09758a9 100644 --- a/FormLogin.cs +++ b/FormLogin.cs @@ -25,6 +25,7 @@ You should have received a copy of the GNU General Public License using System.DirectoryServices.ActiveDirectory; using System.Drawing; using System.Linq; +using System.Reflection; using System.Security.Principal; using System.Text; using System.Windows.Forms; @@ -71,6 +72,16 @@ private void btnOk_Click(object sender, EventArgs e) trans = conn.BeginTransaction(); + int client_version, database_version; + + GetVersionInfo(conn, trans, out client_version, out database_version); + + if (client_version != database_version) + { + MessageBox.Show("Incompatible database. Client expects version " + client_version + " but database has version " + database_version); + return; + } + if (cboxAction.SelectedIndex == 0) { string username = tbUsername.Text.ToLower().Trim(); @@ -130,6 +141,14 @@ private void btnOk_Click(object sender, EventArgs e) } } + private void GetVersionInfo(SqlConnection conn, SqlTransaction trans, out int client_version, out int database_version) + { + client_version = Assembly.GetExecutingAssembly().GetName().Version.Major; + + SqlCommand cmd = new SqlCommand("select value from counters where name = 'database_version'", conn, trans); + database_version = (int)cmd.ExecuteScalar(); + } + private bool CreateLIMSAdministrator(SqlConnection conn, SqlTransaction trans) { FormCreateLIMSAdministrator form = new FormCreateLIMSAdministrator(); diff --git a/FormMain.Designer.cs b/FormMain.Designer.cs index 3a3bb32..357728d 100644 --- a/FormMain.Designer.cs +++ b/FormMain.Designer.cs @@ -4471,7 +4471,7 @@ private void InitializeComponent() // btnOrderDelSampleType // this.btnOrderDelSampleType.Name = "btnOrderDelSampleType"; - this.btnOrderDelSampleType.Size = new System.Drawing.Size(152, 22); + this.btnOrderDelSampleType.Size = new System.Drawing.Size(139, 22); this.btnOrderDelSampleType.Text = "Sample type"; this.btnOrderDelSampleType.Click += new System.EventHandler(this.miOrderRemSampleType_Click); // diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 420d553..d57c802 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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("0.0.*")] +[assembly: AssemblyVersion("1.1.*")] [assembly: AssemblyFileVersion("0.0.0.0")] diff --git a/database.sql b/database.sql index 4e0bb9f..56da312 100644 --- a/database.sql +++ b/database.sql @@ -157,6 +157,7 @@ create table counters ( ) go +insert into counters (name) values('database_version') insert into counters (name) values('sample_counter') go