diff --git a/ClientsLibrary/AccountSupport/FormInputNewRole.Designer.cs b/ClientsLibrary/AccountSupport/FormInputNewRole.Designer.cs new file mode 100644 index 0000000..85e50c9 --- /dev/null +++ b/ClientsLibrary/AccountSupport/FormInputNewRole.Designer.cs @@ -0,0 +1,140 @@ +namespace ClientsLibrary +{ + partial class FormInputNewRole + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.userButton_login = new HslCommunication.Controls.UserButton(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 21); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(68, 17); + this.label1.TabIndex = 0; + this.label1.Text = "唯一标识:"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(86, 18); + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(347, 23); + this.textBox1.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(44, 17); + this.label2.TabIndex = 2; + this.label2.Text = "名称:"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(86, 48); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(347, 23); + this.textBox2.TabIndex = 3; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(86, 79); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(347, 23); + this.textBox3.TabIndex = 5; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 82); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(44, 17); + this.label3.TabIndex = 4; + this.label3.Text = "描述:"; + // + // userButton_login + // + this.userButton_login.BackColor = System.Drawing.Color.Transparent; + this.userButton_login.CustomerInformation = ""; + this.userButton_login.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); + this.userButton_login.Font = new System.Drawing.Font("微软雅黑", 9F); + this.userButton_login.Location = new System.Drawing.Point(168, 109); + this.userButton_login.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.userButton_login.Name = "userButton_login"; + this.userButton_login.Size = new System.Drawing.Size(108, 27); + this.userButton_login.TabIndex = 9; + this.userButton_login.UIText = "确认"; + this.userButton_login.Click += new System.EventHandler(this.userButton_login_Click); + // + // FormInputNewRole + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(445, 142); + this.Controls.Add(this.userButton_login); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.label3); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.label2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(461, 181); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(461, 181); + this.Name = "FormInputNewRole"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FormInputNewRole"; + this.Load += new System.EventHandler(this.FormInputNewRole_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label3; + private HslCommunication.Controls.UserButton userButton_login; + } +} \ No newline at end of file diff --git a/ClientsLibrary/AccountSupport/FormInputNewRole.cs b/ClientsLibrary/AccountSupport/FormInputNewRole.cs new file mode 100644 index 0000000..865f503 --- /dev/null +++ b/ClientsLibrary/AccountSupport/FormInputNewRole.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using CommonLibrary; + +namespace ClientsLibrary +{ + + /// + /// 用户输入或者编辑新的角色内容 + /// + public partial class FormInputNewRole : Form + { + #region Constructor + + + public FormInputNewRole() + { + InitializeComponent(); + + Icon = UserClient.GetFormWindowIcon(); + } + + #endregion + + #region Form Load + + + private void FormInputNewRole_Load(object sender, EventArgs e) + { + if (m_RoleItem == null) + { + textBox1.Text = Guid.NewGuid().ToString("N"); + } + } + + + #endregion + + #region Show Dialog + + + public DialogResult ShowDialog(RoleItem roleItem) + { + // 此处是编辑 + m_RoleItem = roleItem; + + if (m_RoleItem != null) + { + textBox1.Text = m_RoleItem.RoleCode; + textBox2.Text = m_RoleItem.RoleName; + textBox3.Text = m_RoleItem.Description; + } + + return ShowDialog(); + } + + #endregion + + #region Public Property + + public RoleItem RoleItem + { + get { return m_RoleItem; } + } + + public string RoleName + { + get { return textBox2.Text; } + } + + public string RoleDescription + { + get { return textBox3.Text; } + } + + #endregion + + #region Private Members + + private RoleItem m_RoleItem; + + #endregion + + #region Save + + + private void userButton_login_Click(object sender, EventArgs e) + { + if(m_RoleItem == null) + { + m_RoleItem = new RoleItem() + { + RoleCode = textBox1.Text, + RoleName = textBox2.Text, + Description = textBox3.Text, + }; + + } + + DialogResult = DialogResult.OK; + } + + #endregion + } +} diff --git a/ClientsLibrary/AccountSupport/FormInputNewRole.resx b/ClientsLibrary/AccountSupport/FormInputNewRole.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/ClientsLibrary/AccountSupport/FormInputNewRole.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ClientsLibrary/AccountSupport/FormRegisterAccount.Designer.cs b/ClientsLibrary/AccountSupport/FormRegisterAccount.Designer.cs index d12305a..819ca34 100644 --- a/ClientsLibrary/AccountSupport/FormRegisterAccount.Designer.cs +++ b/ClientsLibrary/AccountSupport/FormRegisterAccount.Designer.cs @@ -43,6 +43,8 @@ namespace ClientsLibrary this.comboBox1 = new System.Windows.Forms.ComboBox(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.comboBox_factory = new System.Windows.Forms.ComboBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label1 @@ -56,22 +58,22 @@ namespace ClientsLibrary // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(98, 15); + this.textBox1.Location = new System.Drawing.Point(129, 15); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(232, 23); + this.textBox1.Size = new System.Drawing.Size(201, 23); this.textBox1.TabIndex = 1; // // textBox2 // - this.textBox2.Location = new System.Drawing.Point(98, 51); + this.textBox2.Location = new System.Drawing.Point(129, 83); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(232, 23); + this.textBox2.Size = new System.Drawing.Size(201, 23); this.textBox2.TabIndex = 3; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(21, 54); + this.label2.Location = new System.Drawing.Point(21, 86); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(44, 17); this.label2.TabIndex = 2; @@ -80,7 +82,7 @@ namespace ClientsLibrary // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(21, 90); + this.label3.Location = new System.Drawing.Point(21, 122); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(44, 17); this.label3.TabIndex = 4; @@ -89,7 +91,7 @@ namespace ClientsLibrary // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(21, 125); + this.label4.Location = new System.Drawing.Point(21, 157); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(44, 17); this.label4.TabIndex = 6; @@ -98,7 +100,7 @@ namespace ClientsLibrary // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(21, 161); + this.label5.Location = new System.Drawing.Point(21, 193); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(68, 17); this.label5.TabIndex = 8; @@ -106,15 +108,15 @@ namespace ClientsLibrary // // textBox4 // - this.textBox4.Location = new System.Drawing.Point(98, 192); + this.textBox4.Location = new System.Drawing.Point(129, 224); this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(232, 23); + this.textBox4.Size = new System.Drawing.Size(201, 23); this.textBox4.TabIndex = 11; // // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(21, 195); + this.label6.Location = new System.Drawing.Point(21, 227); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(68, 17); this.label6.TabIndex = 10; @@ -126,7 +128,7 @@ namespace ClientsLibrary this.userButton_login.CustomerInformation = ""; this.userButton_login.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_login.Font = new System.Drawing.Font("微软雅黑", 9F); - this.userButton_login.Location = new System.Drawing.Point(149, 279); + this.userButton_login.Location = new System.Drawing.Point(129, 284); this.userButton_login.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); this.userButton_login.Name = "userButton_login"; this.userButton_login.Size = new System.Drawing.Size(97, 31); @@ -138,34 +140,52 @@ namespace ClientsLibrary // this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(98, 122); + this.comboBox1.Location = new System.Drawing.Point(129, 154); this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(232, 25); + this.comboBox1.Size = new System.Drawing.Size(201, 25); this.comboBox1.TabIndex = 13; // // comboBox2 // this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox2.FormattingEnabled = true; - this.comboBox2.Location = new System.Drawing.Point(98, 157); + this.comboBox2.Location = new System.Drawing.Point(129, 189); this.comboBox2.Name = "comboBox2"; - this.comboBox2.Size = new System.Drawing.Size(232, 25); + this.comboBox2.Size = new System.Drawing.Size(201, 25); this.comboBox2.TabIndex = 14; // // comboBox_factory // this.comboBox_factory.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_factory.FormattingEnabled = true; - this.comboBox_factory.Location = new System.Drawing.Point(98, 86); + this.comboBox_factory.Location = new System.Drawing.Point(129, 118); this.comboBox_factory.Name = "comboBox_factory"; - this.comboBox_factory.Size = new System.Drawing.Size(232, 25); + this.comboBox_factory.Size = new System.Drawing.Size(201, 25); this.comboBox_factory.TabIndex = 15; // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(129, 48); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(201, 23); + this.textBox3.TabIndex = 17; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(21, 51); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(44, 17); + this.label7.TabIndex = 16; + this.label7.Text = "别名:"; + // // FormRegisterAccount // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(382, 342); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.label7); this.Controls.Add(this.comboBox_factory); this.Controls.Add(this.comboBox2); this.Controls.Add(this.comboBox1); @@ -207,5 +227,7 @@ namespace ClientsLibrary private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.ComboBox comboBox_factory; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label7; } } \ No newline at end of file diff --git a/ClientsLibrary/AccountSupport/FormRegisterAccount.cs b/ClientsLibrary/AccountSupport/FormRegisterAccount.cs index fbba605..f8c8fec 100644 --- a/ClientsLibrary/AccountSupport/FormRegisterAccount.cs +++ b/ClientsLibrary/AccountSupport/FormRegisterAccount.cs @@ -49,8 +49,32 @@ namespace ClientsLibrary comboBox_factory.DataSource = Factories.ToArray(); textBox4.Text = (new UserAccount()).ForbidMessage; + + UILocalization(); } + #endregion + + #region Localization Support + + /// + /// 本地化显示的操作,还未完成 + /// + private void UILocalization() + { + Text = UserLocalization.Localization.AccountRegisterTitle; + + label1.Text = UserLocalization.Localization.AccountName + ":"; + label7.Text = UserLocalization.Localization.AccountAlias + ":"; + label2.Text = UserLocalization.Localization.AccountPassword + ":"; + label3.Text = UserLocalization.Localization.AccountFactory + ":"; + label4.Text = UserLocalization.Localization.AccountGrade + ":"; + label5.Text = UserLocalization.Localization.AccountLoginEnable + ":"; + label6.Text = UserLocalization.Localization.AccountForbidMessage + ":"; + + } + + #endregion #region Register Account @@ -61,6 +85,7 @@ namespace ClientsLibrary // 点击了注册,先获取数据 UserAccount account = new UserAccount(); account.UserName = textBox1.Text; + account.NameAlias = textBox3.Text; account.Password = textBox2.Text; account.Factory = comboBox_factory.SelectedItem.ToString(); switch (comboBox1.SelectedIndex) diff --git a/ClientsLibrary/ClientsLibrary.csproj b/ClientsLibrary/ClientsLibrary.csproj index 4f2e542..8e32e44 100644 --- a/ClientsLibrary/ClientsLibrary.csproj +++ b/ClientsLibrary/ClientsLibrary.csproj @@ -62,6 +62,12 @@ FormAccountSelect.cs + + Form + + + FormInputNewRole.cs + Form @@ -169,6 +175,9 @@ FormAccountSelect.cs + + FormInputNewRole.cs + FormDownloading.cs diff --git a/ClientsLibrary/Configuration/FormConfiguration.Designer.cs b/ClientsLibrary/Configuration/FormConfiguration.Designer.cs index 3a3abbc..a6a010a 100644 --- a/ClientsLibrary/Configuration/FormConfiguration.Designer.cs +++ b/ClientsLibrary/Configuration/FormConfiguration.Designer.cs @@ -40,7 +40,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.panel1.Location = new System.Drawing.Point(232, 12); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(573, 525); + this.panel1.Size = new System.Drawing.Size(627, 569); this.panel1.TabIndex = 1; // // treeView1 @@ -55,14 +55,14 @@ this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { treeNode1}); this.treeView1.ShowLines = false; - this.treeView1.Size = new System.Drawing.Size(199, 525); + this.treeView1.Size = new System.Drawing.Size(199, 569); this.treeView1.TabIndex = 2; // // FormConfiguration // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(812, 549); + this.ClientSize = new System.Drawing.Size(866, 593); this.Controls.Add(this.treeView1); this.Controls.Add(this.panel1); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); diff --git a/ClientsLibrary/Configuration/RolesConfiguration.Designer.cs b/ClientsLibrary/Configuration/RolesConfiguration.Designer.cs index ada79d3..00101bc 100644 --- a/ClientsLibrary/Configuration/RolesConfiguration.Designer.cs +++ b/ClientsLibrary/Configuration/RolesConfiguration.Designer.cs @@ -37,6 +37,11 @@ this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.listBox1 = new System.Windows.Forms.ListBox(); this.listBox2 = new System.Windows.Forms.ListBox(); + this.userButton5 = new HslCommunication.Controls.UserButton(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); @@ -82,7 +87,7 @@ this.userButton3.CustomerInformation = ""; this.userButton3.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton3.Font = new System.Drawing.Font("微软雅黑", 9F); - this.userButton3.Location = new System.Drawing.Point(5, 392); + this.userButton3.Location = new System.Drawing.Point(3, 391); this.userButton3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.userButton3.Name = "userButton3"; this.userButton3.Size = new System.Drawing.Size(78, 25); @@ -97,7 +102,7 @@ this.userButton2.CustomerInformation = ""; this.userButton2.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton2.Font = new System.Drawing.Font("微软雅黑", 9F); - this.userButton2.Location = new System.Drawing.Point(87, 392); + this.userButton2.Location = new System.Drawing.Point(168, 427); this.userButton2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.userButton2.Name = "userButton2"; this.userButton2.Size = new System.Drawing.Size(78, 25); @@ -112,7 +117,7 @@ this.userButton1.CustomerInformation = ""; this.userButton1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton1.Font = new System.Drawing.Font("微软雅黑", 9F); - this.userButton1.Location = new System.Drawing.Point(3, 392); + this.userButton1.Location = new System.Drawing.Point(0, 427); this.userButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.userButton1.Name = "userButton1"; this.userButton1.Size = new System.Drawing.Size(78, 25); @@ -130,10 +135,12 @@ // // splitContainer1.Panel1 // + this.splitContainer1.Panel1.Controls.Add(this.textBox2); + this.splitContainer1.Panel1.Controls.Add(this.label4); + this.splitContainer1.Panel1.Controls.Add(this.textBox1); + this.splitContainer1.Panel1.Controls.Add(this.label3); this.splitContainer1.Panel1.Controls.Add(this.listBox1); this.splitContainer1.Panel1.Controls.Add(this.label1); - this.splitContainer1.Panel1.Controls.Add(this.userButton1); - this.splitContainer1.Panel1.Controls.Add(this.userButton2); // // splitContainer1.Panel2 // @@ -153,7 +160,7 @@ this.listBox1.ItemHeight = 17; this.listBox1.Location = new System.Drawing.Point(3, 23); this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(257, 361); + this.listBox1.Size = new System.Drawing.Size(257, 327); this.listBox1.TabIndex = 6; this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); // @@ -169,12 +176,70 @@ this.listBox2.Size = new System.Drawing.Size(258, 361); this.listBox2.TabIndex = 7; // + // userButton5 + // + this.userButton5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.userButton5.BackColor = System.Drawing.Color.Transparent; + this.userButton5.CustomerInformation = ""; + this.userButton5.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); + this.userButton5.Font = new System.Drawing.Font("微软雅黑", 9F); + this.userButton5.Location = new System.Drawing.Point(84, 427); + this.userButton5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.userButton5.Name = "userButton5"; + this.userButton5.Size = new System.Drawing.Size(78, 25); + this.userButton5.TabIndex = 7; + this.userButton5.UIText = "编辑"; + this.userButton5.Click += new System.EventHandler(this.userButton5_Click); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(2, 367); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(44, 17); + this.label3.TabIndex = 7; + this.label3.Text = "代码:"; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point(62, 364); + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(198, 23); + this.textBox1.TabIndex = 8; + // + // textBox2 + // + this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox2.Location = new System.Drawing.Point(62, 396); + this.textBox2.Name = "textBox2"; + this.textBox2.ReadOnly = true; + this.textBox2.Size = new System.Drawing.Size(198, 23); + this.textBox2.TabIndex = 10; + // + // label4 + // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(2, 399); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(44, 17); + this.label4.TabIndex = 9; + this.label4.Text = "描述:"; + // // RolesConfiguration // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.userButton5); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.userButton4); + this.Controls.Add(this.userButton1); + this.Controls.Add(this.userButton2); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "RolesConfiguration"; @@ -199,5 +264,10 @@ private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.ListBox listBox2; + private HslCommunication.Controls.UserButton userButton5; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label3; } } diff --git a/ClientsLibrary/Configuration/RolesConfiguration.cs b/ClientsLibrary/Configuration/RolesConfiguration.cs index 200cd0f..79ba282 100644 --- a/ClientsLibrary/Configuration/RolesConfiguration.cs +++ b/ClientsLibrary/Configuration/RolesConfiguration.cs @@ -45,6 +45,8 @@ namespace ClientsLibrary.Configuration if(listBox1.SelectedItem is RoleItem role) { listBox2.DataSource = role.Accounts; + textBox1.Text = role.RoleCode; + textBox2.Text = role.Description; } } @@ -61,33 +63,74 @@ namespace ClientsLibrary.Configuration } } - private bool CheckRoleWhetherExisting(string role) + private bool CheckRoleWhetherExisting(string roleName) { foreach(var m in listBox1.Items) { - if(m.ToString() == role) + if(m.ToString() == roleName) { return true; } } return false; } + private bool CheckRoleWhetherExisting(RoleItem role, string roleName) + { + foreach (var m in listBox1.Items) + { + if (!ReferenceEquals(m, role)) + { + if (m.ToString() == roleName) + { + return true; + } + } + } + return false; + } private void userButton1_Click(object sender, EventArgs e) { - // add a new role - using (FormGetInputString form = new FormGetInputString("请输入新的角色名称")) + using (FormInputNewRole form = new FormInputNewRole()) { + P1: if (form.ShowDialog() == DialogResult.OK) { - string role = form.InputString; - if(!CheckRoleWhetherExisting(role)) + RoleItem role = form.RoleItem; + if (CheckRoleWhetherExisting(role.RoleName)) { - // add - listBox1.Items.Add(new RoleItem() + MessageBox.Show("该角色名称已经存在,不允许添加。"); + goto P1; + } + + // add + listBox1.Items.Add(role); + } + } + } + + private void userButton5_Click(object sender, EventArgs e) + { + if (listBox1.SelectedItem is RoleItem role) + { + // edit + using (FormInputNewRole form = new FormInputNewRole()) + { + P1: + if (form.ShowDialog(role) == DialogResult.OK) + { + if (CheckRoleWhetherExisting(role, form.RoleName)) { - RoleName = role - }); + MessageBox.Show("该角色名称已经存在,不允许添加。"); + goto P1; + } + + // edit + role.RoleName = form.RoleName; + role.Description = form.RoleDescription; + + textBox1.Text = role.RoleCode; + textBox2.Text = role.Description; } } } @@ -132,5 +175,6 @@ namespace ClientsLibrary.Configuration MessageBox.Show("上传数据失败:"+result.Message); } } + } } diff --git a/ClientsLibrary/UserClient.cs b/ClientsLibrary/UserClient.cs index f05301d..1837334 100644 --- a/ClientsLibrary/UserClient.cs +++ b/ClientsLibrary/UserClient.cs @@ -36,7 +36,7 @@ namespace ClientsLibrary /// /// 本软件的当前版本,用来验证更新的关键依据 /// - public static SystemVersion CurrentVersion { get; } = new SystemVersion("1.0.0.171006"); + public static SystemVersion CurrentVersion { get; } = new SystemVersion("1.0.0.171007"); /// diff --git a/CommonLibrary/AccountSupport/RoleAssign.cs b/CommonLibrary/AccountSupport/RoleAssign.cs index 907112b..b8dd9c4 100644 --- a/CommonLibrary/AccountSupport/RoleAssign.cs +++ b/CommonLibrary/AccountSupport/RoleAssign.cs @@ -18,7 +18,9 @@ namespace CommonLibrary **********************************************************************************/ - + /// + /// 角色分配的管理器 + /// public class RoleAssign : HslCommunication.BasicFramework.SoftFileSaveBase { #region Constructor @@ -92,14 +94,49 @@ namespace CommonLibrary } + /// + /// 单个角色对象 + /// public class RoleItem { + #region Public Property + + + /// + /// 角色的唯一代码 + /// + public string RoleCode { get; set; } = Guid.NewGuid().ToString("N"); + + /// + /// 角色名称 + /// public string RoleName { get; set; } + + /// + /// 角色描述 + /// + public string Description { get; set; } + + /// + /// 关联的账户列表 + /// public List Accounts { get; set; } = new List(); + + #endregion + + #region Object Override + + /// + /// 返回对象的字符串标识形式 + /// + /// public override string ToString() { return RoleName; } + + #endregion + } } diff --git a/CommonLibrary/LocalizationSupport/ChineseLocalization.cs b/CommonLibrary/LocalizationSupport/ChineseLocalization.cs index 9a676b9..5a08d27 100644 --- a/CommonLibrary/LocalizationSupport/ChineseLocalization.cs +++ b/CommonLibrary/LocalizationSupport/ChineseLocalization.cs @@ -12,6 +12,7 @@ namespace CommonLibrary public string ButtonEnsure { get; set; } = "确认"; + #region 账户相关 public string AccountSelect { get; set; } = "选择"; @@ -19,7 +20,7 @@ namespace CommonLibrary public string AccountName { get; set; } = "用户名"; public string AccountAlias { get; set; } = "别名"; public string AccountPassword { get; set; } = "密码"; - public string AccountFactory { get; set; } = "部门"; // 可以在此处修改为部门 + public string AccountFactory { get; set; } = "分厂"; // 可以在此处修改为部门 public string AccountGrade { get; set; } = "权限"; public string AccountRegisterTime { get; set; } = "注册时间"; public string AccountLoginEnable { get; set; } = "是否允许登录"; @@ -31,6 +32,9 @@ namespace CommonLibrary public string AccountLastLoginWay { get; set; } = "上次登录方式"; public string AccountPortrait { get; set; } = "头像"; public string AccountDetails { get; set; } = "账户详细信息"; + public string AccountRegisterTitle { get; set; } = "注册一个新的账户"; + + #endregion #region 配置相关 @@ -41,6 +45,8 @@ namespace CommonLibrary public string SettingsAccountFactory { get { return "配置" + AccountFactory + "信息"; } set { } } public string SettingsTrustClient { get; set; } = "信任客户端列表"; public string SettingsRoleAssign { get; set; } = "配置角色信息"; + public string SettingsRoleAddTitle { get; set; } = "新增角色信息"; + public string SettingsRoleEditTitle { get; set; } = "编辑当前角色信息"; #endregion } diff --git a/CommonLibrary/LocalizationSupport/EnglishLocalization.cs b/CommonLibrary/LocalizationSupport/EnglishLocalization.cs index a960d75..9216d98 100644 --- a/CommonLibrary/LocalizationSupport/EnglishLocalization.cs +++ b/CommonLibrary/LocalizationSupport/EnglishLocalization.cs @@ -12,6 +12,8 @@ namespace CommonLibrary + #region 账户相关 + public string AccountSelect { get; set; } = "Select"; @@ -30,6 +32,10 @@ namespace CommonLibrary public string AccountLastLoginWay { get; set; } = "Login Last Way"; public string AccountPortrait { get; set; } = "Portrait"; public string AccountDetails { get; set; } = "Account Details"; + public string AccountRegisterTitle { get; set; } = "Register a new account"; + + + #endregion #region 配置相关 @@ -40,6 +46,9 @@ namespace CommonLibrary public string SettingsAccountFactory { get { return AccountFactory + " List"; } set { } } public string SettingsTrustClient { get; set; } = "Trust Client"; public string SettingsRoleAssign { get; set; } = "Role Assign"; + public string SettingsRoleAddTitle { get; set; } = "Role Add New"; + public string SettingsRoleEditTitle { get; set; } = "Role Edit"; + #endregion diff --git a/CommonLibrary/LocalizationSupport/Localization.cs b/CommonLibrary/LocalizationSupport/Localization.cs index 2cbba6b..9879036 100644 --- a/CommonLibrary/LocalizationSupport/Localization.cs +++ b/CommonLibrary/LocalizationSupport/Localization.cs @@ -68,7 +68,7 @@ namespace CommonLibrary string AccountLastLoginWay { get; set; } string AccountPortrait { get; set; } string AccountDetails { get; set; } - + string AccountRegisterTitle { get; set; } #endregion @@ -80,6 +80,8 @@ namespace CommonLibrary string SettingsAccountFactory { get; set; } string SettingsTrustClient { get; set; } string SettingsRoleAssign { get; set; } + string SettingsRoleAddTitle { get; set; } + string SettingsRoleEditTitle { get; set; } #endregion diff --git a/CommonLibrary/ProtocolSupport/CommonProtocol.cs b/CommonLibrary/ProtocolSupport/CommonProtocol.cs index 630bb59..1c38bbf 100644 --- a/CommonLibrary/ProtocolSupport/CommonProtocol.cs +++ b/CommonLibrary/ProtocolSupport/CommonProtocol.cs @@ -45,7 +45,7 @@ namespace CommonLibrary * **************************************************************************/ - SoftBasic.FrameworkVersion = new SystemVersion("1.6.1"); + SoftBasic.FrameworkVersion = new SystemVersion("1.6.2"); } diff --git a/Public/HslCommunication.dll b/Public/HslCommunication.dll index 4aef16d..0c950c2 100644 Binary files a/Public/HslCommunication.dll and b/Public/HslCommunication.dll differ diff --git a/软件系统客户端模版/FormMainWindow.cs b/软件系统客户端模版/FormMainWindow.cs index 9865ad8..c036a1c 100644 --- a/软件系统客户端模版/FormMainWindow.cs +++ b/软件系统客户端模版/FormMainWindow.cs @@ -495,7 +495,10 @@ namespace 软件系统客户端模版 /// private UIControls.OnlineChatRender UIControls_Chat { get; set; } - + /// + /// 主界面 + /// + private UIControls.RenderMain UIControls_Main { get; set; } @@ -541,6 +544,15 @@ namespace 软件系统客户端模版 Dock = DockStyle.Fill, }; all_main_render.Add(UIControls_Chat); + + UIControls_Main = new UIControls.RenderMain() + { + Visible = true, + Parent = panel_main,//决定了放在哪个界面显示,此处示例 + Dock = DockStyle.Fill, + }; + all_main_render.Add(UIControls_Main); + } private void SetShowRenderControl(UserControl control) diff --git a/软件系统客户端模版/UIControls/RenderMain.Designer.cs b/软件系统客户端模版/UIControls/RenderMain.Designer.cs new file mode 100644 index 0000000..a0db629 --- /dev/null +++ b/软件系统客户端模版/UIControls/RenderMain.Designer.cs @@ -0,0 +1,96 @@ +namespace 软件系统客户端模版.UIControls +{ + partial class RenderMain + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.linkLabel2 = new System.Windows.Forms.LinkLabel(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.label1.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 178); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(850, 119); + this.label1.TabIndex = 0; + this.label1.Text = "Welcome C-S Project"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // linkLabel1 + // + this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(767, 0); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(32, 17); + this.linkLabel1.TabIndex = 1; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "中文"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // linkLabel2 + // + this.linkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.linkLabel2.AutoSize = true; + this.linkLabel2.Location = new System.Drawing.Point(805, 0); + this.linkLabel2.Name = "linkLabel2"; + this.linkLabel2.Size = new System.Drawing.Size(49, 17); + this.linkLabel2.TabIndex = 2; + this.linkLabel2.TabStop = true; + this.linkLabel2.Text = "English"; + this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); + // + // RenderMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.linkLabel2); + this.Controls.Add(this.linkLabel1); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "RenderMain"; + this.Size = new System.Drawing.Size(856, 553); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.LinkLabel linkLabel2; + } +} diff --git a/软件系统客户端模版/UIControls/RenderMain.cs b/软件系统客户端模版/UIControls/RenderMain.cs new file mode 100644 index 0000000..44b6ef7 --- /dev/null +++ b/软件系统客户端模版/UIControls/RenderMain.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace 软件系统客户端模版.UIControls +{ + public partial class RenderMain : UserControl + { + public RenderMain() + { + InitializeComponent(); + } + + private void label1_Click(object sender, EventArgs e) + { + + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + // 中文 + CommonLibrary.UserLocalization.SettingLocalization("Chinese"); + } + + private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + // 英文 + CommonLibrary.UserLocalization.SettingLocalization("English"); + } + } +} diff --git a/软件系统客户端模版/UIControls/RenderMain.resx b/软件系统客户端模版/UIControls/RenderMain.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/软件系统客户端模版/UIControls/RenderMain.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/软件系统客户端模版/软件系统客户端模版.csproj b/软件系统客户端模版/软件系统客户端模版.csproj index 390c835..a80a5c7 100644 --- a/软件系统客户端模版/软件系统客户端模版.csproj +++ b/软件系统客户端模版/软件系统客户端模版.csproj @@ -77,6 +77,12 @@ OnlineChatRender.cs + + UserControl + + + RenderMain.cs + UserControl @@ -102,6 +108,9 @@ OnlineChatRender.cs + + RenderMain.cs + ShareFilesRender.cs