diff --git a/UserManagement/Properties/AssemblyInfo.cs b/UserManagement/Properties/AssemblyInfo.cs index c1f11743f..b99ddb9d5 100644 --- a/UserManagement/Properties/AssemblyInfo.cs +++ b/UserManagement/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.12.497.0")] +[assembly: AssemblyFileVersion("2.12.497.0")] diff --git a/Users/Forms/EditSelectedUser.Designer.cs b/Users/Forms/EditSelectedUser.Designer.cs index 31653ea2d..96722c9e1 100644 --- a/Users/Forms/EditSelectedUser.Designer.cs +++ b/Users/Forms/EditSelectedUser.Designer.cs @@ -31,120 +31,136 @@ namespace Users.Forms /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditSelectedUser)); - this.txtName = new System.Windows.Forms.TextBox(); - this.nameLabel = new System.Windows.Forms.Label(); - this.btnOk = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.txtPassword = new System.Windows.Forms.TextBox(); - this.passwordLabel = new System.Windows.Forms.Label(); - this.txtDescription = new System.Windows.Forms.TextBox(); - this.descriptionLabel = new System.Windows.Forms.Label(); - this.checkedListBoxGroups = new System.Windows.Forms.CheckedListBox(); - this.groupsLabel = new System.Windows.Forms.Label(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.repeatPasswordLabel = new System.Windows.Forms.Label(); - this.txtRepeatPassword = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // txtName - // - resources.ApplyResources(this.txtName, "txtName"); - this.txtName.Name = "txtName"; - this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); - this.txtName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtName_KeyPress); - this.txtName.Validated += new System.EventHandler(this.txtName_Validated); - // - // nameLabel - // - resources.ApplyResources(this.nameLabel, "nameLabel"); - this.nameLabel.Name = "nameLabel"; - // - // btnOk - // - resources.ApplyResources(this.btnOk, "btnOk"); - this.btnOk.Name = "btnOk"; - this.btnOk.UseVisualStyleBackColor = true; - this.btnOk.Click += new System.EventHandler(this.btnOk_Click); - // - // btnCancel - // - resources.ApplyResources(this.btnCancel, "btnCancel"); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // txtPassword - // - resources.ApplyResources(this.txtPassword, "txtPassword"); - this.txtPassword.Name = "txtPassword"; - this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); - // - // passwordLabel - // - resources.ApplyResources(this.passwordLabel, "passwordLabel"); - this.passwordLabel.Name = "passwordLabel"; - // - // txtDescription - // - resources.ApplyResources(this.txtDescription, "txtDescription"); - this.txtDescription.Name = "txtDescription"; - this.txtDescription.TextChanged += new System.EventHandler(this.txtDescription_TextChanged); - this.txtDescription.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDescription_KeyPress); - // - // descriptionLabel - // - resources.ApplyResources(this.descriptionLabel, "descriptionLabel"); - this.descriptionLabel.Name = "descriptionLabel"; - // - // checkedListBoxGroups - // - this.checkedListBoxGroups.CheckOnClick = true; - this.checkedListBoxGroups.FormattingEnabled = true; - resources.ApplyResources(this.checkedListBoxGroups, "checkedListBoxGroups"); - this.checkedListBoxGroups.Name = "checkedListBoxGroups"; - this.checkedListBoxGroups.Click += new System.EventHandler(this.checkedListBoxGroups_Click); - // - // groupsLabel - // - resources.ApplyResources(this.groupsLabel, "groupsLabel"); - this.groupsLabel.Name = "groupsLabel"; - // - // repeatPasswordLabel - // - resources.ApplyResources(this.repeatPasswordLabel, "repeatPasswordLabel"); - this.repeatPasswordLabel.Name = "repeatPasswordLabel"; - // - // txtRepeatPassword - // - resources.ApplyResources(this.txtRepeatPassword, "txtRepeatPassword"); - this.txtRepeatPassword.Name = "txtRepeatPassword"; - // - // EditSelectedUser - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.repeatPasswordLabel); - this.Controls.Add(this.txtRepeatPassword); - this.Controls.Add(this.groupsLabel); - this.Controls.Add(this.checkedListBoxGroups); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOk); - this.Controls.Add(this.descriptionLabel); - this.Controls.Add(this.passwordLabel); - this.Controls.Add(this.nameLabel); - this.Controls.Add(this.txtDescription); - this.Controls.Add(this.txtPassword); - this.Controls.Add(this.txtName); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.Name = "EditSelectedUser"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Load += new System.EventHandler(this.EditSelectedUser_Load); - this.Shown += new System.EventHandler(this.EditSelectedUser_Shown); - this.ResumeLayout(false); - this.PerformLayout(); + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditSelectedUser)); + this.txtName = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.passwordLabel = new System.Windows.Forms.Label(); + this.txtDescription = new System.Windows.Forms.TextBox(); + this.descriptionLabel = new System.Windows.Forms.Label(); + this.checkedListBoxGroups = new System.Windows.Forms.CheckedListBox(); + this.groupsLabel = new System.Windows.Forms.Label(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.repeatPasswordLabel = new System.Windows.Forms.Label(); + this.txtRepeatPassword = new System.Windows.Forms.TextBox(); + this.codeLabel = new System.Windows.Forms.Label(); + this.txtCode = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // txtName + // + resources.ApplyResources(this.txtName, "txtName"); + this.txtName.Name = "txtName"; + this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); + this.txtName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtName_KeyPress); + this.txtName.Validated += new System.EventHandler(this.txtName_Validated); + // + // nameLabel + // + resources.ApplyResources(this.nameLabel, "nameLabel"); + this.nameLabel.Name = "nameLabel"; + // + // btnOk + // + resources.ApplyResources(this.btnOk, "btnOk"); + this.btnOk.Name = "btnOk"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // btnCancel + // + resources.ApplyResources(this.btnCancel, "btnCancel"); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // txtPassword + // + resources.ApplyResources(this.txtPassword, "txtPassword"); + this.txtPassword.Name = "txtPassword"; + this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); + // + // passwordLabel + // + resources.ApplyResources(this.passwordLabel, "passwordLabel"); + this.passwordLabel.Name = "passwordLabel"; + // + // txtDescription + // + resources.ApplyResources(this.txtDescription, "txtDescription"); + this.txtDescription.Name = "txtDescription"; + this.txtDescription.TextChanged += new System.EventHandler(this.txtDescription_TextChanged); + this.txtDescription.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtDescription_KeyPress); + // + // descriptionLabel + // + resources.ApplyResources(this.descriptionLabel, "descriptionLabel"); + this.descriptionLabel.Name = "descriptionLabel"; + // + // checkedListBoxGroups + // + this.checkedListBoxGroups.CheckOnClick = true; + this.checkedListBoxGroups.FormattingEnabled = true; + resources.ApplyResources(this.checkedListBoxGroups, "checkedListBoxGroups"); + this.checkedListBoxGroups.Name = "checkedListBoxGroups"; + this.checkedListBoxGroups.Click += new System.EventHandler(this.checkedListBoxGroups_Click); + // + // groupsLabel + // + resources.ApplyResources(this.groupsLabel, "groupsLabel"); + this.groupsLabel.Name = "groupsLabel"; + // + // repeatPasswordLabel + // + resources.ApplyResources(this.repeatPasswordLabel, "repeatPasswordLabel"); + this.repeatPasswordLabel.Name = "repeatPasswordLabel"; + // + // txtRepeatPassword + // + resources.ApplyResources(this.txtRepeatPassword, "txtRepeatPassword"); + this.txtRepeatPassword.Name = "txtRepeatPassword"; + this.txtRepeatPassword.TextChanged += new System.EventHandler(this.txtRepeatPassword_TextChanged); + // + // codeLabel + // + resources.ApplyResources(this.codeLabel, "codeLabel"); + this.codeLabel.Name = "codeLabel"; + // + // txtCode + // + resources.ApplyResources(this.txtCode, "txtCode"); + this.txtCode.Name = "txtCode"; + this.txtCode.TextChanged += new System.EventHandler(this.txtCode_TextChanged); + // + // EditSelectedUser + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.codeLabel); + this.Controls.Add(this.txtCode); + this.Controls.Add(this.repeatPasswordLabel); + this.Controls.Add(this.txtRepeatPassword); + this.Controls.Add(this.groupsLabel); + this.Controls.Add(this.checkedListBoxGroups); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.descriptionLabel); + this.Controls.Add(this.passwordLabel); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.txtDescription); + this.Controls.Add(this.txtPassword); + this.Controls.Add(this.txtName); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.Name = "EditSelectedUser"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Load += new System.EventHandler(this.EditSelectedUser_Load); + this.Shown += new System.EventHandler(this.EditSelectedUser_Shown); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -163,5 +179,7 @@ namespace Users.Forms private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.Label repeatPasswordLabel; private System.Windows.Forms.TextBox txtRepeatPassword; + private System.Windows.Forms.Label codeLabel; + private System.Windows.Forms.TextBox txtCode; } } \ No newline at end of file diff --git a/Users/Forms/EditSelectedUser.cs b/Users/Forms/EditSelectedUser.cs index 12243b6f0..1b2c24cc4 100644 --- a/Users/Forms/EditSelectedUser.cs +++ b/Users/Forms/EditSelectedUser.cs @@ -29,6 +29,7 @@ namespace Users.Forms Localize(); txtName.Text = CurrentEditUser.UserName; + txtCode.Text = CurrentEditUser.Number.ToString(); txtDescription.Text = CurrentEditUser.FullName; txtPassword.Text = ""; txtRepeatPassword.Text = ""; @@ -72,8 +73,7 @@ namespace Users.Forms public bool Save() - { - + { // todo: check if this name is given to another user if (IsUserNameAllreadyTaken(txtName.Text)) { @@ -81,6 +81,12 @@ namespace Users.Forms return false; } + int userCode; + if (!int.TryParse (txtCode.Text, out userCode)) + { + MessageBox.Show(Strings.Invalid_code); + return false; + } if (txtPassword.Text != "") { @@ -97,6 +103,7 @@ namespace Users.Forms CurrentEditUser.UserName = txtName.Text; CurrentEditUser.FullName = txtDescription.Text; + CurrentEditUser.Number = userCode; // Groups CurrentEditUser.Groups.Clear(); @@ -156,6 +163,9 @@ namespace Users.Forms { btnOk.Enabled = false; if (txtName.Text == "") return; + int userCode; + if (!int.TryParse(txtCode.Text, out userCode)) return; + if (txtPassword.Text != txtRepeatPassword.Text) return; btnOk.Enabled = true; } @@ -172,7 +182,6 @@ namespace Users.Forms private void txtName_KeyPress(object sender, KeyPressEventArgs e) { CheckIfFormCanBeSubmitted(); - } private void txtName_TextChanged(object sender, EventArgs e) @@ -185,6 +194,11 @@ namespace Users.Forms CheckIfFormCanBeSubmitted(); } + private void txtRepeatPassword_TextChanged(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } + private void txtDescription_TextChanged(object sender, EventArgs e) { CheckIfFormCanBeSubmitted(); @@ -199,5 +213,10 @@ namespace Users.Forms { CheckIfFormCanBeSubmitted(); } + + private void txtCode_TextChanged(object sender, EventArgs e) + { + CheckIfFormCanBeSubmitted(); + } } } diff --git a/Users/Forms/EditSelectedUser.resx b/Users/Forms/EditSelectedUser.resx index beae28c9a..2b6f00e1f 100644 --- a/Users/Forms/EditSelectedUser.resx +++ b/Users/Forms/EditSelectedUser.resx @@ -138,7 +138,7 @@ $this - 11 + 13 True @@ -165,10 +165,10 @@ $this - 8 + 10 - 137, 330 + 137, 356 84, 40 @@ -189,10 +189,10 @@ $this - 5 + 7 - 253, 330 + 253, 356 84, 40 @@ -213,10 +213,10 @@ $this - 4 + 6 - 137, 40 + 137, 38 * @@ -237,13 +237,13 @@ $this - 10 + 12 True - 9, 43 + 9, 41 53, 13 @@ -264,10 +264,10 @@ $this - 7 + 9 - 137, 99 + 137, 122 True @@ -288,13 +288,13 @@ $this - 9 + 11 True - 9, 102 + 9, 125 60, 13 @@ -315,10 +315,10 @@ $this - 6 + 8 - 137, 164 + 137, 190 200, 154 @@ -336,13 +336,13 @@ $this - 3 + 5 True - 9, 164 + 9, 190 41, 13 @@ -363,7 +363,7 @@ $this - 2 + 4 17, 17 @@ -397,7 +397,7 @@ $this - 0 + 2 137, 66 @@ -421,6 +421,57 @@ $this + 3 + + + True + + + NoControl + + + 9, 97 + + + 32, 13 + + + 12 + + + Code + + + codeLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 137, 94 + + + 66, 20 + + + 13 + + + txtCode + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 1 @@ -430,7 +481,7 @@ 6, 13 - 375, 383 + 375, 408 Edit User diff --git a/Users/Resources/Strings.Designer.cs b/Users/Resources/Strings.Designer.cs index d390b608d..e8b33b5e8 100644 --- a/Users/Resources/Strings.Designer.cs +++ b/Users/Resources/Strings.Designer.cs @@ -141,6 +141,15 @@ namespace Users.Resources { } } + /// + /// Looks up a localized string similar to Invalid user code.. + /// + internal static string Invalid_code { + get { + return ResourceManager.GetString("Invalid_code", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid username or password. /// diff --git a/Users/Resources/Strings.resx b/Users/Resources/Strings.resx index 4775be9f9..a5c0c11d1 100644 --- a/Users/Resources/Strings.resx +++ b/Users/Resources/Strings.resx @@ -183,4 +183,7 @@ User name + + Invalid user code. + \ No newline at end of file