From 55175d62a519e8d6217c8c73d14c86fc0a6a1402 Mon Sep 17 00:00:00 2001 From: 1161220332 <1161220332@qq.com> Date: Tue, 25 Jun 2024 11:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AF=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E6=9D=83=E9=99=90=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AA=97=E5=8F=A3=E7=9A=84=E9=87=8D=E7=BD=AE=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Elight.Logic/Sys/SysPermissionLogic.cs | 2 +- Elight.Logic/Sys/SysUserLogic.cs | 24 +++++ .../Page/Sys/User/AddUserForm.Designer.cs | 89 +++++++++++++------ Elight.WinForm/Page/Sys/User/AddUserForm.cs | 19 ++++ Elight.WinForm/Page/Sys/User/AddUserForm.resx | 62 ++++++++++++- 5 files changed, 165 insertions(+), 31 deletions(-) diff --git a/Elight.Logic/Sys/SysPermissionLogic.cs b/Elight.Logic/Sys/SysPermissionLogic.cs index af4d3fa..c2fff2f 100644 --- a/Elight.Logic/Sys/SysPermissionLogic.cs +++ b/Elight.Logic/Sys/SysPermissionLogic.cs @@ -50,7 +50,7 @@ namespace Elight.Logic.Sys JoinType.Left,A.RoleId == B.RoleId, JoinType.Left,C.Id == B.ModuleId, }) - .Where((A, B, C) => A.UserId == userId && C.EnableFlag == "Y" && C.DeleteFlag == "N") + .Where((A, B, C) => A.UserId == userId && C.EnableFlag == "Y" && B.DeleteFlag == "N") .Select((A, B, C) => C.Id).ToList(); return db.Queryable().Where(it => permissionIdList.Contains(it.Id)).OrderBy(it => it.SortCode).ToList(); } diff --git a/Elight.Logic/Sys/SysUserLogic.cs b/Elight.Logic/Sys/SysUserLogic.cs index ccfe19c..3a8aef1 100644 --- a/Elight.Logic/Sys/SysUserLogic.cs +++ b/Elight.Logic/Sys/SysUserLogic.cs @@ -12,6 +12,8 @@ using Elight.Utility.Extension; using Elight.Utility.Core; using Elight.Utility.Other; using System.Drawing.Printing; +using System.Security.Principal; +using System.Web.Security; namespace Elight.Logic.Sys { @@ -506,5 +508,27 @@ namespace Elight.Logic.Sys } } } + + public int AppUpdatePassword(SysUser model, string account) + { + using (var db = GetInstance()) + { + try + { + model.ModifyUserId = account; + model.ModifyTime = DateTime.Now; + return db.Updateable(model).UpdateColumns(it => new + { + it.password, + it.ModifyUserId, + it.ModifyTime + }).ExecuteCommand(); + } + catch + { + return 0; + } + } + } } } diff --git a/Elight.WinForm/Page/Sys/User/AddUserForm.Designer.cs b/Elight.WinForm/Page/Sys/User/AddUserForm.Designer.cs index 55983f1..220a1d9 100644 --- a/Elight.WinForm/Page/Sys/User/AddUserForm.Designer.cs +++ b/Elight.WinForm/Page/Sys/User/AddUserForm.Designer.cs @@ -60,6 +60,7 @@ this.uiLabel4 = new Sunny.UI.UILabel(); this.txtAccount = new Sunny.UI.UITextBox(); this.uiLabel1 = new Sunny.UI.UILabel(); + this.uiBtRestPassword = new Sunny.UI.UIButton(); this.uiPanel1.SuspendLayout(); this.titlePanel.SuspendLayout(); this.panel1.SuspendLayout(); @@ -71,7 +72,7 @@ this.uiPanel1.Controls.Add(this.panel1); this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.uiPanel1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(241)))), ((int)(((byte)(243))))); - this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiPanel1.Location = new System.Drawing.Point(0, 0); this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1); @@ -100,7 +101,7 @@ // lblTitle // this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 12F); this.lblTitle.Location = new System.Drawing.Point(0, 0); this.lblTitle.Name = "lblTitle"; this.lblTitle.Size = new System.Drawing.Size(986, 43); @@ -114,7 +115,7 @@ // btnClose // this.btnClose.Dock = System.Windows.Forms.DockStyle.Right; - this.btnClose.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnClose.Font = new System.Drawing.Font("微软雅黑", 12F); this.btnClose.Location = new System.Drawing.Point(986, 0); this.btnClose.MinimumSize = new System.Drawing.Size(1, 1); this.btnClose.Name = "btnClose"; @@ -131,6 +132,7 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.uiBtRestPassword); this.panel1.Controls.Add(this.uiIntegerUpDown1); this.panel1.Controls.Add(this.btnConfirm); this.panel1.Controls.Add(this.uiLabel12); @@ -167,7 +169,7 @@ // this.uiIntegerUpDown1.FillColor = System.Drawing.Color.White; this.uiIntegerUpDown1.FillColor2 = System.Drawing.Color.White; - this.uiIntegerUpDown1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiIntegerUpDown1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiIntegerUpDown1.Location = new System.Drawing.Point(445, 247); this.uiIntegerUpDown1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiIntegerUpDown1.MinimumSize = new System.Drawing.Size(100, 0); @@ -189,7 +191,7 @@ this.btnConfirm.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); this.btnConfirm.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); this.btnConfirm.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); - this.btnConfirm.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnConfirm.Font = new System.Drawing.Font("微软雅黑", 12F); this.btnConfirm.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102))))); this.btnConfirm.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); this.btnConfirm.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); @@ -204,11 +206,12 @@ this.btnConfirm.StyleCustomMode = true; this.btnConfirm.TabIndex = 14; this.btnConfirm.Text = "确定"; + this.btnConfirm.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click); // // uiLabel12 // - this.uiLabel12.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel12.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel12.Location = new System.Drawing.Point(331, 253); this.uiLabel12.Name = "uiLabel12"; this.uiLabel12.Size = new System.Drawing.Size(107, 29); @@ -221,7 +224,7 @@ // this.uiTransfer1.FillColor = System.Drawing.Color.White; this.uiTransfer1.FillColor2 = System.Drawing.Color.White; - this.uiTransfer1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiTransfer1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiTransfer1.Location = new System.Drawing.Point(129, 302); this.uiTransfer1.Margin = new System.Windows.Forms.Padding(7, 9, 7, 9); this.uiTransfer1.MinimumSize = new System.Drawing.Size(1, 1); @@ -242,7 +245,7 @@ this.comboDept.DataSource = null; this.comboDept.FillColor = System.Drawing.Color.White; this.comboDept.FillColor2 = System.Drawing.Color.White; - this.comboDept.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.comboDept.Font = new System.Drawing.Font("微软雅黑", 12F); this.comboDept.ItemHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(200)))), ((int)(((byte)(255))))); this.comboDept.ItemSelectBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227))))); this.comboDept.ItemSelectForeColor = System.Drawing.Color.White; @@ -261,7 +264,7 @@ // // uiLabel11 // - this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel11.Location = new System.Drawing.Point(328, 193); this.uiLabel11.Name = "uiLabel11"; this.uiLabel11.Size = new System.Drawing.Size(110, 29); @@ -283,7 +286,7 @@ this.txtPassword.ButtonSymbol = 61761; this.txtPassword.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtPassword.FillColor2 = System.Drawing.Color.White; - this.txtPassword.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtPassword.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtPassword.Location = new System.Drawing.Point(782, 67); this.txtPassword.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtPassword.Maximum = 2147483647D; @@ -301,7 +304,7 @@ // // uiLabel10 // - this.uiLabel10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel10.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel10.Location = new System.Drawing.Point(665, 73); this.uiLabel10.Name = "uiLabel10"; this.uiLabel10.Size = new System.Drawing.Size(110, 29); @@ -314,7 +317,7 @@ // this.txtBirthday.FillColor = System.Drawing.Color.White; this.txtBirthday.FillColor2 = System.Drawing.Color.White; - this.txtBirthday.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtBirthday.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtBirthday.Location = new System.Drawing.Point(445, 129); this.txtBirthday.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtBirthday.MaxLength = 10; @@ -334,7 +337,7 @@ // // uiLabel9 // - this.uiLabel9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel9.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel9.Location = new System.Drawing.Point(15, 307); this.uiLabel9.Name = "uiLabel9"; this.uiLabel9.Size = new System.Drawing.Size(107, 29); @@ -356,7 +359,7 @@ this.txtAddress.ButtonSymbol = 61761; this.txtAddress.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtAddress.FillColor2 = System.Drawing.Color.White; - this.txtAddress.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtAddress.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtAddress.Location = new System.Drawing.Point(129, 252); this.txtAddress.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtAddress.Maximum = 2147483647D; @@ -373,7 +376,7 @@ // // uiLabel7 // - this.uiLabel7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel7.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel7.Location = new System.Drawing.Point(12, 258); this.uiLabel7.Name = "uiLabel7"; this.uiLabel7.Size = new System.Drawing.Size(110, 29); @@ -395,7 +398,7 @@ this.txtTel.ButtonSymbol = 61761; this.txtTel.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtTel.FillColor2 = System.Drawing.Color.White; - this.txtTel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtTel.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtTel.Location = new System.Drawing.Point(782, 187); this.txtTel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtTel.Maximum = 2147483647D; @@ -412,7 +415,7 @@ // // uiLabel8 // - this.uiLabel8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel8.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel8.Location = new System.Drawing.Point(668, 193); this.uiLabel8.Name = "uiLabel8"; this.uiLabel8.Size = new System.Drawing.Size(107, 29); @@ -434,7 +437,7 @@ this.txtEmail.ButtonSymbol = 61761; this.txtEmail.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtEmail.FillColor2 = System.Drawing.Color.White; - this.txtEmail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtEmail.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtEmail.Location = new System.Drawing.Point(129, 192); this.txtEmail.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtEmail.Maximum = 2147483647D; @@ -451,7 +454,7 @@ // // uiLabel5 // - this.uiLabel5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel5.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel5.Location = new System.Drawing.Point(57, 199); this.uiLabel5.Name = "uiLabel5"; this.uiLabel5.Size = new System.Drawing.Size(65, 29); @@ -462,7 +465,7 @@ // // uiLabel6 // - this.uiLabel6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel6.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel6.Location = new System.Drawing.Point(331, 133); this.uiLabel6.Name = "uiLabel6"; this.uiLabel6.Size = new System.Drawing.Size(107, 29); @@ -474,7 +477,7 @@ // rdFemale // this.rdFemale.Cursor = System.Windows.Forms.Cursors.Hand; - this.rdFemale.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.rdFemale.Font = new System.Drawing.Font("微软雅黑", 12F); this.rdFemale.Location = new System.Drawing.Point(854, 126); this.rdFemale.MinimumSize = new System.Drawing.Size(1, 1); this.rdFemale.Name = "rdFemale"; @@ -488,7 +491,7 @@ // this.rdMale.Checked = true; this.rdMale.Cursor = System.Windows.Forms.Cursors.Hand; - this.rdMale.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.rdMale.Font = new System.Drawing.Font("微软雅黑", 12F); this.rdMale.Location = new System.Drawing.Point(786, 126); this.rdMale.MinimumSize = new System.Drawing.Size(1, 1); this.rdMale.Name = "rdMale"; @@ -511,7 +514,7 @@ this.txtNickName.ButtonSymbol = 61761; this.txtNickName.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtNickName.FillColor2 = System.Drawing.Color.White; - this.txtNickName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtNickName.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtNickName.Location = new System.Drawing.Point(445, 66); this.txtNickName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtNickName.Maximum = 2147483647D; @@ -528,7 +531,7 @@ // // uiLabel3 // - this.uiLabel3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel3.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel3.Location = new System.Drawing.Point(710, 129); this.uiLabel3.Name = "uiLabel3"; this.uiLabel3.Size = new System.Drawing.Size(65, 29); @@ -539,7 +542,7 @@ // // uiLabel2 // - this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel2.Location = new System.Drawing.Point(373, 73); this.uiLabel2.Name = "uiLabel2"; this.uiLabel2.Size = new System.Drawing.Size(65, 29); @@ -561,7 +564,7 @@ this.txtName.ButtonSymbol = 61761; this.txtName.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtName.FillColor2 = System.Drawing.Color.White; - this.txtName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtName.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtName.Location = new System.Drawing.Point(129, 129); this.txtName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtName.Maximum = 2147483647D; @@ -578,7 +581,7 @@ // // uiLabel4 // - this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel4.Location = new System.Drawing.Point(57, 136); this.uiLabel4.Name = "uiLabel4"; this.uiLabel4.Size = new System.Drawing.Size(65, 29); @@ -600,7 +603,7 @@ this.txtAccount.ButtonSymbol = 61761; this.txtAccount.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtAccount.FillColor2 = System.Drawing.Color.White; - this.txtAccount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtAccount.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtAccount.Location = new System.Drawing.Point(129, 66); this.txtAccount.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txtAccount.Maximum = 2147483647D; @@ -617,7 +620,7 @@ // // uiLabel1 // - this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel1.Location = new System.Drawing.Point(57, 73); this.uiLabel1.Name = "uiLabel1"; this.uiLabel1.Size = new System.Drawing.Size(65, 29); @@ -626,6 +629,33 @@ this.uiLabel1.Text = "账号"; this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // uiBtRestPassword + // + this.uiBtRestPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.uiBtRestPassword.Cursor = System.Windows.Forms.Cursors.Hand; + this.uiBtRestPassword.FillColor = System.Drawing.Color.White; + this.uiBtRestPassword.FillColor2 = System.Drawing.Color.White; + this.uiBtRestPassword.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); + this.uiBtRestPassword.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); + this.uiBtRestPassword.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); + this.uiBtRestPassword.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiBtRestPassword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102))))); + this.uiBtRestPassword.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + this.uiBtRestPassword.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); + this.uiBtRestPassword.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); + this.uiBtRestPassword.Location = new System.Drawing.Point(718, 502); + this.uiBtRestPassword.MinimumSize = new System.Drawing.Size(1, 1); + this.uiBtRestPassword.Name = "uiBtRestPassword"; + this.uiBtRestPassword.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227))))); + this.uiBtRestPassword.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255))))); + this.uiBtRestPassword.Size = new System.Drawing.Size(125, 44); + this.uiBtRestPassword.Style = Sunny.UI.UIStyle.White; + this.uiBtRestPassword.StyleCustomMode = true; + this.uiBtRestPassword.TabIndex = 46; + this.uiBtRestPassword.Text = "重置密码"; + this.uiBtRestPassword.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiBtRestPassword.Click += new System.EventHandler(this.uiBtRestPassword_Click); + // // AddUserForm // this.AllowShowTitle = false; @@ -687,5 +717,6 @@ private Sunny.UI.UILabel uiLabel12; private Sunny.UI.UIButton btnConfirm; private Sunny.UI.UIIntegerUpDown uiIntegerUpDown1; + private Sunny.UI.UIButton uiBtRestPassword; } } \ No newline at end of file diff --git a/Elight.WinForm/Page/Sys/User/AddUserForm.cs b/Elight.WinForm/Page/Sys/User/AddUserForm.cs index bc6610f..771549a 100644 --- a/Elight.WinForm/Page/Sys/User/AddUserForm.cs +++ b/Elight.WinForm/Page/Sys/User/AddUserForm.cs @@ -428,5 +428,24 @@ namespace Elight.WinForm.Page.Sys.User btnClose_Click(null, null); } + + private void uiBtRestPassword_Click(object sender, EventArgs e) + { + if (StringHelper.IsNullOrEmpty(Id)) return; + DoResetPassword(); + } + + private void DoResetPassword() + { + SysUser model = new SysUser(); + model.Id = Id; + model.password = "123456"; + + //更新用户密码信息。 + int row = userLogic.AppUpdatePassword(model, GlobalConfig.CurrentUser.Id); + if (row == 1) { + this.ShowInfoDialog("用户重置密码成功,默认密码为123456", UIStyle.White); + } + } } } diff --git a/Elight.WinForm/Page/Sys/User/AddUserForm.resx b/Elight.WinForm/Page/Sys/User/AddUserForm.resx index 01360ee..6ea560f 100644 --- a/Elight.WinForm/Page/Sys/User/AddUserForm.resx +++ b/Elight.WinForm/Page/Sys/User/AddUserForm.resx @@ -1,4 +1,64 @@ - + + + -- Gitee