角色维护

Beta
凯 王 2021-05-08 16:42:38 +08:00
parent 52107e0dca
commit 6e40df96b3
8 changed files with 600 additions and 1117 deletions

View File

@ -299,5 +299,6 @@ namespace WinformGeneralDeveloperFrame.Commons
}
return model;
}
}
}

View File

@ -1,230 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WinformGeneralDeveloperFrame;
using WinformGeneralDeveloperFrame.Commons;
using DevExpress.XtraLayout;
using System.Data.Entity.Migrations;
using System.Data.Entity;
using MES;
using MES.Entity;
namespace test.Form
{
public partial class FrmsysMenu : FrmBaseForm
{
private Dictionary<string, string> fieldDictionary = new Dictionary<string, string>();
public FrmsysMenu()
{
InitializeComponent();
}
private void FrmsysMenu_Load(object sender, EventArgs e)
{
InitFrom(xtraTabControl1,grdList,grdListView,new LayoutControlGroup[]{layoutControlGroup1},new sysMenuInfo());
InitSearchDicData();
}
/// <summary>
/// 数据源初始化
/// </summary>
/// <returns></returns>
private void Init()
{
repositoryItemtxttoolList.DataSource= GetDataTableUtils.SqlTable("功能按钮");
txttoolList.Properties.DataSource = GetDataTableUtils.SqlTable("功能按钮");
}
/// <summary>
/// 搜索字段
/// </summary>
/// <returns></returns>
private void InitSearchDicData()
{
fieldDictionary.Add("ID","id");
fieldDictionary.Add("父id","pid");
fieldDictionary.Add("菜单名称","name");
fieldDictionary.Add("图标","icon");
fieldDictionary.Add("菜单类型","winformType");
fieldDictionary.Add("排序","sort");
fieldDictionary.Add("有效","isEnabled");
fieldDictionary.Add("功能按钮","toolList");
fieldDictionary.Add("创建人","creatorId");
fieldDictionary.Add("创建时间","createTime");
fieldDictionary.Add("编辑人","editorId");
fieldDictionary.Add("编辑时间","editTime");
fieldDictionary.Add("是否界面","isForm");
fieldDictionary.Add("是否功能按钮","isToolBtn");
}
/// <summary>
/// 保存
/// </summary>
/// <returns></returns>
public override bool SaveFunction()
{
try
{
sysMenuInfo info= (sysMenuInfo)this.ControlDataToModel(new sysMenuInfo());
using (var db = new MESDB())
{
db.sysMenuInfo.AddOrUpdate(info);
db.SaveChanges();
}
}
catch (Exception ex)
{
ex.Message.ShowError();
return false;
}
return true;
}
public override void InitgrdListDataSource()
{
using (var con=new MESDB())///
{
grdList.DataSource=con.sysMenuInfo.ToList();
}
Init();
}
/// <summary>
/// 字段为空校验
/// </summary>
/// <returns></returns>
public override bool CheckInput()
{
if(string.IsNullOrEmpty(txtpid.EditValue.ToString()))
{
"父id不能为空".ShowWarning();
txtpid.Focus();
return false;
}
if(string.IsNullOrEmpty(txtname.EditValue.ToString()))
{
"菜单名称不能为空".ShowWarning();
txtname.Focus();
return false;
}
if(string.IsNullOrEmpty(txticon.EditValue.ToString()))
{
"图标不能为空".ShowWarning();
txticon.Focus();
return false;
}
if(string.IsNullOrEmpty(txtwinformType.EditValue.ToString()))
{
"菜单类型不能为空".ShowWarning();
txtwinformType.Focus();
return false;
}
if(string.IsNullOrEmpty(txtsort.EditValue.ToString()))
{
"排序不能为空".ShowWarning();
txtsort.Focus();
return false;
}
if(string.IsNullOrEmpty(txtisEnabled.EditValue.ToString()))
{
"有效不能为空".ShowWarning();
txtisEnabled.Focus();
return false;
}
if(string.IsNullOrEmpty(txttoolList.EditValue.ToString()))
{
"功能按钮不能为空".ShowWarning();
txttoolList.Focus();
return false;
}
if(string.IsNullOrEmpty(txtcreatorId.EditValue.ToString()))
{
"创建人不能为空".ShowWarning();
txtcreatorId.Focus();
return false;
}
if(string.IsNullOrEmpty(txtcreateTime.EditValue.ToString()))
{
"创建时间不能为空".ShowWarning();
txtcreateTime.Focus();
return false;
}
if(string.IsNullOrEmpty(txteditorId.EditValue.ToString()))
{
"编辑人不能为空".ShowWarning();
txteditorId.Focus();
return false;
}
if(string.IsNullOrEmpty(txteditTime.EditValue.ToString()))
{
"编辑时间不能为空".ShowWarning();
txteditTime.Focus();
return false;
}
if(string.IsNullOrEmpty(txtisForm.EditValue.ToString()))
{
"是否界面不能为空".ShowWarning();
txtisForm.Focus();
return false;
}
if(string.IsNullOrEmpty(txtisToolBtn.EditValue.ToString()))
{
"是否功能按钮不能为空".ShowWarning();
txtisToolBtn.Focus();
return false;
}
return true;
}
/// <summary>
/// 删除
/// </summary>
/// <returns></returns>
public override bool DelFunction()
{
try
{
sysMenuInfo info = (sysMenuInfo)this.ControlDataToModel(new sysMenuInfo());
using (var db = new MESDB())
{
db.Entry(info).State=EntityState.Deleted;
db.SaveChanges();
}
}
catch (Exception ex)
{
ex.Message.ShowError();
return false;
}
return true;
}
/// <summary>
/// 搜索
/// </summary>
/// <returns></returns>
public override void SearchFunction()
{
FrmSearch frm = new FrmSearch(fieldDictionary);
if (frm.ShowDialog()==DialogResult.OK)
{
string sql = frm.sql;
using (var db = new MESDB())
{
if (string.IsNullOrEmpty(sql))
{
grdList.DataSource = db.sysMenuInfo.SqlQuery("select * from sysMenu").ToList();
}
else
{
grdList.DataSource = db.sysMenuInfo.SqlQuery($"select * from sysMenu where {sql}").ToList();
}
}
}
}
}
}

View File

@ -1,810 +0,0 @@
using DevExpress.XtraEditors;
using DevExpress.XtraLayout;
using DevExpress.XtraTab;
namespace test.Form
{
partial class FrmsysMenu
{
/// <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()
{
this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn14 = new DevExpress.XtraGrid.Columns.GridColumn();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.tabDataList = new DevExpress.XtraTab.XtraTabPage();
this.tabDataDetail = new DevExpress.XtraTab.XtraTabPage();
this.grdList = new DevExpress.XtraGrid.GridControl();
this.grdListView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
//////////////////////
this.txtid=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtpid=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtname=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txticon=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtwinformType=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtsort=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtisEnabled=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
this.repositoryItemtxttoolList = new DevExpress.XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit();
this.txttoolList=new DevExpress.XtraEditors.CheckedComboBoxEdit();
this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtcreatorId=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtcreateTime=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txteditorId=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txteditTime=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtisForm=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
//////////////////////
this.txtisToolBtn=new DevExpress.XtraEditors.TextEdit();
this.layoutControlItem14 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
this.layoutControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtid.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtpid.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtname.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txticon.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtwinformType.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtsort.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisEnabled.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemtxttoolList)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txttoolList.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtcreatorId.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtcreateTime.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txteditorId.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txteditTime.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisForm.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisToolBtn.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.tabDataList.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grdList)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.grdListView)).BeginInit();
this.tabDataDetail.SuspendLayout();
this.SuspendLayout();
// layoutControl1
//
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl1.Location = new System.Drawing.Point(12, 8);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.layoutControlGroup1;
layoutControl1.AutoScroll=true;
this.layoutControl1.Size = new System.Drawing.Size(605, 363);
this.layoutControl1.TabIndex = 6;
this.layoutControl1.Text = "layoutControl1";
this.layoutControl1.Controls.Add(this.txtid);
this.layoutControl1.Controls.Add(this.txtpid);
this.layoutControl1.Controls.Add(this.txtname);
this.layoutControl1.Controls.Add(this.txticon);
this.layoutControl1.Controls.Add(this.txtwinformType);
this.layoutControl1.Controls.Add(this.txtsort);
this.layoutControl1.Controls.Add(this.txtisEnabled);
this.layoutControl1.Controls.Add(this.txttoolList);
this.layoutControl1.Controls.Add(this.txtcreatorId);
this.layoutControl1.Controls.Add(this.txtcreateTime);
this.layoutControl1.Controls.Add(this.txteditorId);
this.layoutControl1.Controls.Add(this.txteditTime);
this.layoutControl1.Controls.Add(this.txtisForm);
this.layoutControl1.Controls.Add(this.txtisToolBtn);
//TextEdit
//DateEdit
//SimpleButton
//CheckEdit
//MemoEdit
//PictureEdit
//LookUpEdit
//ComboBoxEdit
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtid.Location = new System.Drawing.Point(112, 12);
this.txtid.Name = "txtid";
this.txtid.Size = new System.Drawing.Size(481, 20);
this.txtid.StyleController = this.layoutControl1;
this.txtid.TabIndex = 1;
//
// layoutControlItem1
//
this.layoutControlItem1.Control = this.txtid;
this.layoutControlItem1.CustomizationFormText = "ID";
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem1.Text = "ID";
this.layoutControlItem1.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtpid.Location = new System.Drawing.Point(112, 36);
this.txtpid.Name = "txtpid";
this.txtpid.Size = new System.Drawing.Size(481, 20);
this.txtpid.StyleController = this.layoutControl1;
this.txtpid.TabIndex = 2;
//
// layoutControlItem2
//
this.layoutControlItem2.Control = this.txtpid;
this.layoutControlItem2.CustomizationFormText = "父id";
this.layoutControlItem2.Location = new System.Drawing.Point(0, 24);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem2.Text = "父id";
this.layoutControlItem2.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtname.Location = new System.Drawing.Point(112, 60);
this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(481, 20);
this.txtname.StyleController = this.layoutControl1;
this.txtname.TabIndex = 3;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.txtname;
this.layoutControlItem3.CustomizationFormText = "菜单名称";
this.layoutControlItem3.Location = new System.Drawing.Point(0, 48);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem3.Text = "菜单名称";
this.layoutControlItem3.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txticon.Location = new System.Drawing.Point(112, 84);
this.txticon.Name = "txticon";
this.txticon.Size = new System.Drawing.Size(481, 20);
this.txticon.StyleController = this.layoutControl1;
this.txticon.TabIndex = 4;
//
// layoutControlItem4
//
this.layoutControlItem4.Control = this.txticon;
this.layoutControlItem4.CustomizationFormText = "图标";
this.layoutControlItem4.Location = new System.Drawing.Point(0, 72);
this.layoutControlItem4.Name = "layoutControlItem4";
this.layoutControlItem4.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem4.Text = "图标";
this.layoutControlItem4.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtwinformType.Location = new System.Drawing.Point(112, 108);
this.txtwinformType.Name = "txtwinformType";
this.txtwinformType.Size = new System.Drawing.Size(481, 20);
this.txtwinformType.StyleController = this.layoutControl1;
this.txtwinformType.TabIndex = 5;
//
// layoutControlItem5
//
this.layoutControlItem5.Control = this.txtwinformType;
this.layoutControlItem5.CustomizationFormText = "菜单类型";
this.layoutControlItem5.Location = new System.Drawing.Point(0, 96);
this.layoutControlItem5.Name = "layoutControlItem5";
this.layoutControlItem5.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem5.Text = "菜单类型";
this.layoutControlItem5.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtsort.Location = new System.Drawing.Point(112, 132);
this.txtsort.Name = "txtsort";
this.txtsort.Size = new System.Drawing.Size(481, 20);
this.txtsort.StyleController = this.layoutControl1;
this.txtsort.TabIndex = 6;
//
// layoutControlItem6
//
this.layoutControlItem6.Control = this.txtsort;
this.layoutControlItem6.CustomizationFormText = "排序";
this.layoutControlItem6.Location = new System.Drawing.Point(0, 120);
this.layoutControlItem6.Name = "layoutControlItem6";
this.layoutControlItem6.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem6.Text = "排序";
this.layoutControlItem6.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtisEnabled.Location = new System.Drawing.Point(112, 156);
this.txtisEnabled.Name = "txtisEnabled";
this.txtisEnabled.Size = new System.Drawing.Size(481, 20);
this.txtisEnabled.StyleController = this.layoutControl1;
this.txtisEnabled.TabIndex = 7;
//
// layoutControlItem7
//
this.layoutControlItem7.Control = this.txtisEnabled;
this.layoutControlItem7.CustomizationFormText = "有效";
this.layoutControlItem7.Location = new System.Drawing.Point(0, 144);
this.layoutControlItem7.Name = "layoutControlItem7";
this.layoutControlItem7.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem7.Text = "有效";
this.layoutControlItem7.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txttoolList.Location = new System.Drawing.Point(112, 180);
this.txttoolList.Name = "txttoolList";
this.txttoolList.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.txttoolList.Properties.DisplayMember = "Name";
this.txttoolList.Properties.ValueMember = "ID";
this.txttoolList.Size = new System.Drawing.Size(932, 20);
this.txttoolList.StyleController = this.layoutControl1;
this.txttoolList.TabIndex = 8;
//
// layoutControlItem8
//
this.layoutControlItem8.Control = this.txttoolList;
this.layoutControlItem8.CustomizationFormText = "功能按钮";
this.layoutControlItem8.Location = new System.Drawing.Point(0, 168);
this.layoutControlItem8.Name = "layoutControlItem8";
this.layoutControlItem8.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem8.Text = "功能按钮";
this.layoutControlItem8.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtcreatorId.Location = new System.Drawing.Point(112, 204);
this.txtcreatorId.Name = "txtcreatorId";
this.txtcreatorId.Size = new System.Drawing.Size(481, 20);
this.txtcreatorId.StyleController = this.layoutControl1;
this.txtcreatorId.TabIndex = 9;
//
// layoutControlItem9
//
this.layoutControlItem9.Control = this.txtcreatorId;
this.layoutControlItem9.CustomizationFormText = "创建人";
this.layoutControlItem9.Location = new System.Drawing.Point(0, 192);
this.layoutControlItem9.Name = "layoutControlItem9";
this.layoutControlItem9.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem9.Text = "创建人";
this.layoutControlItem9.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtcreateTime.Location = new System.Drawing.Point(112, 228);
this.txtcreateTime.Name = "txtcreateTime";
this.txtcreateTime.Size = new System.Drawing.Size(481, 20);
this.txtcreateTime.StyleController = this.layoutControl1;
this.txtcreateTime.TabIndex = 10;
//
// layoutControlItem10
//
this.layoutControlItem10.Control = this.txtcreateTime;
this.layoutControlItem10.CustomizationFormText = "创建时间";
this.layoutControlItem10.Location = new System.Drawing.Point(0, 216);
this.layoutControlItem10.Name = "layoutControlItem10";
this.layoutControlItem10.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem10.Text = "创建时间";
this.layoutControlItem10.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txteditorId.Location = new System.Drawing.Point(112, 252);
this.txteditorId.Name = "txteditorId";
this.txteditorId.Size = new System.Drawing.Size(481, 20);
this.txteditorId.StyleController = this.layoutControl1;
this.txteditorId.TabIndex = 11;
//
// layoutControlItem11
//
this.layoutControlItem11.Control = this.txteditorId;
this.layoutControlItem11.CustomizationFormText = "编辑人";
this.layoutControlItem11.Location = new System.Drawing.Point(0, 240);
this.layoutControlItem11.Name = "layoutControlItem11";
this.layoutControlItem11.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem11.Text = "编辑人";
this.layoutControlItem11.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txteditTime.Location = new System.Drawing.Point(112, 276);
this.txteditTime.Name = "txteditTime";
this.txteditTime.Size = new System.Drawing.Size(481, 20);
this.txteditTime.StyleController = this.layoutControl1;
this.txteditTime.TabIndex = 12;
//
// layoutControlItem12
//
this.layoutControlItem12.Control = this.txteditTime;
this.layoutControlItem12.CustomizationFormText = "编辑时间";
this.layoutControlItem12.Location = new System.Drawing.Point(0, 264);
this.layoutControlItem12.Name = "layoutControlItem12";
this.layoutControlItem12.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem12.Text = "编辑时间";
this.layoutControlItem12.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtisForm.Location = new System.Drawing.Point(112, 300);
this.txtisForm.Name = "txtisForm";
this.txtisForm.Size = new System.Drawing.Size(481, 20);
this.txtisForm.StyleController = this.layoutControl1;
this.txtisForm.TabIndex = 13;
//
// layoutControlItem13
//
this.layoutControlItem13.Control = this.txtisForm;
this.layoutControlItem13.CustomizationFormText = "是否界面";
this.layoutControlItem13.Location = new System.Drawing.Point(0, 288);
this.layoutControlItem13.Name = "layoutControlItem13";
this.layoutControlItem13.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem13.Text = "是否界面";
this.layoutControlItem13.TextSize = new System.Drawing.Size(96, 14);
//
// txt${ColumnInfo.Name.Alias.ToCapit()}
//
this.txtisToolBtn.Location = new System.Drawing.Point(112, 324);
this.txtisToolBtn.Name = "txtisToolBtn";
this.txtisToolBtn.Size = new System.Drawing.Size(481, 20);
this.txtisToolBtn.StyleController = this.layoutControl1;
this.txtisToolBtn.TabIndex = 14;
//
// layoutControlItem14
//
this.layoutControlItem14.Control = this.txtisToolBtn;
this.layoutControlItem14.CustomizationFormText = "是否功能按钮";
this.layoutControlItem14.Location = new System.Drawing.Point(0, 312);
this.layoutControlItem14.Name = "layoutControlItem14";
this.layoutControlItem14.Size = new System.Drawing.Size(585, 24);
this.layoutControlItem14.Text = "是否功能按钮";
this.layoutControlItem14.TextSize = new System.Drawing.Size(96, 14);
//
// layoutControlGroup1
//
this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem1
,this.layoutControlItem2
,this.layoutControlItem3
,this.layoutControlItem4
,this.layoutControlItem5
,this.layoutControlItem6
,this.layoutControlItem7
,this.layoutControlItem8
,this.layoutControlItem9
,this.layoutControlItem10
,this.layoutControlItem11
,this.layoutControlItem12
,this.layoutControlItem13
,this.layoutControlItem14
});
this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
this.layoutControlGroup1.Name = "layoutControlGroup1";
this.layoutControlGroup1.Size = new System.Drawing.Size(605, 363);
this.layoutControlGroup1.Text = "layoutControlGroup1";
this.layoutControlGroup1.TextVisible = false;
//
// xtraTabControl1
//
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 34);
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.tabDataList;
this.xtraTabControl1.Size = new System.Drawing.Size(585, 436);
this.xtraTabControl1.TabIndex = 1;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
this.tabDataList,
this.tabDataDetail});
//
// tabDataList
//
this.tabDataList.Controls.Add(this.grdList);
this.tabDataList.Name = "tabDataList";
this.tabDataList.Size = new System.Drawing.Size(579, 407);
this.tabDataList.Text = "数据列表";
//
// tabDataDetail
//
this.tabDataDetail.Controls.Add(this.panelControl2);
this.tabDataDetail.Name = "tabDataDetail";
this.tabDataDetail.Size = new System.Drawing.Size(579, 407);
this.tabDataDetail.Text = "数据编辑";
//
// grdList
//
this.grdList.Dock = System.Windows.Forms.DockStyle.Fill;
this.grdList.Location = new System.Drawing.Point(0, 0);
this.grdList.MainView = this.grdListView;
this.grdList.Name = "grdList";
this.grdList.Size = new System.Drawing.Size(579, 407);
this.grdList.TabIndex = 0;
this.grdList.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.grdListView});
//
// grdListView
//
this.grdListView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn1,
this.gridColumn2,
this.gridColumn3,
this.gridColumn4,
this.gridColumn5,
this.gridColumn6,
this.gridColumn7,
this.gridColumn8,
this.gridColumn9,
this.gridColumn10,
this.gridColumn11,
this.gridColumn12,
this.gridColumn13,
this.gridColumn14,
});
this.grdListView.OptionsBehavior.Editable = false;
this.grdListView.GridControl = this.grdList;
this.grdListView.Name = "grdListView";
this.grdListView.OptionsView.ColumnAutoWidth=false;
this.grdListView.BestFitColumns();
//
// panelControl2
//
this.panelControl2.Controls.Add(this.layoutControl1);
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelControl2.Location = new System.Drawing.Point(0, 0);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(579, 407);
this.panelControl2.TabIndex = 0;
////////////////////////////////
(this.gridColumn1).Caption = "ID";
(this.gridColumn1).Name = "gridColumn1";
(this.gridColumn1).FieldName = "id";
////////////////////////////////
(this.gridColumn2).Caption = "父id";
(this.gridColumn2).Name = "gridColumn2";
(this.gridColumn2).FieldName = "pid";
(this.gridColumn2).Visible = true;
(this.gridColumn2).VisibleIndex = 2;
////////////////////////////////
(this.gridColumn3).Caption = "菜单名称";
(this.gridColumn3).Name = "gridColumn3";
(this.gridColumn3).FieldName = "name";
(this.gridColumn3).Visible = true;
(this.gridColumn3).VisibleIndex = 3;
////////////////////////////////
(this.gridColumn4).Caption = "图标";
(this.gridColumn4).Name = "gridColumn4";
(this.gridColumn4).FieldName = "icon";
(this.gridColumn4).Visible = true;
(this.gridColumn4).VisibleIndex = 4;
////////////////////////////////
(this.gridColumn5).Caption = "菜单类型";
(this.gridColumn5).Name = "gridColumn5";
(this.gridColumn5).FieldName = "winformType";
(this.gridColumn5).Visible = true;
(this.gridColumn5).VisibleIndex = 5;
////////////////////////////////
(this.gridColumn6).Caption = "排序";
(this.gridColumn6).Name = "gridColumn6";
(this.gridColumn6).FieldName = "sort";
(this.gridColumn6).Visible = true;
(this.gridColumn6).VisibleIndex = 6;
////////////////////////////////
(this.gridColumn7).Caption = "有效";
(this.gridColumn7).Name = "gridColumn7";
(this.gridColumn7).FieldName = "isEnabled";
(this.gridColumn7).Visible = true;
(this.gridColumn7).VisibleIndex = 7;
(this.gridColumn8).ColumnEdit = this.repositoryItemtxttoolList;
this.repositoryItemtxttoolList.AutoHeight = false;
this.repositoryItemtxttoolList.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.repositoryItemtxttoolList.DisplayMember = "Name";
this.repositoryItemtxttoolList.Name = "repositoryItemtxttoolList";
this.repositoryItemtxttoolList.ValueMember = "ID";
(this.gridColumn8).Caption = "功能按钮";
(this.gridColumn8).Name = "gridColumn8";
(this.gridColumn8).FieldName = "toolList";
(this.gridColumn8).Visible = true;
(this.gridColumn8).VisibleIndex = 8;
////////////////////////////////
(this.gridColumn9).Caption = "创建人";
(this.gridColumn9).Name = "gridColumn9";
(this.gridColumn9).FieldName = "creatorId";
(this.gridColumn9).Visible = true;
(this.gridColumn9).VisibleIndex = 9;
////////////////////////////////
(this.gridColumn10).Caption = "创建时间";
(this.gridColumn10).Name = "gridColumn10";
(this.gridColumn10).FieldName = "createTime";
(this.gridColumn10).Visible = true;
(this.gridColumn10).VisibleIndex = 10;
////////////////////////////////
(this.gridColumn11).Caption = "编辑人";
(this.gridColumn11).Name = "gridColumn11";
(this.gridColumn11).FieldName = "editorId";
(this.gridColumn11).Visible = true;
(this.gridColumn11).VisibleIndex = 11;
////////////////////////////////
(this.gridColumn12).Caption = "编辑时间";
(this.gridColumn12).Name = "gridColumn12";
(this.gridColumn12).FieldName = "editTime";
(this.gridColumn12).Visible = true;
(this.gridColumn12).VisibleIndex = 12;
////////////////////////////////
(this.gridColumn13).Caption = "是否界面";
(this.gridColumn13).Name = "gridColumn13";
(this.gridColumn13).FieldName = "isForm";
(this.gridColumn13).Visible = true;
(this.gridColumn13).VisibleIndex = 13;
////////////////////////////////
(this.gridColumn14).Caption = "是否功能按钮";
(this.gridColumn14).Name = "gridColumn14";
(this.gridColumn14).FieldName = "isToolBtn";
(this.gridColumn14).Visible = true;
(this.gridColumn14).VisibleIndex = 14;
//
// XtraForm1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1300, 800);
this.Controls.Add(this.xtraTabControl1);
this.Name = "FrmsysMenu";
this.Text = "FrmsysMenu";
this.Load += new System.EventHandler(this.FrmsysMenu_Load);
this.Controls.SetChildIndex(this.xtraTabControl1, 0);
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtid.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtpid.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtname.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txticon.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtwinformType.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtsort.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisEnabled.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemtxttoolList)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.txttoolList.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtcreatorId.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtcreateTime.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txteditorId.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txteditTime.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisForm.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
/////////////////////////
((System.ComponentModel.ISupportInitialize)(this.txtisToolBtn.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.tabDataList.ResumeLayout(false);
this.tabDataDetail.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.grdList)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.grdListView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
this.layoutControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private XtraTabControl xtraTabControl1;
private XtraTabPage tabDataList;
private XtraTabPage tabDataDetail;
private DevExpress.XtraGrid.GridControl grdList;
private DevExpress.XtraGrid.Views.Grid.GridView grdListView;
private PanelControl panelControl2;
private DevExpress.XtraLayout.LayoutControl layoutControl1;
private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn4;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn5;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn6;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn7;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn8;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn9;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn10;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn11;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn12;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn13;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn14;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtid;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtpid;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtname;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txticon;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtwinformType;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtsort;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtisEnabled;
private DevExpress.XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit repositoryItemtxttoolList;
private DevExpress.XtraEditors.CheckedComboBoxEdit txttoolList;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtcreatorId;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtcreateTime;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txteditorId;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txteditTime;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtisForm;
///////////////////////////////
private DevExpress.XtraEditors.TextEdit txtisToolBtn;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem13;
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem14;
}
}

View File

@ -12,21 +12,24 @@ using DevExpress.XtraLayout;
using MES.Entity;
using System.Data.Entity.Migrations;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.SqlClient;
using DevExpress.XtraPrinting.Export.Text;
using DevExpress.XtraTreeList.Nodes;
using WinformGeneralDeveloperFrame.Commons;
namespace MES.Form
{
public partial class FrmsysRole : FrmBaseForm
{
private Dictionary<string, string> fieldDictionary = new Dictionary<string, string>();
private List<int> userids = new List<int>();
public FrmsysRole()
{
InitializeComponent();
}
private void FrmsysRole_Load(object sender, EventArgs e)
{
InitFrom(xtraTabControl1,grdList,grdListView,new LayoutControlGroup[]{layoutControlGroup1},new sysRoleInfo());
InitFrom(xtraTabControl1,grdList,grdListView,new LayoutControlGroup[]{layoutControlGroup1},new sysRoleInfo());
InitSearchDicData();
}
/// <summary>
@ -41,12 +44,79 @@ namespace MES.Form
repositoryItemtxtcreatorId.DataSource= GetDataTableUtils.SqlTable("用户");
txteditorId.Properties.DataSource = GetDataTableUtils.SqlTable("用户");
repositoryItemtxteditorId.DataSource= GetDataTableUtils.SqlTable("用户");
treeList1.DataSource = GetDataTableUtils.SqlTable("角色功能");
repositoryItemLookUpEdit1.DataSource = GetDataTableUtils.SqlTable("部门");
treeList1.DataSource = GetDataTableUtils.SqlTable("角色功能");
treeList1.OptionsSelection.MultiSelect = true;
treeList1.OptionsSelection.UseIndicatorForSelection = false;
treeList1.OptionsSelection.UseIndicatorForSelection = true;
treeList1.OptionsView.ShowCheckBoxes = true;
treeList1.ExpandAll();
treeList2.DataSource = GetDataTableUtils.SqlTable("用户-角色");
treeList2.OptionsSelection.MultiSelect = true;
treeList2.OptionsSelection.UseIndicatorForSelection = true;
treeList2.OptionsView.ShowCheckBoxes = true;
treeList2.ExpandAll();
using (var db = new MESDB())
{
///根据角色id获取用户
if(!string.IsNullOrEmpty(txtid.Text))
userids = db.Database
.SqlQuery<int>(
$"select u.id from sysuserrole r left join sysuser u on r.userid=u.id where r.roleid={txtid.Text}").ToListAsync()
.Result;
}
if (treeList2.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList2.Nodes)//拿所有结点
{
DataRowView drv = treeList2.GetDataRecordByNode(node) as DataRowView;//强转选中状态的行
if (userids.Contains((int)drv["id"]))
{
node.Checked = true;
}
}
}
}
public override void gridControlMouseDoubleClickFunction(object sender, EventArgs e)
{
treeList1.DataSource = GetDataTableUtils.SqlTable("角色功能");
treeList1.ExpandAll();
treeList2.DataSource = GetDataTableUtils.SqlTable("用户-角色");
treeList2.ExpandAll();
using (var db = new MESDB())
{
ids= db.Database.SqlQuery<int>($"select functionId from sysRoleFunction where roleId={txtid.Text}").ToListAsync().Result;
///根据角色id获取用户
userids = db.Database
.SqlQuery<int>(
$"select u.id from sysuserrole r left join sysuser u on r.userid=u.id where r.roleid={txtid.Text}").ToListAsync()
.Result;
gridControl1.DataSource = db.sysUserInfo.ToList().Where(p => userids.Contains(p.id));
}
if (treeList2.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList2.Nodes)//拿所有结点
{
DataRowView drv = treeList2.GetDataRecordByNode(node) as DataRowView;//强转选中状态的行
if (userids.Contains((int)drv["id"]))
{
node.Checked = true;
}
}
}
if (treeList1.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList1.Nodes)//拿所有结点
{
SetCheckStatus(node);
}
}
}
/// <summary>
/// 搜索字段
@ -63,6 +133,7 @@ namespace MES.Form
fieldDictionary.Add("编辑人","editorId");
fieldDictionary.Add("编辑时间","editTime");
}
List<int> ids = new List<int>();//用来存储ID
/// <summary>
/// 保存
/// </summary>
@ -71,12 +142,7 @@ namespace MES.Form
{
try
{
sysRoleInfo info= (sysRoleInfo)this.ControlDataToModel(new sysRoleInfo());
using (var db = new MESDB())
{
db.sysRoleInfo.AddOrUpdate(info);
db.SaveChanges();
}
ids.Clear();
if (treeList1.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList1.Nodes)//拿所有结点
@ -84,9 +150,49 @@ namespace MES.Form
GetCheckedID(node);
}
}
sysRoleInfo info= (sysRoleInfo)this.ControlDataToModel(new sysRoleInfo());
using (var db = new MESDB())
{
using (var tran = db.Database.BeginTransaction())
{
try
{
db.sysRoleInfo.AddOrUpdate(info);
db.SaveChanges();
db.Database.ExecuteSqlCommand($"delete from sysRoleFunction where roleId={info.id}");
db.Database.ExecuteSqlCommand($"delete from sysUserRole where roleId={info.id}");
string sql = "";
foreach (var item in ids)
{
sql += $"INSERT INTO sysRoleFunction VALUES ({info.id},{item});";
}
db.Database.ExecuteSqlCommand(sql);
var dd = gridControl1.DataSource as IEnumerable<sysUserInfo>;
string sql2 = "";
foreach (sysUserInfo item in dd)
{
sql2 += $"INSERT INTO sysUserRole VALUES ({item.id},{info.id});";
}
db.Database.ExecuteSqlCommand(sql2);
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
ex.Message.ShowError();
}
finally
{
tran.Dispose();
}
}
}
}
catch (Exception ex)
{
{
ex.Message.ShowError();
return false;
}
@ -99,7 +205,15 @@ namespace MES.Form
grdList.DataSource=con.sysRoleInfo.ToList();
}
Init();
}
if (treeList1.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList1.Nodes)//拿所有结点
{
SetCheckStatus(node);
}
}
}
/// <summary>
/// 字段为空校验
/// </summary>
@ -200,10 +314,15 @@ namespace MES.Form
{
treeList1.DataSource = GetDataTableUtils.SqlTable("角色功能");
treeList1.ExpandAll();
if (treeList1.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList1.Nodes)//拿所有结点
{
SetCheckStatus(node);
}
}
}
List<int> ids = new List<int>();//用来存储ID
private void GetCheckedID(TreeListNode parentNode)
{
@ -213,10 +332,96 @@ namespace MES.Form
if (node.CheckState == CheckState.Checked)//判断当前节点选择状态
{
DataRowView drv = treeList1.GetDataRecordByNode(node) as DataRowView;//强转选中状态的行
var str = node.Id;
if (drv != null)
{
int id = (int)drv["ID"];
ids.Add(id);
}
}
GetCheckedID(node);//执行递归
}
}
private void SetCheckStatus(TreeListNode parentNode)
{
if (parentNode.Nodes.Count == 0) return;//递归终止
foreach (TreeListNode node in parentNode.Nodes)
{
DataRowView drv = treeList1.GetDataRecordByNode(node) as DataRowView;//强转选中状态的行
if (ids.Contains((int) drv["ID"]))
{
node.Checked = true;
}
SetCheckStatus(node);//执行递归
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
using (var db = new MESDB())
{
treeList2.DataSource= db.sysUserInfo.OrderByDescending(p => p.account.Equals(textEdit1.Text)).ToList();
}
using (var db = new MESDB())
{
//ids = db.Database.SqlQuery<int>($"select functionId from sysRoleFunction where roleId={txtid.Text}").ToListAsync().Result;
///根据角色id获取用户
userids = db.Database
.SqlQuery<int>(
$"select u.id from sysuserrole r left join sysuser u on r.userid=u.id where r.roleid={txtid.Text}").ToListAsync()
.Result;
// gridControl1.DataSource = db.sysUserInfo.ToList().Exists(p => userids.Contains(p.id));
}
if (treeList2.Nodes.Count > 0)
{
foreach (TreeListNode node in treeList2.Nodes)//拿所有结点
{
sysUserInfo drv = treeList2.GetDataRecordByNode(node) as sysUserInfo;//强转选中状态的行
if (userids.Contains(drv.id))
{
node.Checked = true;
}
}
}
}
private void simpleButton2_Click(object sender, EventArgs e)
{
gridControl1.DataSource = null;
List<sysUserInfo> userInfos = new List<sysUserInfo>();
foreach (TreeListNode node in treeList2.Nodes)
{
if (node.Checked)
{
if (treeList2.GetDataRecordByNode(node).GetType() == typeof(DataRowView))
{
DataRowView drv = treeList2.GetDataRecordByNode(node) as DataRowView;
userInfos.Add(new sysUserInfo()
{
id = drv.Row["id"].ToString().ToInt16(),
account = drv.Row["account"].ToString(),
username = drv.Row["username"].ToString(),
deptId = drv.Row["deptId"].ToString().ToInt16(),
});
}
else
{
sysUserInfo drv = treeList2.GetDataRecordByNode(node) as sysUserInfo;
userInfos.Add(new sysUserInfo()
{
id = drv.id,
account = drv.account,
username = drv.username,
deptId = drv.deptId,
});
}
}
}
gridControl1.DataSource = userInfos;
}
}
}

View File

@ -76,6 +76,31 @@ namespace MES.Form
this.panelControl4 = new DevExpress.XtraEditors.PanelControl();
this.btnRefrsh = new DevExpress.XtraEditors.SimpleButton();
this.treeList1 = new DevExpress.XtraTreeList.TreeList();
this.xtraTabPage3 = new DevExpress.XtraTab.XtraTabPage();
this.panelControl5 = new DevExpress.XtraEditors.PanelControl();
this.panelControl7 = new DevExpress.XtraEditors.PanelControl();
this.gridControl1 = new DevExpress.XtraGrid.GridControl();
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemLookUpEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn();
this.panelControl6 = new DevExpress.XtraEditors.PanelControl();
this.layoutControl2 = new DevExpress.XtraLayout.LayoutControl();
this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton();
this.treeList2 = new DevExpress.XtraTreeList.TreeList();
this.treeListColumn1 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.treeListColumn2 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.treeListColumn3 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.treeListColumn4 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.textEdit1 = new DevExpress.XtraEditors.TextEdit();
this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTreeListtxtcompanyId)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTreeListtxtcompanyIdTreeList)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemtxtcreatorId)).BeginInit();
@ -118,6 +143,25 @@ namespace MES.Form
((System.ComponentModel.ISupportInitialize)(this.panelControl4)).BeginInit();
this.panelControl4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
this.xtraTabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControl5)).BeginInit();
this.panelControl5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelControl7)).BeginInit();
this.panelControl7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl6)).BeginInit();
this.panelControl6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControl2)).BeginInit();
this.layoutControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeList2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
this.SuspendLayout();
//
// gridColumn1
@ -242,7 +286,7 @@ namespace MES.Form
this.xtraTabControl1.Location = new System.Drawing.Point(0, 34);
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.tabDataList;
this.xtraTabControl1.Size = new System.Drawing.Size(905, 433);
this.xtraTabControl1.Size = new System.Drawing.Size(738, 645);
this.xtraTabControl1.TabIndex = 1;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
this.tabDataList,
@ -252,7 +296,7 @@ namespace MES.Form
//
this.tabDataList.Controls.Add(this.grdList);
this.tabDataList.Name = "tabDataList";
this.tabDataList.Size = new System.Drawing.Size(899, 404);
this.tabDataList.Size = new System.Drawing.Size(732, 616);
this.tabDataList.Text = "数据列表";
//
// grdList
@ -261,7 +305,7 @@ namespace MES.Form
this.grdList.Location = new System.Drawing.Point(0, 0);
this.grdList.MainView = this.grdListView;
this.grdList.Name = "grdList";
this.grdList.Size = new System.Drawing.Size(899, 404);
this.grdList.Size = new System.Drawing.Size(732, 616);
this.grdList.TabIndex = 0;
this.grdList.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.grdListView});
@ -286,7 +330,7 @@ namespace MES.Form
//
this.tabDataDetail.Controls.Add(this.panelControl2);
this.tabDataDetail.Name = "tabDataDetail";
this.tabDataDetail.Size = new System.Drawing.Size(899, 404);
this.tabDataDetail.Size = new System.Drawing.Size(732, 616);
this.tabDataDetail.Text = "数据编辑";
//
// panelControl2
@ -295,7 +339,7 @@ namespace MES.Form
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelControl2.Location = new System.Drawing.Point(0, 0);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(899, 404);
this.panelControl2.Size = new System.Drawing.Size(732, 616);
this.panelControl2.TabIndex = 0;
//
// xtraTabControl2
@ -304,17 +348,18 @@ namespace MES.Form
this.xtraTabControl2.Location = new System.Drawing.Point(2, 2);
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl2.Size = new System.Drawing.Size(895, 400);
this.xtraTabControl2.Size = new System.Drawing.Size(728, 612);
this.xtraTabControl2.TabIndex = 7;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
this.xtraTabPage1,
this.xtraTabPage2});
this.xtraTabPage2,
this.xtraTabPage3});
//
// xtraTabPage1
//
this.xtraTabPage1.Controls.Add(this.layoutControl1);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(889, 371);
this.xtraTabPage1.Size = new System.Drawing.Size(722, 583);
this.xtraTabPage1.Text = "角色基础信息";
//
// layoutControl1
@ -330,7 +375,7 @@ namespace MES.Form
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Root = this.layoutControlGroup1;
this.layoutControl1.Size = new System.Drawing.Size(889, 371);
this.layoutControl1.Size = new System.Drawing.Size(722, 583);
this.layoutControl1.TabIndex = 6;
this.layoutControl1.Text = "layoutControl1";
//
@ -338,21 +383,21 @@ namespace MES.Form
//
this.txtid.Location = new System.Drawing.Point(63, 12);
this.txtid.Name = "txtid";
this.txtid.Size = new System.Drawing.Size(379, 20);
this.txtid.Size = new System.Drawing.Size(296, 20);
this.txtid.StyleController = this.layoutControl1;
this.txtid.TabIndex = 1;
//
// txtcompanyId
//
this.txtcompanyId.EditValue = "";
this.txtcompanyId.Location = new System.Drawing.Point(497, 12);
this.txtcompanyId.Location = new System.Drawing.Point(414, 12);
this.txtcompanyId.Name = "txtcompanyId";
this.txtcompanyId.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.txtcompanyId.Properties.DisplayMember = "Name";
this.txtcompanyId.Properties.TreeList = this.txtcompanyIdTreeList;
this.txtcompanyId.Properties.ValueMember = "ID";
this.txtcompanyId.Size = new System.Drawing.Size(380, 20);
this.txtcompanyId.Size = new System.Drawing.Size(296, 20);
this.txtcompanyId.StyleController = this.layoutControl1;
this.txtcompanyId.TabIndex = 2;
//
@ -369,7 +414,7 @@ namespace MES.Form
//
this.txtname.Location = new System.Drawing.Point(63, 36);
this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(814, 20);
this.txtname.Size = new System.Drawing.Size(647, 20);
this.txtname.StyleController = this.layoutControl1;
this.txtname.TabIndex = 4;
//
@ -384,7 +429,7 @@ namespace MES.Form
this.txtcreatorId.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
this.txtcreatorId.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
this.txtcreatorId.Properties.ValueMember = "ID";
this.txtcreatorId.Size = new System.Drawing.Size(379, 20);
this.txtcreatorId.Size = new System.Drawing.Size(296, 20);
this.txtcreatorId.StyleController = this.layoutControl1;
this.txtcreatorId.TabIndex = 5;
//
@ -392,7 +437,7 @@ namespace MES.Form
//
this.txtcreateTime.EditValue = null;
this.txtcreateTime.ImeMode = System.Windows.Forms.ImeMode.Off;
this.txtcreateTime.Location = new System.Drawing.Point(497, 60);
this.txtcreateTime.Location = new System.Drawing.Point(414, 60);
this.txtcreateTime.Name = "txtcreateTime";
this.txtcreateTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
@ -400,7 +445,7 @@ namespace MES.Form
new DevExpress.XtraEditors.Controls.EditorButton()});
this.txtcreateTime.Properties.DisplayFormat.FormatString = "G";
this.txtcreateTime.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
this.txtcreateTime.Size = new System.Drawing.Size(380, 20);
this.txtcreateTime.Size = new System.Drawing.Size(296, 20);
this.txtcreateTime.StyleController = this.layoutControl1;
this.txtcreateTime.TabIndex = 6;
//
@ -415,7 +460,7 @@ namespace MES.Form
this.txteditorId.Properties.PopupFilterMode = DevExpress.XtraEditors.PopupFilterMode.Contains;
this.txteditorId.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
this.txteditorId.Properties.ValueMember = "ID";
this.txteditorId.Size = new System.Drawing.Size(379, 20);
this.txteditorId.Size = new System.Drawing.Size(296, 20);
this.txteditorId.StyleController = this.layoutControl1;
this.txteditorId.TabIndex = 7;
//
@ -423,7 +468,7 @@ namespace MES.Form
//
this.txteditTime.EditValue = null;
this.txteditTime.ImeMode = System.Windows.Forms.ImeMode.Off;
this.txteditTime.Location = new System.Drawing.Point(497, 84);
this.txteditTime.Location = new System.Drawing.Point(414, 84);
this.txteditTime.Name = "txteditTime";
this.txteditTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
@ -431,7 +476,7 @@ namespace MES.Form
new DevExpress.XtraEditors.Controls.EditorButton()});
this.txteditTime.Properties.DisplayFormat.FormatString = "G";
this.txteditTime.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
this.txteditTime.Size = new System.Drawing.Size(380, 20);
this.txteditTime.Size = new System.Drawing.Size(296, 20);
this.txteditTime.StyleController = this.layoutControl1;
this.txteditTime.TabIndex = 8;
//
@ -449,7 +494,7 @@ namespace MES.Form
this.emptySpaceItem1,
this.layoutControlItem8});
this.layoutControlGroup1.Name = "layoutControlGroup1";
this.layoutControlGroup1.Size = new System.Drawing.Size(889, 371);
this.layoutControlGroup1.Size = new System.Drawing.Size(722, 583);
this.layoutControlGroup1.TextVisible = false;
//
// layoutControlItem1
@ -458,7 +503,7 @@ namespace MES.Form
this.layoutControlItem1.CustomizationFormText = "ID";
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem1.Name = "layoutControlItem1";
this.layoutControlItem1.Size = new System.Drawing.Size(434, 24);
this.layoutControlItem1.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem1.Text = "ID";
this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
//
@ -468,7 +513,7 @@ namespace MES.Form
this.layoutControlItem4.CustomizationFormText = "角色名称";
this.layoutControlItem4.Location = new System.Drawing.Point(0, 24);
this.layoutControlItem4.Name = "layoutControlItem4";
this.layoutControlItem4.Size = new System.Drawing.Size(869, 24);
this.layoutControlItem4.Size = new System.Drawing.Size(702, 24);
this.layoutControlItem4.Text = "角色名称";
this.layoutControlItem4.TextSize = new System.Drawing.Size(48, 14);
//
@ -478,7 +523,7 @@ namespace MES.Form
this.layoutControlItem5.CustomizationFormText = "创建人";
this.layoutControlItem5.Location = new System.Drawing.Point(0, 48);
this.layoutControlItem5.Name = "layoutControlItem5";
this.layoutControlItem5.Size = new System.Drawing.Size(434, 24);
this.layoutControlItem5.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem5.Text = "创建人";
this.layoutControlItem5.TextSize = new System.Drawing.Size(48, 14);
//
@ -488,7 +533,7 @@ namespace MES.Form
this.layoutControlItem7.CustomizationFormText = "编辑人";
this.layoutControlItem7.Location = new System.Drawing.Point(0, 72);
this.layoutControlItem7.Name = "layoutControlItem7";
this.layoutControlItem7.Size = new System.Drawing.Size(434, 24);
this.layoutControlItem7.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem7.Text = "编辑人";
this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 14);
//
@ -496,9 +541,9 @@ namespace MES.Form
//
this.layoutControlItem2.Control = this.txtcompanyId;
this.layoutControlItem2.CustomizationFormText = "公司";
this.layoutControlItem2.Location = new System.Drawing.Point(434, 0);
this.layoutControlItem2.Location = new System.Drawing.Point(351, 0);
this.layoutControlItem2.Name = "layoutControlItem2";
this.layoutControlItem2.Size = new System.Drawing.Size(435, 24);
this.layoutControlItem2.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem2.Text = "公司";
this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
//
@ -506,9 +551,9 @@ namespace MES.Form
//
this.layoutControlItem6.Control = this.txtcreateTime;
this.layoutControlItem6.CustomizationFormText = "创建时间";
this.layoutControlItem6.Location = new System.Drawing.Point(434, 48);
this.layoutControlItem6.Location = new System.Drawing.Point(351, 48);
this.layoutControlItem6.Name = "layoutControlItem6";
this.layoutControlItem6.Size = new System.Drawing.Size(435, 24);
this.layoutControlItem6.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem6.Text = "创建时间";
this.layoutControlItem6.TextSize = new System.Drawing.Size(48, 14);
//
@ -517,16 +562,16 @@ namespace MES.Form
this.emptySpaceItem1.AllowHotTrack = false;
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 96);
this.emptySpaceItem1.Name = "emptySpaceItem1";
this.emptySpaceItem1.Size = new System.Drawing.Size(869, 255);
this.emptySpaceItem1.Size = new System.Drawing.Size(702, 467);
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
//
// layoutControlItem8
//
this.layoutControlItem8.Control = this.txteditTime;
this.layoutControlItem8.CustomizationFormText = "编辑时间";
this.layoutControlItem8.Location = new System.Drawing.Point(434, 72);
this.layoutControlItem8.Location = new System.Drawing.Point(351, 72);
this.layoutControlItem8.Name = "layoutControlItem8";
this.layoutControlItem8.Size = new System.Drawing.Size(435, 24);
this.layoutControlItem8.Size = new System.Drawing.Size(351, 24);
this.layoutControlItem8.Text = "编辑时间";
this.layoutControlItem8.TextSize = new System.Drawing.Size(48, 14);
//
@ -534,7 +579,7 @@ namespace MES.Form
//
this.xtraTabPage2.Controls.Add(this.panelControl3);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(889, 371);
this.xtraTabPage2.Size = new System.Drawing.Size(722, 583);
this.xtraTabPage2.Text = "可操作功能";
//
// panelControl3
@ -544,7 +589,7 @@ namespace MES.Form
this.panelControl3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelControl3.Location = new System.Drawing.Point(0, 0);
this.panelControl3.Name = "panelControl3";
this.panelControl3.Size = new System.Drawing.Size(889, 371);
this.panelControl3.Size = new System.Drawing.Size(722, 583);
this.panelControl3.TabIndex = 0;
//
// panelControl4
@ -553,7 +598,7 @@ namespace MES.Form
this.panelControl4.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl4.Location = new System.Drawing.Point(2, 2);
this.panelControl4.Name = "panelControl4";
this.panelControl4.Size = new System.Drawing.Size(885, 36);
this.panelControl4.Size = new System.Drawing.Size(718, 36);
this.panelControl4.TabIndex = 1;
//
// btnRefrsh
@ -572,16 +617,249 @@ namespace MES.Form
| System.Windows.Forms.AnchorStyles.Right)));
this.treeList1.Location = new System.Drawing.Point(2, 39);
this.treeList1.Name = "treeList1";
this.treeList1.OptionsBehavior.AllowRecursiveNodeChecking = true;
this.treeList1.OptionsBehavior.Editable = false;
this.treeList1.ParentFieldName = "PID";
this.treeList1.Size = new System.Drawing.Size(887, 332);
this.treeList1.Size = new System.Drawing.Size(720, 544);
this.treeList1.TabIndex = 0;
//
// xtraTabPage3
//
this.xtraTabPage3.Controls.Add(this.panelControl5);
this.xtraTabPage3.Name = "xtraTabPage3";
this.xtraTabPage3.Size = new System.Drawing.Size(722, 583);
this.xtraTabPage3.Text = "用户";
//
// panelControl5
//
this.panelControl5.Controls.Add(this.panelControl7);
this.panelControl5.Controls.Add(this.panelControl6);
this.panelControl5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelControl5.Location = new System.Drawing.Point(0, 0);
this.panelControl5.Name = "panelControl5";
this.panelControl5.Size = new System.Drawing.Size(722, 583);
this.panelControl5.TabIndex = 0;
//
// panelControl7
//
this.panelControl7.Controls.Add(this.gridControl1);
this.panelControl7.Dock = System.Windows.Forms.DockStyle.Left;
this.panelControl7.Location = new System.Drawing.Point(2, 2);
this.panelControl7.Name = "panelControl7";
this.panelControl7.Size = new System.Drawing.Size(245, 579);
this.panelControl7.TabIndex = 1;
//
// gridControl1
//
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControl1.Location = new System.Drawing.Point(2, 2);
this.gridControl1.MainView = this.gridView1;
this.gridControl1.Name = "gridControl1";
this.gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.repositoryItemLookUpEdit1});
this.gridControl1.Size = new System.Drawing.Size(241, 575);
this.gridControl1.TabIndex = 0;
this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridView1});
//
// gridView1
//
this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn9,
this.gridColumn10,
this.gridColumn11,
this.gridColumn12});
this.gridView1.GridControl = this.gridControl1;
this.gridView1.Name = "gridView1";
this.gridView1.OptionsBehavior.Editable = false;
//
// gridColumn9
//
this.gridColumn9.Caption = "工号";
this.gridColumn9.FieldName = "account";
this.gridColumn9.Name = "gridColumn9";
this.gridColumn9.Visible = true;
this.gridColumn9.VisibleIndex = 0;
//
// gridColumn10
//
this.gridColumn10.Caption = "姓名";
this.gridColumn10.FieldName = "username";
this.gridColumn10.Name = "gridColumn10";
this.gridColumn10.Visible = true;
this.gridColumn10.VisibleIndex = 1;
//
// gridColumn11
//
this.gridColumn11.Caption = "部门";
this.gridColumn11.ColumnEdit = this.repositoryItemLookUpEdit1;
this.gridColumn11.FieldName = "deptId";
this.gridColumn11.Name = "gridColumn11";
this.gridColumn11.Visible = true;
this.gridColumn11.VisibleIndex = 2;
//
// repositoryItemLookUpEdit1
//
this.repositoryItemLookUpEdit1.AutoHeight = false;
this.repositoryItemLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.repositoryItemLookUpEdit1.DisplayMember = "Name";
this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
this.repositoryItemLookUpEdit1.NullText = "";
this.repositoryItemLookUpEdit1.ValueMember = "ID";
//
// gridColumn12
//
this.gridColumn12.Caption = "gridColumn12";
this.gridColumn12.FieldName = "id";
this.gridColumn12.Name = "gridColumn12";
//
// panelControl6
//
this.panelControl6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelControl6.Controls.Add(this.layoutControl2);
this.panelControl6.Location = new System.Drawing.Point(247, 2);
this.panelControl6.Name = "panelControl6";
this.panelControl6.Size = new System.Drawing.Size(474, 581);
this.panelControl6.TabIndex = 0;
//
// layoutControl2
//
this.layoutControl2.Controls.Add(this.simpleButton2);
this.layoutControl2.Controls.Add(this.treeList2);
this.layoutControl2.Controls.Add(this.simpleButton1);
this.layoutControl2.Controls.Add(this.textEdit1);
this.layoutControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.layoutControl2.Location = new System.Drawing.Point(2, 2);
this.layoutControl2.Name = "layoutControl2";
this.layoutControl2.Root = this.Root;
this.layoutControl2.Size = new System.Drawing.Size(470, 577);
this.layoutControl2.TabIndex = 1;
this.layoutControl2.Text = "layoutControl2";
//
// simpleButton2
//
this.simpleButton2.Location = new System.Drawing.Point(12, 543);
this.simpleButton2.Name = "simpleButton2";
this.simpleButton2.Size = new System.Drawing.Size(446, 22);
this.simpleButton2.StyleController = this.layoutControl2;
this.simpleButton2.TabIndex = 10;
this.simpleButton2.Text = "确定";
this.simpleButton2.Click += new System.EventHandler(this.simpleButton2_Click);
//
// treeList2
//
this.treeList2.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
this.treeListColumn1,
this.treeListColumn2,
this.treeListColumn3,
this.treeListColumn4});
this.treeList2.Location = new System.Drawing.Point(12, 38);
this.treeList2.Name = "treeList2";
this.treeList2.Size = new System.Drawing.Size(446, 501);
this.treeList2.TabIndex = 9;
//
// treeListColumn1
//
this.treeListColumn1.Caption = "工号";
this.treeListColumn1.FieldName = "account";
this.treeListColumn1.Name = "treeListColumn1";
this.treeListColumn1.Visible = true;
this.treeListColumn1.VisibleIndex = 0;
//
// treeListColumn2
//
this.treeListColumn2.Caption = "姓名";
this.treeListColumn2.FieldName = "username";
this.treeListColumn2.Name = "treeListColumn2";
this.treeListColumn2.Visible = true;
this.treeListColumn2.VisibleIndex = 1;
//
// treeListColumn3
//
this.treeListColumn3.Caption = "部门";
this.treeListColumn3.FieldName = "deptId";
this.treeListColumn3.Name = "treeListColumn3";
//
// treeListColumn4
//
this.treeListColumn4.Caption = "treeListColumn4";
this.treeListColumn4.FieldName = "id";
this.treeListColumn4.Name = "treeListColumn4";
//
// simpleButton1
//
this.simpleButton1.Location = new System.Drawing.Point(371, 12);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(87, 22);
this.simpleButton1.StyleController = this.layoutControl2;
this.simpleButton1.TabIndex = 8;
this.simpleButton1.Text = "搜索";
this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click);
//
// textEdit1
//
this.textEdit1.Location = new System.Drawing.Point(39, 12);
this.textEdit1.Name = "textEdit1";
this.textEdit1.Size = new System.Drawing.Size(328, 20);
this.textEdit1.StyleController = this.layoutControl2;
this.textEdit1.TabIndex = 3;
//
// Root
//
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
this.Root.GroupBordersVisible = false;
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
this.layoutControlItem9,
this.layoutControlItem10,
this.layoutControlItem3,
this.layoutControlItem11});
this.Root.Name = "Root";
this.Root.Size = new System.Drawing.Size(470, 577);
this.Root.TextVisible = false;
//
// layoutControlItem9
//
this.layoutControlItem9.Control = this.textEdit1;
this.layoutControlItem9.Location = new System.Drawing.Point(0, 0);
this.layoutControlItem9.Name = "layoutControlItem9";
this.layoutControlItem9.Size = new System.Drawing.Size(359, 26);
this.layoutControlItem9.Text = "工号";
this.layoutControlItem9.TextSize = new System.Drawing.Size(24, 14);
//
// layoutControlItem10
//
this.layoutControlItem10.Control = this.simpleButton1;
this.layoutControlItem10.Location = new System.Drawing.Point(359, 0);
this.layoutControlItem10.Name = "layoutControlItem10";
this.layoutControlItem10.Size = new System.Drawing.Size(91, 26);
this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem10.TextVisible = false;
//
// layoutControlItem3
//
this.layoutControlItem3.Control = this.treeList2;
this.layoutControlItem3.Location = new System.Drawing.Point(0, 26);
this.layoutControlItem3.Name = "layoutControlItem3";
this.layoutControlItem3.Size = new System.Drawing.Size(450, 505);
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem3.TextVisible = false;
//
// layoutControlItem11
//
this.layoutControlItem11.Control = this.simpleButton2;
this.layoutControlItem11.Location = new System.Drawing.Point(0, 531);
this.layoutControlItem11.Name = "layoutControlItem11";
this.layoutControlItem11.Size = new System.Drawing.Size(450, 26);
this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
this.layoutControlItem11.TextVisible = false;
//
// FrmsysRole
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(905, 467);
this.ClientSize = new System.Drawing.Size(738, 679);
this.Controls.Add(this.xtraTabControl1);
this.Name = "FrmsysRole";
this.Text = "FrmsysRole";
@ -629,6 +907,25 @@ namespace MES.Form
((System.ComponentModel.ISupportInitialize)(this.panelControl4)).EndInit();
this.panelControl4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit();
this.xtraTabPage3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.panelControl5)).EndInit();
this.panelControl5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.panelControl7)).EndInit();
this.panelControl7.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl6)).EndInit();
this.panelControl6.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.layoutControl2)).EndInit();
this.layoutControl2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.treeList2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
this.ResumeLayout(false);
}
@ -688,5 +985,30 @@ namespace MES.Form
private DevExpress.XtraTreeList.TreeList treeList1;
private PanelControl panelControl4;
private SimpleButton btnRefrsh;
private XtraTabPage xtraTabPage3;
private PanelControl panelControl5;
private PanelControl panelControl7;
private PanelControl panelControl6;
private DevExpress.XtraGrid.GridControl gridControl1;
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn9;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn10;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn11;
private DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
private LayoutControl layoutControl2;
private SimpleButton simpleButton1;
private TextEdit textEdit1;
private LayoutControlGroup Root;
private LayoutControlItem layoutControlItem9;
private LayoutControlItem layoutControlItem10;
private DevExpress.XtraTreeList.TreeList treeList2;
private LayoutControlItem layoutControlItem3;
private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn1;
private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn2;
private SimpleButton simpleButton2;
private LayoutControlItem layoutControlItem11;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn12;
private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn3;
private DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn4;
}
}

View File

@ -1,26 +1,27 @@
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemDateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraWizard.WizardControl, DevExpress.XtraWizard.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TreeListLookUpEdit, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v19.2.UI, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraTabbedMdi.XtraTabbedMdiManager, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TreeListLookUpEdit, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTreeListLookUpEdit, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraDataLayout.DataLayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraNavBar.NavBarControl, DevExpress.XtraNavBar.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.PopupGalleryEdit, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTreeListLookUpEdit, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraTabbedMdi.XtraTabbedMdiManager, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemDateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraWizard.WizardControl, DevExpress.XtraWizard.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.PopupGalleryEdit, DevExpress.XtraBars.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.GridLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v19.2.UI, Version=19.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -129,12 +129,6 @@
</Compile>
<Compile Include="ChildWinManagement.cs" />
<Compile Include="Commons\AppInfo.cs" />
<Compile Include="Commons\FrmsysMenu.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Commons\FrmsysMenu.designer.cs">
<DependentUpon>FrmsysMenu.cs</DependentUpon>
</Compile>
<Compile Include="ControlInfo.cs" />
<Compile Include="DB.cs" />
<Compile Include="DBAdapter.cs" />