提交rbac

提交设置右键错位的bug
This commit is contained in:
2025-04-08 15:15:02 +08:00
parent ab38ee029a
commit 9f7c6206ca
139 changed files with 27868 additions and 117 deletions

View File

@ -0,0 +1,427 @@
namespace DH.RBAC.Page.Sys.Role
{
partial class AddRoleForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddRoleForm));
this.uiPanel1 = new Sunny.UI.UIPanel();
this.titlePanel = new System.Windows.Forms.Panel();
this.lblTitle = new Sunny.UI.UILabel();
this.btnClose = new Sunny.UI.UISymbolLabel();
this.panel1 = new System.Windows.Forms.Panel();
this.comboType = new Sunny.UI.UIComboBox();
this.txtSortCode = new Sunny.UI.UIIntegerUpDown();
this.btnConfirm = new Sunny.UI.UIButton();
this.uiLabel12 = new Sunny.UI.UILabel();
this.comboDept = new Sunny.UI.UIComboBox();
this.uiLabel11 = new Sunny.UI.UILabel();
this.txtRemark = new Sunny.UI.UITextBox();
this.uiLabel7 = new Sunny.UI.UILabel();
this.txtName = new Sunny.UI.UITextBox();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiLabel4 = new Sunny.UI.UILabel();
this.txtEnCode = new Sunny.UI.UITextBox();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiPanel1.SuspendLayout();
this.titlePanel.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.titlePanel);
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.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);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.RectColor = System.Drawing.Color.Silver;
this.uiPanel1.Size = new System.Drawing.Size(686, 530);
this.uiPanel1.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel1.StyleCustomMode = true;
this.uiPanel1.TabIndex = 6;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// titlePanel
//
this.titlePanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.titlePanel.Controls.Add(this.lblTitle);
this.titlePanel.Controls.Add(this.btnClose);
this.titlePanel.Dock = System.Windows.Forms.DockStyle.Top;
this.titlePanel.Location = new System.Drawing.Point(0, 0);
this.titlePanel.Name = "titlePanel";
this.titlePanel.Size = new System.Drawing.Size(686, 43);
this.titlePanel.TabIndex = 7;
this.titlePanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseDown);
this.titlePanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseMove);
//
// 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.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(641, 43);
this.lblTitle.Style = Sunny.UI.UIStyle.Custom;
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "新增角色";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseDown);
this.lblTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseMove);
//
// 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.Location = new System.Drawing.Point(641, 0);
this.btnClose.MinimumSize = new System.Drawing.Size(1, 1);
this.btnClose.Name = "btnClose";
this.btnClose.Padding = new System.Windows.Forms.Padding(64, 0, 0, 0);
this.btnClose.Size = new System.Drawing.Size(45, 43);
this.btnClose.Style = Sunny.UI.UIStyle.Custom;
this.btnClose.Symbol = 77;
this.btnClose.SymbolSize = 60;
this.btnClose.TabIndex = 0;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
this.btnClose.MouseEnter += new System.EventHandler(this.btnClose_MouseEnter);
this.btnClose.MouseLeave += new System.EventHandler(this.btnClose_MouseLeave);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.comboType);
this.panel1.Controls.Add(this.txtSortCode);
this.panel1.Controls.Add(this.btnConfirm);
this.panel1.Controls.Add(this.uiLabel12);
this.panel1.Controls.Add(this.comboDept);
this.panel1.Controls.Add(this.uiLabel11);
this.panel1.Controls.Add(this.txtRemark);
this.panel1.Controls.Add(this.uiLabel7);
this.panel1.Controls.Add(this.txtName);
this.panel1.Controls.Add(this.uiLabel2);
this.panel1.Controls.Add(this.uiLabel4);
this.panel1.Controls.Add(this.txtEnCode);
this.panel1.Controls.Add(this.uiLabel1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(686, 530);
this.panel1.TabIndex = 6;
//
// comboType
//
this.comboType.DataSource = null;
this.comboType.FillColor = System.Drawing.Color.White;
this.comboType.FillColor2 = System.Drawing.Color.White;
this.comboType.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.comboType.ItemHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(200)))), ((int)(((byte)(255)))));
this.comboType.ItemSelectBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.comboType.ItemSelectForeColor = System.Drawing.Color.White;
this.comboType.Location = new System.Drawing.Point(130, 133);
this.comboType.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.comboType.MinimumSize = new System.Drawing.Size(63, 0);
this.comboType.Name = "comboType";
this.comboType.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
this.comboType.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.comboType.Size = new System.Drawing.Size(188, 36);
this.comboType.StyleCustomMode = true;
this.comboType.TabIndex = 3;
this.comboType.Text = "uiComboBox1";
this.comboType.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtSortCode
//
this.txtSortCode.FillColor = System.Drawing.Color.White;
this.txtSortCode.FillColor2 = System.Drawing.Color.White;
this.txtSortCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.txtSortCode.Location = new System.Drawing.Point(129, 191);
this.txtSortCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtSortCode.MinimumSize = new System.Drawing.Size(100, 0);
this.txtSortCode.Name = "txtSortCode";
this.txtSortCode.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtSortCode.Size = new System.Drawing.Size(188, 36);
this.txtSortCode.StyleCustomMode = true;
this.txtSortCode.TabIndex = 5;
this.txtSortCode.Text = "txtSortCode";
this.txtSortCode.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnConfirm
//
this.btnConfirm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnConfirm.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnConfirm.FillColor = System.Drawing.Color.White;
this.btnConfirm.FillColor2 = System.Drawing.Color.White;
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.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)))));
this.btnConfirm.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229)))));
this.btnConfirm.Location = new System.Drawing.Point(538, 473);
this.btnConfirm.MinimumSize = new System.Drawing.Size(1, 1);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.btnConfirm.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255)))));
this.btnConfirm.Size = new System.Drawing.Size(125, 44);
this.btnConfirm.StyleCustomMode = true;
this.btnConfirm.TabIndex = 7;
this.btnConfirm.Text = "确定";
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.Location = new System.Drawing.Point(15, 197);
this.uiLabel12.Name = "uiLabel12";
this.uiLabel12.Size = new System.Drawing.Size(107, 29);
this.uiLabel12.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel12.TabIndex = 45;
this.uiLabel12.Text = "排序号";
this.uiLabel12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// comboDept
//
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.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;
this.comboDept.Location = new System.Drawing.Point(445, 133);
this.comboDept.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.comboDept.MinimumSize = new System.Drawing.Size(63, 0);
this.comboDept.Name = "comboDept";
this.comboDept.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2);
this.comboDept.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.comboDept.Size = new System.Drawing.Size(188, 36);
this.comboDept.StyleCustomMode = true;
this.comboDept.TabIndex = 4;
this.comboDept.Text = "uiComboBox1";
this.comboDept.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiLabel11
//
this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.uiLabel11.Location = new System.Drawing.Point(328, 136);
this.uiLabel11.Name = "uiLabel11";
this.uiLabel11.Size = new System.Drawing.Size(110, 29);
this.uiLabel11.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel11.TabIndex = 42;
this.uiLabel11.Text = "所属部门";
this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtRemark
//
this.txtRemark.ButtonFillColor = System.Drawing.Color.White;
this.txtRemark.ButtonFillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtRemark.ButtonFillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtRemark.ButtonForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102)))));
this.txtRemark.ButtonForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.txtRemark.ButtonForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229)))));
this.txtRemark.ButtonRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtRemark.ButtonRectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255)))));
this.txtRemark.ButtonSymbol = 61761;
this.txtRemark.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtRemark.FillColor2 = System.Drawing.Color.White;
this.txtRemark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.txtRemark.Location = new System.Drawing.Point(129, 292);
this.txtRemark.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtRemark.Maximum = 2147483647D;
this.txtRemark.MaxLength = 128;
this.txtRemark.Minimum = -2147483648D;
this.txtRemark.MinimumSize = new System.Drawing.Size(1, 16);
this.txtRemark.Multiline = true;
this.txtRemark.Name = "txtRemark";
this.txtRemark.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtRemark.Size = new System.Drawing.Size(504, 150);
this.txtRemark.StyleCustomMode = true;
this.txtRemark.TabIndex = 6;
this.txtRemark.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.txtRemark.Watermark = "请输入内容 ";
//
// uiLabel7
//
this.uiLabel7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.uiLabel7.Location = new System.Drawing.Point(12, 258);
this.uiLabel7.Name = "uiLabel7";
this.uiLabel7.Size = new System.Drawing.Size(110, 29);
this.uiLabel7.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel7.TabIndex = 35;
this.uiLabel7.Text = "备注";
this.uiLabel7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtName
//
this.txtName.ButtonFillColor = System.Drawing.Color.White;
this.txtName.ButtonFillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtName.ButtonFillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtName.ButtonForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102)))));
this.txtName.ButtonForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.txtName.ButtonForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229)))));
this.txtName.ButtonRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtName.ButtonRectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255)))));
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.Location = new System.Drawing.Point(445, 66);
this.txtName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtName.Maximum = 2147483647D;
this.txtName.MaxLength = 20;
this.txtName.Minimum = -2147483648D;
this.txtName.MinimumSize = new System.Drawing.Size(1, 16);
this.txtName.Name = "txtName";
this.txtName.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtName.Size = new System.Drawing.Size(188, 42);
this.txtName.StyleCustomMode = true;
this.txtName.TabIndex = 2;
this.txtName.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiLabel2
//
this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.uiLabel2.Location = new System.Drawing.Point(373, 73);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(65, 29);
this.uiLabel2.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel2.TabIndex = 23;
this.uiLabel2.Text = "名称";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// uiLabel4
//
this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.uiLabel4.Location = new System.Drawing.Point(57, 136);
this.uiLabel4.Name = "uiLabel4";
this.uiLabel4.Size = new System.Drawing.Size(65, 29);
this.uiLabel4.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel4.TabIndex = 25;
this.uiLabel4.Text = "类型";
this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtEnCode
//
this.txtEnCode.ButtonFillColor = System.Drawing.Color.White;
this.txtEnCode.ButtonFillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtEnCode.ButtonFillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.txtEnCode.ButtonForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102)))));
this.txtEnCode.ButtonForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.txtEnCode.ButtonForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229)))));
this.txtEnCode.ButtonRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtEnCode.ButtonRectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255)))));
this.txtEnCode.ButtonSymbol = 61761;
this.txtEnCode.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtEnCode.FillColor2 = System.Drawing.Color.White;
this.txtEnCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.txtEnCode.Location = new System.Drawing.Point(129, 66);
this.txtEnCode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtEnCode.Maximum = 2147483647D;
this.txtEnCode.MaxLength = 20;
this.txtEnCode.Minimum = -2147483648D;
this.txtEnCode.MinimumSize = new System.Drawing.Size(1, 16);
this.txtEnCode.Name = "txtEnCode";
this.txtEnCode.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.txtEnCode.Size = new System.Drawing.Size(188, 42);
this.txtEnCode.StyleCustomMode = true;
this.txtEnCode.TabIndex = 1;
this.txtEnCode.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiLabel1
//
this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.uiLabel1.Location = new System.Drawing.Point(57, 73);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(65, 29);
this.uiLabel1.Style = Sunny.UI.UIStyle.Custom;
this.uiLabel1.TabIndex = 21;
this.uiLabel1.Text = "编码";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// AddRoleForm
//
this.AllowShowTitle = false;
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(686, 530);
this.Controls.Add(this.uiPanel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AddRoleForm";
this.Padding = new System.Windows.Forms.Padding(0);
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));
this.ShowTitle = false;
this.ShowTitleIcon = true;
this.Style = Sunny.UI.UIStyle.Custom;
this.Text = "新增用户";
this.TitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));
this.TitleForeColor = System.Drawing.Color.DimGray;
this.TopMost = true;
this.Load += new System.EventHandler(this.AddRoleForm_Load);
this.uiPanel1.ResumeLayout(false);
this.titlePanel.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UIPanel uiPanel1;
private System.Windows.Forms.Panel titlePanel;
private Sunny.UI.UILabel lblTitle;
private Sunny.UI.UISymbolLabel btnClose;
private System.Windows.Forms.Panel panel1;
private Sunny.UI.UITextBox txtRemark;
private Sunny.UI.UILabel uiLabel7;
private Sunny.UI.UITextBox txtName;
private Sunny.UI.UILabel uiLabel2;
private Sunny.UI.UILabel uiLabel4;
private Sunny.UI.UITextBox txtEnCode;
private Sunny.UI.UILabel uiLabel1;
private Sunny.UI.UILabel uiLabel11;
private Sunny.UI.UIComboBox comboDept;
private Sunny.UI.UILabel uiLabel12;
private Sunny.UI.UIButton btnConfirm;
private Sunny.UI.UIIntegerUpDown txtSortCode;
private Sunny.UI.UIComboBox comboType;
}
}

View File

@ -0,0 +1,267 @@

using DH.RBAC.Common;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DH.RBAC.Logic.Sys;
using DH.RBAC.Utility.Other;
using DH.RBAC.Model.Sys;
namespace DH.RBAC.Page.Sys.Role
{
public partial class AddRoleForm : UIForm
{
private SysOrganizeLogic organizeLogic;
private SysRoleLogic roleLogic;
public AddRoleForm()
{
InitializeComponent();
organizeLogic = new SysOrganizeLogic();
roleLogic = new SysRoleLogic();
}
#region
private void btnClose_Click(object sender, EventArgs e)
{
FormHelper.subForm = null;
ParentPage.btnQuery_Click(null, null);
this.Close();
}
private Point mPoint;
private void titlePanel_MouseDown(object sender, MouseEventArgs e)
{
mPoint = new Point(e.X, e.Y);
}
private void titlePanel_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Location = new Point(this.Location.X + e.X - mPoint.X, this.Location.Y + e.Y - mPoint.Y);
}
}
private void btnClose_MouseEnter(object sender, EventArgs e)
{
btnClose.BackColor = Color.FromArgb(231, 231, 231);
}
private void btnClose_MouseLeave(object sender, EventArgs e)
{
btnClose.BackColor = Color.Transparent;
}
#endregion
public RolePage ParentPage { get; set; }
public string Id { get; set; }
/// <summary>
/// 画面加载,读取用户信息,显示在界面上
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void AddRoleForm_Load(object sender, EventArgs e)
{
comboType.Items.Add("系统角色");
comboType.Items.Add("业务角色");
comboType.Items.Add("其他角色");
comboType.SelectedIndex = 2;
if (StringHelper.IsNullOrEmpty(Id))
{
lblTitle.Text = "新增角色";
txtEnCode.Enabled = true;
}
else
{
lblTitle.Text = "修改角色";
txtEnCode.Enabled = false;
}
//获取部门下拉列表的值
bool flag = GetDepartmentCombox();
if (!flag)
{
btnClose_Click(null, null);
return;
}
if (StringHelper.IsNullOrEmpty(Id))
{
return;
}
//获得用户信息
SysRole entity = roleLogic.Get(Id);
entity.AllowEdit = entity.AllowEdit == "1" ? "true" : "false";
if (entity == null)
{
AntdUI.Message.success(this, "角色信息不存在!", autoClose: 3);
btnClose_Click(null, null);
return;
}
//给文本框赋值
txtEnCode.Text = entity.EnCode;
txtName.Text = entity.Name;
comboType.SelectedIndex = entity.Type.Value;
comboDept.SelectedValue = entity.OrganizeId;
txtSortCode.Value = entity.SortCode.Value;
txtRemark.Text = entity.Remark;
}
/// <summary>
/// 获得组织机构下拉列表
/// </summary>
/// <returns></returns>
private bool GetDepartmentCombox()
{
var data = organizeLogic.GetList();
var treeList = new List<TreeSelect>();
foreach (SysOrganize item in data)
{
TreeSelect model = new TreeSelect();
model.id = item.Id;
model.text = item.FullName;
model.parentId = item.ParentId;
treeList.Add(model);
}
List<TreeSelect> list2 = treeList.Where(it => it.parentId != "0").ToList();
comboDept.ValueMember = "id";
comboDept.DisplayMember = "text";
comboDept.DataSource = list2;
return true;
}
/// <summary>
/// 确定按钮点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnConfirm_Click(object sender, EventArgs e)
{
if (StringHelper.IsNullOrEmpty(Id))
{
DoAdd();
}
else
{
DoUpdate();
}
}
/// <summary>
/// 执行更新操作
/// </summary>
private void DoUpdate()
{
bool flag = ChechEmpty();
if (!flag)
{
return;
}
SysRole model = new SysRole();
model.Id = Id;
model.EnCode = txtEnCode.Text;
model.Name = txtName.Text;
model.Type = comboType.SelectedIndex;
model.OrganizeId = comboDept.SelectedValue.ToString();
model.SortCode = txtSortCode.Value;
model.Remark = txtRemark.Text;
model.ModifyUserId = GlobalConfig.CurrentUser.Id;
int row = roleLogic.AppUpdate(model, model.ModifyUserId);
if (row == 0)
{
AntdUI.Message.warn(this, "对不起,操作失败!", autoClose: 3);
return;
}
//ParentPage.Init();
btnClose_Click(null, null);
}
/// <summary>
/// 数据校验
/// </summary>
/// <param name="checkPassword"></param>
/// <returns></returns>
private bool ChechEmpty()
{
if (StringHelper.IsNullOrEmpty(txtEnCode.Text))
{
AntdUI.Message.success(this, "编码不能为空!", autoClose: 3);
return false;
}
if (StringHelper.IsNullOrEmpty(txtName.Text))
{
AntdUI.Message.success(this, "名称不能为空!", autoClose: 3);
return false;
}
if (StringHelper.IsNullOrEmpty(comboType.SelectedItem.ToString()))
{
AntdUI.Message.success(this, "类型不能为空!", autoClose: 3);
return false;
}
if (StringHelper.IsNullOrEmpty(comboDept.SelectedItem.ToString()))
{
AntdUI.Message.success(this, "所属部门不能为空!", autoClose: 3);
return false;
}
if (StringHelper.IsNullOrEmpty(txtSortCode.Text))
{
AntdUI.Message.success(this, "排序号不能为空!", autoClose: 3);
return false;
}
return true;
}
/// <summary>
/// 执行新增操作
/// </summary>
private void DoAdd()
{
bool flag = ChechEmpty();
if (!flag)
return;
SysRole model = new SysRole();
model.EnCode = txtEnCode.Text;
model.Name = txtName.Text;
model.Type = comboType.SelectedIndex;
model.OrganizeId = comboDept.SelectedValue.ToString();
model.SortCode = txtSortCode.Value;
model.Remark = txtRemark.Text;
model.CreateUserId = GlobalConfig.CurrentUser.Id;
int row = roleLogic.AppInsert(model, model.CreateUserId);
if (row == 0)
{
AntdUI.Message.warn(this, "对不起,操作失败!", autoClose: 3);
return;
}
//ParentPage.Init();
btnClose_Click(null, null);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,200 @@
namespace DH.RBAC.Page.Sys.Role
{
partial class RoleAuthorizeForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoleAuthorizeForm));
this.uiPanel1 = new Sunny.UI.UIPanel();
this.titlePanel = new System.Windows.Forms.Panel();
this.lblTitle = new Sunny.UI.UILabel();
this.btnClose = new Sunny.UI.UISymbolLabel();
this.panel1 = new System.Windows.Forms.Panel();
this.treeView = new Sunny.UI.UITreeView();
this.btnConfirm = new Sunny.UI.UIButton();
this.uiPanel1.SuspendLayout();
this.titlePanel.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.titlePanel);
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.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);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.RectColor = System.Drawing.Color.Silver;
this.uiPanel1.Size = new System.Drawing.Size(686, 530);
this.uiPanel1.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel1.StyleCustomMode = true;
this.uiPanel1.TabIndex = 6;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// titlePanel
//
this.titlePanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.titlePanel.Controls.Add(this.lblTitle);
this.titlePanel.Controls.Add(this.btnClose);
this.titlePanel.Dock = System.Windows.Forms.DockStyle.Top;
this.titlePanel.Location = new System.Drawing.Point(0, 0);
this.titlePanel.Name = "titlePanel";
this.titlePanel.Size = new System.Drawing.Size(686, 43);
this.titlePanel.TabIndex = 7;
this.titlePanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseDown);
this.titlePanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseMove);
//
// 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.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(641, 43);
this.lblTitle.Style = Sunny.UI.UIStyle.Custom;
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "角色授权";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseDown);
this.lblTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.titlePanel_MouseMove);
//
// 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.Location = new System.Drawing.Point(641, 0);
this.btnClose.MinimumSize = new System.Drawing.Size(1, 1);
this.btnClose.Name = "btnClose";
this.btnClose.Padding = new System.Windows.Forms.Padding(64, 0, 0, 0);
this.btnClose.Size = new System.Drawing.Size(45, 43);
this.btnClose.Style = Sunny.UI.UIStyle.Custom;
this.btnClose.Symbol = 77;
this.btnClose.SymbolSize = 60;
this.btnClose.TabIndex = 0;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
this.btnClose.MouseEnter += new System.EventHandler(this.btnClose_MouseEnter);
this.btnClose.MouseLeave += new System.EventHandler(this.btnClose_MouseLeave);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.treeView);
this.panel1.Controls.Add(this.btnConfirm);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(686, 530);
this.panel1.TabIndex = 6;
//
// treeView
//
this.treeView.CheckBoxes = true;
this.treeView.FillColor = System.Drawing.Color.White;
this.treeView.FillColor2 = System.Drawing.Color.White;
this.treeView.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.treeView.Location = new System.Drawing.Point(30, 50);
this.treeView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.treeView.MinimumSize = new System.Drawing.Size(1, 1);
this.treeView.Name = "treeView";
this.treeView.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.treeView.SelectedNode = null;
this.treeView.Size = new System.Drawing.Size(325, 466);
this.treeView.StyleCustomMode = true;
this.treeView.TabIndex = 15;
this.treeView.Text = "uiTreeView1";
this.treeView.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnConfirm
//
this.btnConfirm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnConfirm.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnConfirm.FillColor = System.Drawing.Color.White;
this.btnConfirm.FillColor2 = System.Drawing.Color.White;
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.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)))));
this.btnConfirm.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229)))));
this.btnConfirm.Location = new System.Drawing.Point(538, 473);
this.btnConfirm.MinimumSize = new System.Drawing.Size(1, 1);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227)))));
this.btnConfirm.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255)))));
this.btnConfirm.Size = new System.Drawing.Size(125, 44);
this.btnConfirm.StyleCustomMode = true;
this.btnConfirm.TabIndex = 14;
this.btnConfirm.Text = "确定";
this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
//
// RoleAuthorizeForm
//
this.AllowShowTitle = false;
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(686, 530);
this.Controls.Add(this.uiPanel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "RoleAuthorizeForm";
this.Padding = new System.Windows.Forms.Padding(0);
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));
this.ShowTitle = false;
this.ShowTitleIcon = true;
this.Style = Sunny.UI.UIStyle.Custom;
this.Text = "新增用户";
this.TitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));
this.TitleForeColor = System.Drawing.Color.DimGray;
this.TopMost = true;
this.Load += new System.EventHandler(this.AddRoleForm_Load);
this.uiPanel1.ResumeLayout(false);
this.titlePanel.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UIPanel uiPanel1;
private System.Windows.Forms.Panel titlePanel;
private Sunny.UI.UILabel lblTitle;
private Sunny.UI.UISymbolLabel btnClose;
private System.Windows.Forms.Panel panel1;
private Sunny.UI.UIButton btnConfirm;
private Sunny.UI.UITreeView treeView;
}
}

View File

@ -0,0 +1,207 @@
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DH.RBAC.Common;
using DH.RBAC.Logic.Sys;
using DH.RBAC.Model.Sys;
using DH.RBAC.Utility.Other;
namespace DH.RBAC.Page.Sys.Role
{
public partial class RoleAuthorizeForm : UIForm
{
private SysRoleAuthorizeLogic roleAuthorizeLogic;
private SysPermissionLogic permissionLogic;
public RoleAuthorizeForm()
{
InitializeComponent();
roleAuthorizeLogic = new SysRoleAuthorizeLogic();
permissionLogic = new SysPermissionLogic();
}
#region
private void btnClose_Click(object sender, EventArgs e)
{
FormHelper.subForm = null;
ParentPage.btnQuery_Click(null, null);
this.Close();
}
private Point mPoint;
private void titlePanel_MouseDown(object sender, MouseEventArgs e)
{
mPoint = new Point(e.X, e.Y);
}
private void titlePanel_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Location = new Point(this.Location.X + e.X - mPoint.X, this.Location.Y + e.Y - mPoint.Y);
}
}
private void btnClose_MouseEnter(object sender, EventArgs e)
{
btnClose.BackColor = Color.FromArgb(231, 231, 231);
}
private void btnClose_MouseLeave(object sender, EventArgs e)
{
btnClose.BackColor = Color.Transparent;
}
#endregion
public RolePage ParentPage { get; set; }
public string Id { get; set; }
/// <summary>
/// 画面加载,读取用户信息,显示在界面上
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void AddRoleForm_Load(object sender, EventArgs e)
{
try
{
List<string> listPerIds = roleAuthorizeLogic.GetList(Id).Select(c => c.ModuleId).ToList();
List<SysPermission> listAllPers;
if (new SysUserLogic().ContainsUser("admin", GlobalConfig.CurrentUser.Id))
{
listAllPers = permissionLogic.GetList();
}
else
{
listAllPers = permissionLogic.GetList(GlobalConfig.CurrentUser.Id);
}
listAllPers = HandleData(listAllPers);
List<ZTreeNode> result = new List<ZTreeNode>();
foreach (var item in listAllPers)
{
ZTreeNode model = new ZTreeNode();
model.@checked = listPerIds.Where(it => (it + "-view").StartsWith(item.Id)).Count() > 0 ? model.@checked = true : model.@checked = false;
model.id = item.Id;
model.pId = item.ParentId;
model.name = item.Name;
model.open = true;
result.Add(model);
}
List<ZTreeNode> fistNode = result.Where(it => it.pId == "0").ToList();
foreach (ZTreeNode node in fistNode)
{
TreeNode parentNode = new TreeNode(node.name);
parentNode.Tag = node.id;
parentNode.Checked = node.@checked;
//二级菜单
List<ZTreeNode> secondList = result.Where(it => it.pId == node.id).ToList();
foreach (ZTreeNode second in secondList)
{
TreeNode seconds = new TreeNode(second.name);
seconds.Checked = second.@checked;
seconds.Tag = second.id;
//三级菜单
List<ZTreeNode> thirdList = result.Where(it => it.pId == second.id).ToList();
foreach (ZTreeNode third in thirdList)
{
TreeNode thirds = new TreeNode(third.name);
thirds.Tag = third.id;
thirds.Checked = third.@checked;
seconds.Nodes.Add(thirds);
}
parentNode.Nodes.Add(seconds);
}
treeView.Nodes.Add(parentNode);
}
treeView.ExpandAll();
}
catch
{
AntdUI.Message.warn(this, "网络或服务器异常,请稍后重试!", autoClose: 3);
btnClose_Click(null, null);
}
}
private List<SysPermission> HandleData(List<SysPermission> listAllPers)
{
List<SysPermission> list = new List<SysPermission>();
List<SysPermission> firstNode = listAllPers.Where(it => it.ParentId == "0").ToList();
foreach (SysPermission permission in firstNode)
{
list.Add(permission);
List<SysPermission> secondNode = listAllPers.Where(it => it.ParentId == permission.Id).ToList();
foreach (SysPermission per in secondNode)
{
list.Add(per);
List<SysPermission> thirdNode = listAllPers.Where(it => it.ParentId == per.Id).ToList();
list.Add(new SysPermission
{
Id = per.Id + "-view",
ParentId = per.Id,
Layer = 2,
EnCode = per.EnCode,
Name = "显示",
});
foreach (SysPermission per2 in thirdNode)
{
list.Add(per2);
}
}
}
return list;
}
/// <summary>
/// 确定按钮点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnConfirm_Click(object sender, EventArgs e)
{
try
{
//获得所有的Tag
List<string> userPermissionList = new List<string>();//用于保存所有的id
foreach (TreeNode parentNode in treeView.Nodes)
{
if (parentNode.Checked)
{
userPermissionList.Add((string)parentNode.Tag);
}
//二级
foreach (TreeNode second in parentNode.Nodes)
{
if (second.Checked)
{
userPermissionList.Add((string)second.Tag);
}
//三级
foreach (TreeNode third in second.Nodes)
{
if (third.Checked)
{
userPermissionList.Add((string)third.Tag);
}
}
}
}
roleAuthorizeLogic.AppAuthorize(GlobalConfig.CurrentUser.Account, Id, userPermissionList.Select(it => it.Replace("-view", "")).Distinct().ToArray());
btnClose_Click(null, null);
}
catch
{
AntdUI.Message.warn(this, "网络或服务器异常,请稍后重试!", autoClose: 3);
return;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,437 @@
namespace DH.RBAC.Page.Sys.Role
{
partial class RolePage
{
/// <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()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
txtKeywords = new Sunny.UI.UITextBox();
panel7 = new System.Windows.Forms.Panel();
btnQuery = new Sunny.UI.UISymbolButton();
pagination = new Sunny.UI.UIPagination();
panel2 = new System.Windows.Forms.Panel();
panel5 = new System.Windows.Forms.Panel();
panel8 = new System.Windows.Forms.Panel();
dataGridView = new Sunny.UI.UIDataGridView();
RoleId = new System.Windows.Forms.DataGridViewTextBoxColumn();
RoleEncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
RoleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
RoleType = new System.Windows.Forms.DataGridViewTextBoxColumn();
RoleDept = new System.Windows.Forms.DataGridViewTextBoxColumn();
RoleSortCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
panel6 = new System.Windows.Forms.Panel();
btnPwd = new AntdUI.Button();
btnDelete = new AntdUI.Button();
btnUpdate = new AntdUI.Button();
btnAdd = new AntdUI.Button();
panel4 = new System.Windows.Forms.Panel();
panel3 = new System.Windows.Forms.Panel();
panel7.SuspendLayout();
panel2.SuspendLayout();
panel5.SuspendLayout();
panel8.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
panel6.SuspendLayout();
SuspendLayout();
//
// txtKeywords
//
txtKeywords.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
txtKeywords.ButtonFillColor = System.Drawing.Color.White;
txtKeywords.ButtonFillHoverColor = System.Drawing.Color.FromArgb(235, 243, 255);
txtKeywords.ButtonFillPressColor = System.Drawing.Color.FromArgb(235, 243, 255);
txtKeywords.ButtonForeColor = System.Drawing.Color.FromArgb(96, 98, 102);
txtKeywords.ButtonForeHoverColor = System.Drawing.Color.FromArgb(80, 160, 255);
txtKeywords.ButtonForePressColor = System.Drawing.Color.FromArgb(74, 131, 229);
txtKeywords.ButtonRectColor = System.Drawing.Color.FromArgb(216, 219, 227);
txtKeywords.ButtonRectHoverColor = System.Drawing.Color.FromArgb(197, 222, 255);
txtKeywords.ButtonStyleInherited = false;
txtKeywords.ButtonSymbol = 61761;
txtKeywords.Cursor = System.Windows.Forms.Cursors.IBeam;
txtKeywords.FillColor2 = System.Drawing.Color.White;
txtKeywords.Font = new System.Drawing.Font("微软雅黑", 12F);
txtKeywords.Location = new System.Drawing.Point(2, 8);
txtKeywords.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
txtKeywords.MinimumSize = new System.Drawing.Size(1, 10);
txtKeywords.Name = "txtKeywords";
txtKeywords.Padding = new System.Windows.Forms.Padding(3);
txtKeywords.RectColor = System.Drawing.Color.FromArgb(216, 219, 227);
txtKeywords.ShowText = false;
txtKeywords.Size = new System.Drawing.Size(195, 36);
txtKeywords.StyleCustomMode = true;
txtKeywords.TabIndex = 0;
txtKeywords.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
txtKeywords.Watermark = "角色名称或编码";
txtKeywords.KeyDown += txtKeywords_KeyDown;
//
// panel7
//
panel7.Controls.Add(btnQuery);
panel7.Controls.Add(txtKeywords);
panel7.Dock = System.Windows.Forms.DockStyle.Right;
panel7.Location = new System.Drawing.Point(578, 0);
panel7.Margin = new System.Windows.Forms.Padding(2);
panel7.Name = "panel7";
panel7.Size = new System.Drawing.Size(230, 49);
panel7.TabIndex = 3;
//
// btnQuery
//
btnQuery.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
btnQuery.Cursor = System.Windows.Forms.Cursors.Hand;
btnQuery.Font = new System.Drawing.Font("微软雅黑", 12F);
btnQuery.Location = new System.Drawing.Point(201, 8);
btnQuery.Margin = new System.Windows.Forms.Padding(2);
btnQuery.MinimumSize = new System.Drawing.Size(1, 1);
btnQuery.Name = "btnQuery";
btnQuery.Size = new System.Drawing.Size(25, 37);
btnQuery.StyleCustomMode = true;
btnQuery.Symbol = 61442;
btnQuery.SymbolSize = 30;
btnQuery.TabIndex = 2;
btnQuery.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
//
// pagination
//
pagination.ButtonFillSelectedColor = System.Drawing.Color.FromArgb(64, 128, 204);
pagination.ButtonStyleInherited = false;
pagination.Dock = System.Windows.Forms.DockStyle.Bottom;
pagination.FillColor = System.Drawing.Color.White;
pagination.FillColor2 = System.Drawing.Color.White;
pagination.Font = new System.Drawing.Font("微软雅黑", 12F);
pagination.Location = new System.Drawing.Point(0, 401);
pagination.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
pagination.MinimumSize = new System.Drawing.Size(1, 1);
pagination.Name = "pagination";
pagination.PagerCount = 5;
pagination.PageSize = 10;
pagination.RectColor = System.Drawing.Color.FromArgb(216, 219, 227);
pagination.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
pagination.ShowText = false;
pagination.Size = new System.Drawing.Size(808, 26);
pagination.StyleCustomMode = true;
pagination.TabIndex = 11;
pagination.Text = "uiPagination1";
pagination.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
pagination.PageChanged += pagination_PageChanged;
//
// panel2
//
panel2.Controls.Add(panel5);
panel2.Dock = System.Windows.Forms.DockStyle.Fill;
panel2.Location = new System.Drawing.Point(0, 0);
panel2.Margin = new System.Windows.Forms.Padding(2);
panel2.Name = "panel2";
panel2.Size = new System.Drawing.Size(844, 476);
panel2.TabIndex = 4;
//
// panel5
//
panel5.Controls.Add(panel8);
panel5.Controls.Add(panel6);
panel5.Controls.Add(panel4);
panel5.Controls.Add(panel3);
panel5.Dock = System.Windows.Forms.DockStyle.Fill;
panel5.Location = new System.Drawing.Point(0, 0);
panel5.Margin = new System.Windows.Forms.Padding(2);
panel5.Name = "panel5";
panel5.Size = new System.Drawing.Size(844, 476);
panel5.TabIndex = 7;
//
// panel8
//
panel8.Controls.Add(dataGridView);
panel8.Controls.Add(pagination);
panel8.Dock = System.Windows.Forms.DockStyle.Fill;
panel8.Location = new System.Drawing.Point(18, 49);
panel8.Margin = new System.Windows.Forms.Padding(2);
panel8.Name = "panel8";
panel8.Size = new System.Drawing.Size(808, 427);
panel8.TabIndex = 13;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.White;
dataGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridView.BackgroundColor = System.Drawing.Color.White;
dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(216, 219, 227);
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(96, 98, 102);
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(216, 219, 227);
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridView.ColumnHeadersHeight = 32;
dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { RoleId, RoleEncode, RoleName, RoleType, RoleDept, RoleSortCode });
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F);
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48);
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(155, 200, 255);
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(48, 48, 48);
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
dataGridView.DefaultCellStyle = dataGridViewCellStyle8;
dataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
dataGridView.EnableHeadersVisualStyles = false;
dataGridView.Font = new System.Drawing.Font("微软雅黑", 12F);
dataGridView.GridColor = System.Drawing.Color.FromArgb(216, 219, 227);
dataGridView.Location = new System.Drawing.Point(0, 0);
dataGridView.Margin = new System.Windows.Forms.Padding(2);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RectColor = System.Drawing.Color.FromArgb(216, 219, 227);
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 12F);
dataGridViewCellStyle9.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48);
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(216, 219, 227);
dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.White;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridViewCellStyle10.BackColor = System.Drawing.Color.White;
dataGridView.RowsDefaultCellStyle = dataGridViewCellStyle10;
dataGridView.RowTemplate.Height = 29;
dataGridView.SelectedIndex = -1;
dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new System.Drawing.Size(808, 401);
dataGridView.StripeOddColor = System.Drawing.Color.White;
dataGridView.StyleCustomMode = true;
dataGridView.TabIndex = 12;
//
// RoleId
//
RoleId.DataPropertyName = "Id";
RoleId.HeaderText = "Id";
RoleId.MinimumWidth = 6;
RoleId.Name = "RoleId";
RoleId.ReadOnly = true;
RoleId.Visible = false;
RoleId.Width = 125;
//
// RoleEncode
//
RoleEncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
RoleEncode.DataPropertyName = "Encode";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RoleEncode.DefaultCellStyle = dataGridViewCellStyle3;
RoleEncode.HeaderText = "编码";
RoleEncode.MinimumWidth = 6;
RoleEncode.Name = "RoleEncode";
RoleEncode.ReadOnly = true;
RoleEncode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
RoleEncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// RoleName
//
RoleName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
RoleName.DataPropertyName = "Name";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RoleName.DefaultCellStyle = dataGridViewCellStyle4;
RoleName.HeaderText = "名称";
RoleName.MinimumWidth = 6;
RoleName.Name = "RoleName";
RoleName.ReadOnly = true;
RoleName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
RoleName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// RoleType
//
RoleType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
RoleType.DataPropertyName = "TypeStr";
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RoleType.DefaultCellStyle = dataGridViewCellStyle5;
RoleType.HeaderText = "类型";
RoleType.MinimumWidth = 6;
RoleType.Name = "RoleType";
RoleType.ReadOnly = true;
RoleType.Resizable = System.Windows.Forms.DataGridViewTriState.True;
RoleType.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// RoleDept
//
RoleDept.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
RoleDept.DataPropertyName = "DeptName";
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RoleDept.DefaultCellStyle = dataGridViewCellStyle6;
RoleDept.HeaderText = "所属部门";
RoleDept.MinimumWidth = 6;
RoleDept.Name = "RoleDept";
RoleDept.ReadOnly = true;
RoleDept.Resizable = System.Windows.Forms.DataGridViewTriState.True;
RoleDept.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// RoleSortCode
//
RoleSortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
RoleSortCode.DataPropertyName = "SortCode";
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RoleSortCode.DefaultCellStyle = dataGridViewCellStyle7;
RoleSortCode.HeaderText = "排序码";
RoleSortCode.MinimumWidth = 6;
RoleSortCode.Name = "RoleSortCode";
RoleSortCode.ReadOnly = true;
RoleSortCode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
RoleSortCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// panel6
//
panel6.Controls.Add(btnPwd);
panel6.Controls.Add(btnDelete);
panel6.Controls.Add(btnUpdate);
panel6.Controls.Add(btnAdd);
panel6.Controls.Add(panel7);
panel6.Dock = System.Windows.Forms.DockStyle.Top;
panel6.Location = new System.Drawing.Point(18, 0);
panel6.Margin = new System.Windows.Forms.Padding(2);
panel6.Name = "panel6";
panel6.Size = new System.Drawing.Size(808, 49);
panel6.TabIndex = 12;
//
// btnPwd
//
btnPwd.Location = new System.Drawing.Point(350, 6);
btnPwd.Name = "btnPwd";
btnPwd.Size = new System.Drawing.Size(98, 38);
btnPwd.TabIndex = 11;
btnPwd.Tag = "role-authorize";
btnPwd.Text = "角色授权";
btnPwd.Visible = false;
//
// btnDelete
//
btnDelete.Location = new System.Drawing.Point(235, 6);
btnDelete.Name = "btnDelete";
btnDelete.Size = new System.Drawing.Size(98, 38);
btnDelete.TabIndex = 10;
btnDelete.Tag = "role-delete";
btnDelete.Text = "删除角色";
btnDelete.Visible = false;
//
// btnUpdate
//
btnUpdate.Location = new System.Drawing.Point(118, 6);
btnUpdate.Name = "btnUpdate";
btnUpdate.Size = new System.Drawing.Size(98, 38);
btnUpdate.TabIndex = 9;
btnUpdate.Tag = "role-edit";
btnUpdate.Text = "修改角色";
btnUpdate.Visible = false;
//
// btnAdd
//
btnAdd.Location = new System.Drawing.Point(5, 6);
btnAdd.Name = "btnAdd";
btnAdd.Size = new System.Drawing.Size(98, 38);
btnAdd.TabIndex = 8;
btnAdd.Tag = "role-add";
btnAdd.Text = "新增角色";
btnAdd.Visible = false;
//
// panel4
//
panel4.Dock = System.Windows.Forms.DockStyle.Right;
panel4.Location = new System.Drawing.Point(826, 0);
panel4.Margin = new System.Windows.Forms.Padding(2);
panel4.Name = "panel4";
panel4.Size = new System.Drawing.Size(18, 476);
panel4.TabIndex = 5;
//
// panel3
//
panel3.Dock = System.Windows.Forms.DockStyle.Left;
panel3.Location = new System.Drawing.Point(0, 0);
panel3.Margin = new System.Windows.Forms.Padding(2);
panel3.Name = "panel3";
panel3.Size = new System.Drawing.Size(18, 476);
panel3.TabIndex = 4;
//
// RolePage
//
AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
BackColor = System.Drawing.Color.FromArgb(235, 241, 243);
Controls.Add(panel2);
Margin = new System.Windows.Forms.Padding(2);
Name = "RolePage";
Size = new System.Drawing.Size(844, 476);
panel7.ResumeLayout(false);
panel2.ResumeLayout(false);
panel5.ResumeLayout(false);
panel8.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
panel6.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private Sunny.UI.UITextBox txtKeywords;
private System.Windows.Forms.Panel panel7;
private Sunny.UI.UIPagination pagination;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private Sunny.UI.UISymbolButton btnQuery;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Panel panel8;
private Sunny.UI.UIDataGridView dataGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleId;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleEncode;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleName;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleType;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleDept;
private System.Windows.Forms.DataGridViewTextBoxColumn RoleSortCode;
private AntdUI.Button btnDelete;
private AntdUI.Button btnUpdate;
private AntdUI.Button btnAdd;
private AntdUI.Button btnPwd;
}
}

View File

@ -0,0 +1,223 @@

using AntdUI;
using DH.RBAC.Common;
using DH.RBAC.Logic;
using DH.RBAC.Logic.Sys;
using DH.RBAC.Model.Sys;
using DH.RBAC.Page.Sys.User;
using DH.RBAC.Utility.Other;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DH.RBAC.Page.Sys.Role
{
[PageCode("sys-role")]
public partial class RolePage : MyPage
{
private SysRoleLogic roleLogic;
private SysUserRoleRelationLogic roleRelationLogic;
Window window;
public RolePage(Window _window)
{
window = _window;
InitializeComponent();
roleLogic = new SysRoleLogic();
roleRelationLogic = new SysUserRoleRelationLogic();
dataGridView.AutoGenerateColumns = false;
Load += RolePage_Initialize;
btnAdd.Click += btnAdd_Click;
btnUpdate.Click += btnModify_Click;
btnDelete.Click += btnDelete_Click;
btnPwd.Click += btnAuthorize_Click;
btnQuery.Click += btnQuery_Click;
}
/// <summary>
/// 界面初始化,查询显示数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RolePage_Initialize(object sender, EventArgs e)
{
btnQuery_Click(sender, e);
}
/// <summary>
/// 查询按钮事件处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void btnQuery_Click(object sender, EventArgs e)
{
int totalCount = 0;
List<SysRole> list = roleLogic.GetList(pagination.ActivePage, pagination.PageSize, txtKeywords.Text, ref totalCount);
pagination.TotalCount = totalCount;
dataGridView.DataSource = list;
}
/// <summary>
/// 关键字Enter键处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtKeywords_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
btnQuery_Click(sender, null);
}
/// <summary>
/// 新增角色按钮事件处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAdd_Click(object sender, EventArgs e)
{
AddRoleForm form = new AddRoleForm();
form.ParentPage = this;
form.Id = string.Empty;
FormHelper.ShowSubForm(form);
}
/// <summary>
/// 修改角色按钮事件处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnModify_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行修改!", autoClose: 3);
return;
}
int index = dataGridView.SelectedIndex;
if (index < 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行修改!", autoClose: 3);
return;
}
string id = dataGridView.Rows[index].Cells["RoleId"].Value.ToString();
AddRoleForm form = new AddRoleForm();
form.ParentPage = this;
form.Id = id;
FormHelper.ShowSubForm(form);
}
/// <summary>
/// 删除角色按钮事件处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDelete_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行删除!", autoClose: 3);
return;
}
int index = dataGridView.SelectedIndex;
if (index < 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行删除!", autoClose: 3);
return;
}
string id = dataGridView.Rows[index].Cells["RoleId"].Value.ToString();
var result = AntdUI.Modal.open(window, "删除警告!", "您是否确定要删除该角色?", TType.Warn);
if (result == DialogResult.OK)
{
try
{
//判断这些权限是不是被用户绑定了,一旦绑定了,就不能删除,提示请先将用户解除绑定
List<string> ids = id.SplitToList();
List<SysUserRoleRelation> roleRelationList = roleRelationLogic.GetByRoles(ids);
if (roleRelationList.Count > 0)
{
AntdUI.Message.warn(window, "请先从用户中解除角色绑定!", autoClose: 3);
return;
}
int row = roleLogic.Delete(ids);
if (row == 0)
{
AntdUI.Message.warn(window, "对不起,操作失败!", autoClose: 3);
return;
}
//重新查询
btnQuery_Click(null, null);
}
catch
{
AntdUI.Message.warn(window, "网络或服务器异常,请稍后再试!", autoClose: 3);
}
}
}
/// <summary>
/// 角色授权按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAuthorize_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行授权!", autoClose: 3);
return;
}
int index = dataGridView.SelectedIndex;
if (index < 0)
{
AntdUI.Message.warn(window, "请选择一行数据进行授权!", autoClose: 3);
return;
}
string id = dataGridView.Rows[index].Cells["RoleId"].Value.ToString();
RoleAuthorizeForm form = new RoleAuthorizeForm();
form.ParentPage = this;
form.Id = id;
FormHelper.ShowSubForm(form);
}
/// <summary>
/// 页码变更触发
/// </summary>
/// <param name="sender"></param>
/// <param name="pagingSource"></param>
/// <param name="pageIndex"></param>
/// <param name="count"></param>
private void pagination_PageChanged(object sender, object pagingSource, int pageIndex, int count)
{
btnQuery_Click(null, null);
}
private void btnUpdate_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,138 @@
<?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="RoleId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleEncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleDept.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RoleSortCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>