3bb78abfdf06c37c978c3fd27d87d5926b2bb1d5.svn-base 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. using Core.Mes.ClientFrameWork;
  8. using Core.Mes.IBaseInterface;
  9. //using Core.Mes.ServerFrameWork;
  10. using Infragistics.Win.UltraWinGrid;
  11. namespace Core.Mes.ClientPurviewManager
  12. {
  13. /// <summary>
  14. /// FrmRole 的摘要说明。
  15. /// </summary>
  16. public class FrmRole : Core.Mes.ClientFrameWork.FrmBase
  17. {
  18. private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
  19. private System.Windows.Forms.Panel FrmRole_Fill_Panel;
  20. private System.Windows.Forms.Panel panel1;
  21. private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
  22. private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
  23. private Infragistics.Win.Misc.UltraLabel ultraLabel1;
  24. private Infragistics.Win.Misc.UltraLabel ultraLabel2;
  25. private Infragistics.Win.Misc.UltraLabel ultraLabel3;
  26. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor1;
  27. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor2;
  28. private Infragistics.Win.UltraWinEditors.UltraComboEditor ultraComboEditor1;
  29. // private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor3;
  30. private System.ComponentModel.IContainer components;
  31. public DataSet _roleData;
  32. public string _selectSQL;
  33. public bool _saveFlag = false;
  34. public bool IsAdminFlag = false;
  35. private System.Windows.Forms.Panel panel2;
  36. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left;
  37. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right;
  38. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top;
  39. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom;
  40. private System.Windows.Forms.Panel panel3;
  41. private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor1;
  42. private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
  43. private Infragistics.Win.UltraWinEditors.UltraComboEditor ultraComboEditor4;
  44. private Infragistics.Win.Misc.UltraLabel ultraLabel8;
  45. private string[] _fileNames;
  46. private DataSet _departmentData;
  47. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor3;
  48. string operDepart = "";
  49. string allDept = "";
  50. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor4;
  51. private Infragistics.Win.Misc.UltraLabel ultraLabel4;
  52. string selDept = "";
  53. public FrmRole()
  54. {
  55. //
  56. // Windows 窗体设计器支持所必需的
  57. //
  58. InitializeComponent();
  59. //
  60. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  61. //
  62. }
  63. /// <summary>
  64. /// 清理所有正在使用的资源。
  65. /// </summary>
  66. protected override void Dispose(bool disposing)
  67. {
  68. if (disposing)
  69. {
  70. if (components != null)
  71. {
  72. components.Dispose();
  73. }
  74. }
  75. base.Dispose(disposing);
  76. }
  77. #region Windows 窗体设计器生成的代码
  78. /// <summary>
  79. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  80. /// 此方法的内容。
  81. /// </summary>
  82. private void InitializeComponent()
  83. {
  84. this.components = new System.ComponentModel.Container();
  85. Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("Toolbar1");
  86. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  87. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
  88. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
  89. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
  90. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("close");
  91. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
  92. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
  93. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
  94. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
  95. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  96. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("close");
  97. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("purset");
  98. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
  99. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  100. Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
  101. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 0");
  102. Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
  103. Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
  104. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 1");
  105. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 2");
  106. Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
  107. Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
  108. Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
  109. Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
  110. Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
  111. Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
  112. Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
  113. Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
  114. Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
  115. Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
  116. Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
  117. Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance();
  118. Infragistics.Win.Appearance appearance16 = new Infragistics.Win.Appearance();
  119. Infragistics.Win.Appearance appearance17 = new Infragistics.Win.Appearance();
  120. Infragistics.Win.Appearance appearance18 = new Infragistics.Win.Appearance();
  121. Infragistics.Win.Appearance appearance19 = new Infragistics.Win.Appearance();
  122. Infragistics.Win.UltraWinEditors.EditorButton editorButton1 = new Infragistics.Win.UltraWinEditors.EditorButton();
  123. Infragistics.Win.Appearance appearance20 = new Infragistics.Win.Appearance();
  124. Infragistics.Win.Appearance appearance21 = new Infragistics.Win.Appearance();
  125. Infragistics.Win.Appearance appearance22 = new Infragistics.Win.Appearance();
  126. Infragistics.Win.Appearance appearance23 = new Infragistics.Win.Appearance();
  127. Infragistics.Win.UltraWinEditors.EditorButton editorButton2 = new Infragistics.Win.UltraWinEditors.EditorButton("part");
  128. this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
  129. this.panel1 = new System.Windows.Forms.Panel();
  130. this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  131. this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  132. this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  133. this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  134. this.FrmRole_Fill_Panel = new System.Windows.Forms.Panel();
  135. this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  136. this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
  137. this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
  138. this.panel3 = new System.Windows.Forms.Panel();
  139. this.ultraTextEditor4 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  140. this.ultraLabel4 = new Infragistics.Win.Misc.UltraLabel();
  141. this.ultraComboEditor4 = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  142. this.ultraLabel8 = new Infragistics.Win.Misc.UltraLabel();
  143. this.ultraTextEditor2 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  144. this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
  145. this.ultraTextEditor1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  146. this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
  147. this.ultraLabel3 = new Infragistics.Win.Misc.UltraLabel();
  148. this.ultraComboEditor1 = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  149. this.panel2 = new System.Windows.Forms.Panel();
  150. this.ultraTextEditor3 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  151. this.ultraCheckEditor1 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
  152. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
  153. this.panel1.SuspendLayout();
  154. this.FrmRole_Fill_Panel.SuspendLayout();
  155. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
  156. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
  157. this.ultraExpandableGroupBox1.SuspendLayout();
  158. this.ultraExpandableGroupBoxPanel1.SuspendLayout();
  159. this.panel3.SuspendLayout();
  160. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).BeginInit();
  161. ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor4)).BeginInit();
  162. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).BeginInit();
  163. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).BeginInit();
  164. ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).BeginInit();
  165. this.panel2.SuspendLayout();
  166. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).BeginInit();
  167. this.SuspendLayout();
  168. //
  169. // ultraToolbarsManager1
  170. //
  171. this.ultraToolbarsManager1.DesignerFlags = 1;
  172. this.ultraToolbarsManager1.DockWithinContainer = this.panel1;
  173. this.ultraToolbarsManager1.ShowFullMenusDelay = 500;
  174. this.ultraToolbarsManager1.ShowQuickCustomizeButton = false;
  175. this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005;
  176. ultraToolbar1.DockedColumn = 0;
  177. ultraToolbar1.DockedRow = 0;
  178. ultraToolbar1.Text = "Toolbar1";
  179. buttonTool1.InstanceProps.IsFirstInGroup = true;
  180. buttonTool2.InstanceProps.IsFirstInGroup = true;
  181. buttonTool3.InstanceProps.IsFirstInGroup = true;
  182. buttonTool4.InstanceProps.IsFirstInGroup = true;
  183. buttonTool5.InstanceProps.IsFirstInGroup = true;
  184. buttonTool6.InstanceProps.IsFirstInGroup = true;
  185. ultraToolbar1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  186. buttonTool1,
  187. buttonTool2,
  188. buttonTool3,
  189. buttonTool4,
  190. buttonTool5,
  191. buttonTool6});
  192. this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
  193. ultraToolbar1});
  194. buttonTool7.SharedProps.Caption = "新增(&A)";
  195. buttonTool7.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  196. buttonTool8.SharedProps.Caption = "修改(&U)";
  197. buttonTool8.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  198. buttonTool8.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlU;
  199. buttonTool9.SharedProps.Caption = "删除(&D)";
  200. buttonTool9.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  201. buttonTool10.SharedProps.Caption = "查询(&Q)";
  202. buttonTool10.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  203. buttonTool11.SharedProps.Caption = "关闭(&E)";
  204. buttonTool11.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  205. buttonTool11.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
  206. buttonTool12.SharedProps.Caption = "权限设置(&P)";
  207. buttonTool12.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  208. buttonTool13.SharedProps.Caption = "返回(&B)";
  209. buttonTool13.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  210. buttonTool13.SharedProps.Visible = false;
  211. this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  212. buttonTool7,
  213. buttonTool8,
  214. buttonTool9,
  215. buttonTool10,
  216. buttonTool11,
  217. buttonTool12,
  218. buttonTool13});
  219. this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
  220. //
  221. // panel1
  222. //
  223. this.panel1.BackColor = System.Drawing.Color.Gainsboro;
  224. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left);
  225. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right);
  226. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top);
  227. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom);
  228. this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
  229. this.panel1.Location = new System.Drawing.Point(0, 0);
  230. this.panel1.Name = "panel1";
  231. this.panel1.Size = new System.Drawing.Size(656, 32);
  232. this.panel1.TabIndex = 1;
  233. //
  234. // _panel1_Toolbars_Dock_Area_Left
  235. //
  236. this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  237. this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
  238. this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
  239. this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
  240. this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 27);
  241. this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left";
  242. this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 5);
  243. this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
  244. //
  245. // _panel1_Toolbars_Dock_Area_Right
  246. //
  247. this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  248. this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
  249. this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
  250. this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
  251. this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(656, 27);
  252. this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right";
  253. this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 5);
  254. this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
  255. //
  256. // _panel1_Toolbars_Dock_Area_Top
  257. //
  258. this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  259. this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
  260. this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
  261. this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
  262. this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
  263. this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top";
  264. this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(656, 27);
  265. this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
  266. //
  267. // _panel1_Toolbars_Dock_Area_Bottom
  268. //
  269. this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  270. this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
  271. this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
  272. this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
  273. this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 32);
  274. this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom";
  275. this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(656, 0);
  276. this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
  277. //
  278. // FrmRole_Fill_Panel
  279. //
  280. this.FrmRole_Fill_Panel.Controls.Add(this.ultraGrid1);
  281. this.FrmRole_Fill_Panel.Controls.Add(this.ultraExpandableGroupBox1);
  282. this.FrmRole_Fill_Panel.Controls.Add(this.panel2);
  283. this.FrmRole_Fill_Panel.Controls.Add(this.panel1);
  284. this.FrmRole_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
  285. this.FrmRole_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
  286. this.FrmRole_Fill_Panel.Location = new System.Drawing.Point(0, 0);
  287. this.FrmRole_Fill_Panel.Name = "FrmRole_Fill_Panel";
  288. this.FrmRole_Fill_Panel.Size = new System.Drawing.Size(656, 470);
  289. this.FrmRole_Fill_Panel.TabIndex = 0;
  290. //
  291. // ultraGrid1
  292. //
  293. appearance1.BackColor = System.Drawing.SystemColors.Window;
  294. appearance1.BorderColor = System.Drawing.SystemColors.InactiveCaption;
  295. this.ultraGrid1.DisplayLayout.Appearance = appearance1;
  296. appearance2.BackColor = System.Drawing.Color.LightGoldenrodYellow;
  297. ultraGridColumn1.CellAppearance = appearance2;
  298. appearance3.BackColor = System.Drawing.Color.LightSteelBlue;
  299. ultraGridColumn1.Header.Appearance = appearance3;
  300. ultraGridColumn1.Header.VisiblePosition = 0;
  301. ultraGridColumn2.Header.VisiblePosition = 1;
  302. appearance4.BackColor = System.Drawing.Color.LightGoldenrodYellow;
  303. ultraGridColumn3.CellAppearance = appearance4;
  304. appearance5.BackColor = System.Drawing.Color.LightSteelBlue;
  305. ultraGridColumn3.Header.Appearance = appearance5;
  306. ultraGridColumn3.Header.VisiblePosition = 2;
  307. ultraGridBand1.Columns.AddRange(new object[] {
  308. ultraGridColumn1,
  309. ultraGridColumn2,
  310. ultraGridColumn3});
  311. this.ultraGrid1.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
  312. this.ultraGrid1.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  313. this.ultraGrid1.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
  314. appearance6.BackColor = System.Drawing.SystemColors.ActiveBorder;
  315. appearance6.BackColor2 = System.Drawing.SystemColors.ControlDark;
  316. appearance6.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
  317. appearance6.BorderColor = System.Drawing.SystemColors.Window;
  318. this.ultraGrid1.DisplayLayout.GroupByBox.Appearance = appearance6;
  319. appearance7.ForeColor = System.Drawing.SystemColors.GrayText;
  320. this.ultraGrid1.DisplayLayout.GroupByBox.BandLabelAppearance = appearance7;
  321. this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  322. this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
  323. appearance8.BackColor = System.Drawing.SystemColors.ControlLightLight;
  324. appearance8.BackColor2 = System.Drawing.SystemColors.Control;
  325. appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
  326. appearance8.ForeColor = System.Drawing.SystemColors.GrayText;
  327. this.ultraGrid1.DisplayLayout.GroupByBox.PromptAppearance = appearance8;
  328. this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1;
  329. this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1;
  330. appearance9.BackColor = System.Drawing.SystemColors.Window;
  331. appearance9.ForeColor = System.Drawing.SystemColors.ControlText;
  332. this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance = appearance9;
  333. appearance10.BackColor = System.Drawing.SystemColors.Highlight;
  334. appearance10.ForeColor = System.Drawing.SystemColors.HighlightText;
  335. this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance = appearance10;
  336. this.ultraGrid1.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
  337. this.ultraGrid1.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Dotted;
  338. appearance11.BackColor = System.Drawing.SystemColors.Window;
  339. this.ultraGrid1.DisplayLayout.Override.CardAreaAppearance = appearance11;
  340. appearance12.BorderColor = System.Drawing.Color.Silver;
  341. appearance12.TextTrimming = Infragistics.Win.TextTrimming.EllipsisCharacter;
  342. this.ultraGrid1.DisplayLayout.Override.CellAppearance = appearance12;
  343. this.ultraGrid1.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
  344. this.ultraGrid1.DisplayLayout.Override.CellPadding = 0;
  345. appearance13.BackColor = System.Drawing.SystemColors.Control;
  346. appearance13.BackColor2 = System.Drawing.SystemColors.ControlDark;
  347. appearance13.BackGradientAlignment = Infragistics.Win.GradientAlignment.Element;
  348. appearance13.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
  349. appearance13.BorderColor = System.Drawing.SystemColors.Window;
  350. this.ultraGrid1.DisplayLayout.Override.GroupByRowAppearance = appearance13;
  351. appearance14.BackColor = System.Drawing.Color.LightSteelBlue;
  352. appearance14.ImageHAlign = Infragistics.Win.HAlign.Center;
  353. appearance14.TextHAlign = Infragistics.Win.HAlign.Center;
  354. this.ultraGrid1.DisplayLayout.Override.HeaderAppearance = appearance14;
  355. this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
  356. this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
  357. this.ultraGrid1.DisplayLayout.Override.MinRowHeight = 21;
  358. appearance15.BackColor = System.Drawing.SystemColors.Window;
  359. appearance15.BorderColor = System.Drawing.Color.Silver;
  360. this.ultraGrid1.DisplayLayout.Override.RowAppearance = appearance15;
  361. appearance16.BackColor = System.Drawing.Color.LightSteelBlue;
  362. this.ultraGrid1.DisplayLayout.Override.RowSelectorAppearance = appearance16;
  363. this.ultraGrid1.DisplayLayout.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
  364. this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
  365. this.ultraGrid1.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
  366. appearance17.BackColor = System.Drawing.SystemColors.ControlLight;
  367. this.ultraGrid1.DisplayLayout.Override.TemplateAddRowAppearance = appearance17;
  368. this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
  369. this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
  370. this.ultraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
  371. this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
  372. this.ultraGrid1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  373. this.ultraGrid1.Location = new System.Drawing.Point(0, 80);
  374. this.ultraGrid1.Name = "ultraGrid1";
  375. this.ultraGrid1.Size = new System.Drawing.Size(656, 278);
  376. this.ultraGrid1.TabIndex = 4;
  377. this.ultraGrid1.Text = "ultraGrid1";
  378. this.ultraGrid1.AfterRowActivate += new System.EventHandler(this.ultraGrid1_AfterRowActivate);
  379. //
  380. // ultraExpandableGroupBox1
  381. //
  382. this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
  383. this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
  384. this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(648, 80);
  385. this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 358);
  386. this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
  387. this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(656, 112);
  388. this.ultraExpandableGroupBox1.SupportThemes = false;
  389. this.ultraExpandableGroupBox1.TabIndex = 2;
  390. this.ultraExpandableGroupBox1.Text = " 编辑区域";
  391. this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
  392. //
  393. // ultraExpandableGroupBoxPanel1
  394. //
  395. this.ultraExpandableGroupBoxPanel1.Controls.Add(this.panel3);
  396. this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
  397. this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(2, 22);
  398. this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
  399. this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(652, 88);
  400. this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
  401. //
  402. // panel3
  403. //
  404. this.panel3.BackColor = System.Drawing.Color.Gainsboro;
  405. this.panel3.Controls.Add(this.ultraTextEditor4);
  406. this.panel3.Controls.Add(this.ultraLabel4);
  407. this.panel3.Controls.Add(this.ultraComboEditor4);
  408. this.panel3.Controls.Add(this.ultraLabel8);
  409. this.panel3.Controls.Add(this.ultraTextEditor2);
  410. this.panel3.Controls.Add(this.ultraLabel2);
  411. this.panel3.Controls.Add(this.ultraTextEditor1);
  412. this.panel3.Controls.Add(this.ultraLabel1);
  413. this.panel3.Controls.Add(this.ultraLabel3);
  414. this.panel3.Controls.Add(this.ultraComboEditor1);
  415. this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
  416. this.panel3.Location = new System.Drawing.Point(0, 0);
  417. this.panel3.Name = "panel3";
  418. this.panel3.Size = new System.Drawing.Size(652, 88);
  419. this.panel3.TabIndex = 6;
  420. //
  421. // ultraTextEditor4
  422. //
  423. appearance18.BackColor = System.Drawing.Color.LightCyan;
  424. this.ultraTextEditor4.Appearance = appearance18;
  425. this.ultraTextEditor4.AutoSize = true;
  426. this.ultraTextEditor4.BackColor = System.Drawing.Color.LightCyan;
  427. this.ultraTextEditor4.Location = new System.Drawing.Point(73, 56);
  428. this.ultraTextEditor4.Name = "ultraTextEditor4";
  429. this.ultraTextEditor4.Size = new System.Drawing.Size(569, 21);
  430. this.ultraTextEditor4.TabIndex = 25;
  431. //
  432. // ultraLabel4
  433. //
  434. this.ultraLabel4.Location = new System.Drawing.Point(16, 59);
  435. this.ultraLabel4.Name = "ultraLabel4";
  436. this.ultraLabel4.Size = new System.Drawing.Size(54, 16);
  437. this.ultraLabel4.TabIndex = 24;
  438. this.ultraLabel4.Text = "角色描述";
  439. //
  440. // ultraComboEditor4
  441. //
  442. appearance19.BackColor = System.Drawing.Color.LightCyan;
  443. this.ultraComboEditor4.Appearance = appearance19;
  444. this.ultraComboEditor4.AutoSize = true;
  445. this.ultraComboEditor4.ButtonsRight.Add(editorButton1);
  446. this.ultraComboEditor4.DropDownButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Never;
  447. this.ultraComboEditor4.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  448. this.ultraComboEditor4.Location = new System.Drawing.Point(482, 16);
  449. this.ultraComboEditor4.Name = "ultraComboEditor4";
  450. this.ultraComboEditor4.Size = new System.Drawing.Size(160, 21);
  451. this.ultraComboEditor4.TabIndex = 23;
  452. this.ultraComboEditor4.SelectionChanged += new System.EventHandler(this.ultraComboEditor4_SelectionChanged);
  453. this.ultraComboEditor4.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraComboEditor4_EditorButtonClick);
  454. //
  455. // ultraLabel8
  456. //
  457. this.ultraLabel8.Location = new System.Drawing.Point(450, 16);
  458. this.ultraLabel8.Name = "ultraLabel8";
  459. this.ultraLabel8.Size = new System.Drawing.Size(29, 16);
  460. this.ultraLabel8.TabIndex = 22;
  461. this.ultraLabel8.Text = "部门";
  462. //
  463. // ultraTextEditor2
  464. //
  465. appearance20.BackColor = System.Drawing.Color.LightCyan;
  466. this.ultraTextEditor2.Appearance = appearance20;
  467. this.ultraTextEditor2.AutoSize = true;
  468. this.ultraTextEditor2.BackColor = System.Drawing.Color.LightCyan;
  469. this.ultraTextEditor2.Location = new System.Drawing.Point(259, 16);
  470. this.ultraTextEditor2.Name = "ultraTextEditor2";
  471. this.ultraTextEditor2.Size = new System.Drawing.Size(160, 21);
  472. this.ultraTextEditor2.TabIndex = 4;
  473. //
  474. // ultraLabel2
  475. //
  476. this.ultraLabel2.Location = new System.Drawing.Point(202, 16);
  477. this.ultraLabel2.Name = "ultraLabel2";
  478. this.ultraLabel2.Size = new System.Drawing.Size(54, 16);
  479. this.ultraLabel2.TabIndex = 1;
  480. this.ultraLabel2.Text = "角色名称";
  481. //
  482. // ultraTextEditor1
  483. //
  484. appearance21.BackColor = System.Drawing.Color.LightCyan;
  485. this.ultraTextEditor1.Appearance = appearance21;
  486. this.ultraTextEditor1.AutoSize = true;
  487. this.ultraTextEditor1.BackColor = System.Drawing.Color.LightCyan;
  488. this.ultraTextEditor1.Location = new System.Drawing.Point(73, 16);
  489. this.ultraTextEditor1.Name = "ultraTextEditor1";
  490. this.ultraTextEditor1.Size = new System.Drawing.Size(92, 21);
  491. this.ultraTextEditor1.TabIndex = 3;
  492. //
  493. // ultraLabel1
  494. //
  495. this.ultraLabel1.Location = new System.Drawing.Point(16, 16);
  496. this.ultraLabel1.Name = "ultraLabel1";
  497. this.ultraLabel1.Size = new System.Drawing.Size(54, 16);
  498. this.ultraLabel1.TabIndex = 0;
  499. this.ultraLabel1.Text = "角色编码";
  500. //
  501. // ultraLabel3
  502. //
  503. this.ultraLabel3.Location = new System.Drawing.Point(16, 41);
  504. this.ultraLabel3.Name = "ultraLabel3";
  505. this.ultraLabel3.Size = new System.Drawing.Size(54, 16);
  506. this.ultraLabel3.TabIndex = 2;
  507. this.ultraLabel3.Text = "权限文件";
  508. this.ultraLabel3.Visible = false;
  509. //
  510. // ultraComboEditor1
  511. //
  512. appearance22.BackColor = System.Drawing.Color.LightCyan;
  513. this.ultraComboEditor1.Appearance = appearance22;
  514. this.ultraComboEditor1.AutoSize = true;
  515. this.ultraComboEditor1.Location = new System.Drawing.Point(73, 41);
  516. this.ultraComboEditor1.Name = "ultraComboEditor1";
  517. this.ultraComboEditor1.Size = new System.Drawing.Size(109, 21);
  518. this.ultraComboEditor1.TabIndex = 5;
  519. this.ultraComboEditor1.Visible = false;
  520. //
  521. // panel2
  522. //
  523. this.panel2.Controls.Add(this.ultraTextEditor3);
  524. this.panel2.Controls.Add(this.ultraCheckEditor1);
  525. this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
  526. this.panel2.Location = new System.Drawing.Point(0, 32);
  527. this.panel2.Name = "panel2";
  528. this.panel2.Size = new System.Drawing.Size(656, 48);
  529. this.panel2.TabIndex = 3;
  530. //
  531. // ultraTextEditor3
  532. //
  533. appearance23.BackColor = System.Drawing.Color.LightCyan;
  534. this.ultraTextEditor3.Appearance = appearance23;
  535. this.ultraTextEditor3.AutoSize = true;
  536. this.ultraTextEditor3.BackColor = System.Drawing.Color.LightCyan;
  537. editorButton2.Key = "part";
  538. editorButton2.Text = "...";
  539. this.ultraTextEditor3.ButtonsRight.Add(editorButton2);
  540. this.ultraTextEditor3.Enabled = false;
  541. this.ultraTextEditor3.Location = new System.Drawing.Point(88, 8);
  542. this.ultraTextEditor3.Name = "ultraTextEditor3";
  543. this.ultraTextEditor3.ReadOnly = true;
  544. this.ultraTextEditor3.Size = new System.Drawing.Size(168, 21);
  545. this.ultraTextEditor3.TabIndex = 5;
  546. this.ultraTextEditor3.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraTextEditor3_EditorButtonClick);
  547. //
  548. // ultraCheckEditor1
  549. //
  550. this.ultraCheckEditor1.Location = new System.Drawing.Point(40, 8);
  551. this.ultraCheckEditor1.Name = "ultraCheckEditor1";
  552. this.ultraCheckEditor1.Size = new System.Drawing.Size(48, 20);
  553. this.ultraCheckEditor1.TabIndex = 4;
  554. this.ultraCheckEditor1.Text = "部门";
  555. this.ultraCheckEditor1.CheckedChanged += new System.EventHandler(this.ultraCheckEditor1_CheckedChanged);
  556. //
  557. // FrmRole
  558. //
  559. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  560. this.ClientSize = new System.Drawing.Size(656, 470);
  561. this.Controls.Add(this.FrmRole_Fill_Panel);
  562. this.Name = "FrmRole";
  563. this.ShowInTaskbar = false;
  564. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  565. this.Text = "角色管理";
  566. this.WindowState = System.Windows.Forms.FormWindowState.Normal;
  567. this.Load += new System.EventHandler(this.FrmRole_Load);
  568. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
  569. this.panel1.ResumeLayout(false);
  570. this.FrmRole_Fill_Panel.ResumeLayout(false);
  571. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
  572. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
  573. this.ultraExpandableGroupBox1.ResumeLayout(false);
  574. this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
  575. this.panel3.ResumeLayout(false);
  576. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).EndInit();
  577. ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor4)).EndInit();
  578. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).EndInit();
  579. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).EndInit();
  580. ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).EndInit();
  581. this.panel2.ResumeLayout(false);
  582. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).EndInit();
  583. this.ResumeLayout(false);
  584. }
  585. #endregion
  586. #region "显示窗体"
  587. private void GetChildDept()
  588. {
  589. try
  590. {
  591. string strOut = "";
  592. DataSet ds = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("PurviewManager", "Core.Mes.PurviewManager.UAM_USER", "SelectChildDept", new object[] { operDepart }, out strOut) as DataSet;
  593. if (ds.Tables[0].Rows[0][0].ToString() != "")
  594. {
  595. allDept = "'" + ds.Tables[0].Rows[0][0].ToString() + "'" + operDepart + "'";
  596. }
  597. else
  598. allDept = "'" + operDepart + "'";
  599. }
  600. catch(System.Exception ex)
  601. {
  602. System.Diagnostics.Debug.WriteLine(ex.ToString());
  603. }
  604. }
  605. private void FrmRole_Load(object sender, System.EventArgs e)
  606. {
  607. try
  608. {
  609. operDepart = ClientCommon._UserInfo.UserDepID;
  610. GetChildDept();
  611. ultraCheckEditor1.Checked = true;
  612. ultraTextEditor3.Text = ClientCommon._UserInfo.UserDepName;
  613. ultraTextEditor3.Tag = allDept;
  614. if (!IsAdminFlag)
  615. this.ultraToolbarsManager1.Tools["purset"].SharedProps.Visible = false;
  616. GetDepartmentData();
  617. Getroledata("");
  618. Query();
  619. GetFileNames();
  620. InitGrid();
  621. InitCombo();
  622. this.ultraGrid1.DisplayLayout.Bands[0].Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.True;
  623. }
  624. catch //(Exception ex)
  625. {
  626. // Core.Mes.ServerFrameWork.CoreMesLogger.log(this.GetType()).Error(ex.Message);
  627. }
  628. }
  629. private void InitCombo()
  630. {
  631. // if (_roleData != null && _roleData.Tables.Count >0)
  632. // {
  633. // foreach(DataRow arow in (_roleData).Tables[0].Rows)
  634. // this.ultraComboEditor3.Items.Add(arow[1]);
  635. // if(!this.ultraComboEditor3.Items.Contains(System.DBNull.Value)) this.ultraComboEditor3.Items.Add(System.DBNull.Value);
  636. // }
  637. if (_departmentData != null && _departmentData.Tables.Count > 0)
  638. {
  639. DataTable dt = this._departmentData.Tables[0].Copy();
  640. this.ultraComboEditor4.Items.Clear();
  641. foreach (DataRow dr in dt.Rows)
  642. {
  643. if (dr["DEPARTMENTID"].ToString() == "ROOT" && operDepart != "ROOT") continue;
  644. try
  645. {
  646. this.ultraComboEditor4.Items.Add(dr["DEPARTMENTID"], dr["DEPARTMENTNAME"].ToString());
  647. }
  648. catch
  649. { }
  650. }
  651. }
  652. }
  653. private void InitGrid()
  654. {
  655. //SetFileValueList();
  656. GetPartData();
  657. //this.ultraGrid1.DataSource = _roleData.Tables[0];
  658. this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Caption = "角色编码";
  659. this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Width = 100;
  660. this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.NoEdit;
  661. this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.BackColor = Color.LightGoldenrodYellow;
  662. this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Header.Caption = "角色名称";
  663. this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Width = 200;
  664. this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellActivation = Activation.NoEdit;
  665. this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Header.Caption = "角色描述";
  666. this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Width = 300;
  667. this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellActivation = Activation.NoEdit;
  668. //this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].ValueList = ultraGrid1.DisplayLayout.ValueLists["file"];
  669. this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellAppearance.BackColor = Color.LightGoldenrodYellow;
  670. this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Header.Caption = "部门";
  671. this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Width = 200;
  672. this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellActivation = Activation.NoEdit;
  673. this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].ValueList = ultraGrid1.DisplayLayout.ValueLists["part"];
  674. }
  675. private void Getroledata(string str)
  676. {
  677. try
  678. {
  679. CallingMessage par = new CallingMessage();
  680. par.ServerName = "PurviewManager";
  681. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  682. par.MethodName = "SelectUAM_ROLE";
  683. par.args = new object[] { str };
  684. string strOut = "";
  685. _roleData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  686. }
  687. catch (Exception ex)
  688. {
  689. Console.WriteLine(ex.Message);
  690. }
  691. }
  692. private void SetFileValueList()
  693. {
  694. if (ultraGrid1.DisplayLayout.ValueLists.Exists("file"))
  695. ultraGrid1.DisplayLayout.ValueLists["file"].ValueListItems.Clear();
  696. else
  697. ultraGrid1.DisplayLayout.ValueLists.Add("file");
  698. //try
  699. //{
  700. // ultraGrid1.DisplayLayout.ValueLists["file"].ValueListItems.Clear();
  701. //}
  702. //catch
  703. //{
  704. // ultraGrid1.DisplayLayout.ValueLists.Add("file");
  705. //}
  706. foreach (string str in this._fileNames)
  707. {
  708. Infragistics.Win.ValueListItem vli = new Infragistics.Win.ValueListItem();
  709. vli.DisplayText = str.Split((char)92)[1];
  710. vli.DataValue = str.Split((char)92)[1];
  711. ultraGrid1.DisplayLayout.ValueLists["file"].ValueListItems.Add(vli);
  712. this.ultraComboEditor1.Items.Add(vli.DataValue, vli.DisplayText);
  713. // this.ultraComboEditor2.Items.Add(vli);
  714. }
  715. }
  716. private void GetFileNames()
  717. {
  718. try
  719. {
  720. CallingMessage par = new CallingMessage();
  721. par.ServerName = "PurviewManager";
  722. //par.AssemblyName = "Core.Mes.PurviewManager";
  723. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  724. par.MethodName = "GetFiles";
  725. par.args = null;
  726. par.ServerType = MesServerType.MesSystemBaseServer;
  727. string strOut = "";
  728. _fileNames = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as string[];
  729. }
  730. catch //(Exception ex)
  731. {
  732. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  733. }
  734. }
  735. private void GetPartData()
  736. {
  737. if (ultraGrid1.DisplayLayout.ValueLists.Exists("part"))
  738. ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
  739. else
  740. ultraGrid1.DisplayLayout.ValueLists.Add("part");
  741. //try
  742. //{
  743. // ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
  744. //}
  745. //catch
  746. //{
  747. // ultraGrid1.DisplayLayout.ValueLists.Add("part");
  748. //}
  749. DataTable dt = this._departmentData.Tables[0].Copy();
  750. foreach (DataRow dr in dt.Rows)
  751. {
  752. Infragistics.Win.ValueListItem vli = new Infragistics.Win.ValueListItem();
  753. vli.DisplayText = dr["DEPARTMENTNAME"].ToString();
  754. vli.DataValue = dr["DEPARTMENTID"];
  755. ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Add(vli);
  756. }
  757. }
  758. #endregion
  759. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  760. {
  761. switch (e.Tool.Key)
  762. {
  763. case "purset":
  764. FrmFunction frmFunc = new FrmFunction();
  765. frmFunc.ShowDialog();
  766. break;
  767. case "add":
  768. Add();
  769. break;
  770. case "edit":
  771. Edit();
  772. break;
  773. case "del":
  774. Del();
  775. break;
  776. case "query":
  777. Query();
  778. break;
  779. case "close":
  780. this.Close();
  781. break;
  782. case "back":
  783. this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible = false;
  784. ultraCheckEditor1.Checked = true;
  785. ultraTextEditor3.Text = ClientCommon._UserInfo.UserDepName;
  786. ultraTextEditor3.Tag = allDept;
  787. Query();
  788. this.ultraGrid1.DataSource = _roleData.Tables[0];
  789. break;
  790. }
  791. }
  792. private void Add()
  793. {
  794. if (this.ultraTextEditor1.Text.Trim() == "")
  795. {
  796. MessageBox.Show("请录入角色编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  797. return;
  798. }
  799. if (this.ultraTextEditor2.Text.Trim() == "")
  800. {
  801. MessageBox.Show("请录入角色姓名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  802. return;
  803. }
  804. //if (this.ultraComboEditor1.Value == null)
  805. //{
  806. // MessageBox.Show("请选择权限文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  807. // return;
  808. //}
  809. if (this.ultraComboEditor4.Value == null)
  810. {
  811. MessageBox.Show("请选择角色所属的部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  812. return;
  813. }
  814. if (this.ultraComboEditor4.Value.ToString() == "ROOT")
  815. {
  816. this.ultraComboEditor4.Value = null;
  817. MessageBox.Show("必须选择下属部门!");
  818. return;
  819. }
  820. if (allDept.IndexOf("'" + ultraComboEditor4.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  821. {
  822. this.ultraComboEditor4.Value = null;
  823. MessageBox.Show("你没有配置这一部门角色的权限,请重新选择部门!");
  824. return;
  825. }
  826. ArrayList al = new ArrayList();
  827. al.Add(this.ultraTextEditor1.Text.Trim());
  828. al.Add(this.ultraTextEditor2.Text.Trim());
  829. al.Add(ultraTextEditor4.Text.Trim());
  830. al.Add(this.ultraComboEditor4.Value);
  831. try
  832. {
  833. CallingMessage par = new CallingMessage();
  834. par.ServerName = "PurviewManager";
  835. //par.AssemblyName = "Core.Mes.PurviewManager";
  836. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  837. par.MethodName = "InsertUAM_ROLE";
  838. par.args = new object[] { al };
  839. par.ServerType = MesServerType.MesSystemBaseServer;
  840. string strOut = "";
  841. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  842. if (strOut != "")
  843. {
  844. MessageBox.Show("新增失败! \n" + strOut);
  845. return;
  846. }
  847. else
  848. {
  849. if ((int)obj != 1)
  850. {
  851. MessageBox.Show("新增失败!");
  852. return;
  853. }
  854. }
  855. }
  856. catch //(Exception ex)
  857. {
  858. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  859. return;
  860. }
  861. UltraGridRow ugr = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
  862. ugr.Cells[0].Value = al[0];
  863. ugr.Cells[1].Value = al[1];
  864. ugr.Cells[2].Value = al[2];
  865. this.ultraGrid1.UpdateData();
  866. Query();
  867. }
  868. private void Del()
  869. {
  870. int i = 0;
  871. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  872. if (ugr == null)
  873. {
  874. MessageBox.Show("请选择要删除的角色!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  875. return;
  876. }
  877. if (MessageBox.Show("是否确认删除选中的角色?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  878. {
  879. return;
  880. }
  881. try
  882. {
  883. i = ugr.Index;
  884. CallingMessage par = new CallingMessage();
  885. par.ServerName = "PurviewManager";
  886. //par.AssemblyName = "Core.Mes.PurviewManager";
  887. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  888. par.MethodName = "DeleteUAM_ROLE";
  889. par.args = new object[] { ugr.Cells[0].Value.ToString() };
  890. par.ServerType = MesServerType.MesSystemBaseServer;
  891. string strOut = "";
  892. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  893. if (strOut != "")
  894. {
  895. MessageBox.Show("删除失败! \n" + strOut);
  896. return;
  897. }
  898. else
  899. {
  900. if ((int)obj != 1)
  901. {
  902. MessageBox.Show("删除失败!");
  903. return;
  904. }
  905. }
  906. }
  907. catch //(Exception ex)
  908. {
  909. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  910. return;
  911. }
  912. ultraGrid1.ActiveRow.Delete(false);
  913. ultraGrid1.UpdateData();
  914. try
  915. {
  916. ultraGrid1.Rows[i].Activate();
  917. }
  918. catch
  919. {
  920. int count = ultraGrid1.Rows.Count;
  921. if (count > 0)
  922. ultraGrid1.Rows[count - 1].Activate();
  923. }
  924. }
  925. private void Edit()
  926. {
  927. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  928. if (ugr == null)
  929. {
  930. MessageBox.Show("请选择要修改的角色!");
  931. return;
  932. }
  933. if (ultraTextEditor1.Text.Trim() != ugr.Cells["ROLEID"].Text.Trim())
  934. {
  935. MessageBox.Show("不能修改角色编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  936. return;
  937. }
  938. //if (this.ultraComboEditor1.Value == null)
  939. //{
  940. // MessageBox.Show("请选择要修改的权限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  941. // return;
  942. //}
  943. if (this.ultraTextEditor2.Text.Trim() == "")
  944. {
  945. MessageBox.Show("请选择要修改的角色名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  946. return;
  947. }
  948. if (this.ultraComboEditor4.Value == null)
  949. {
  950. MessageBox.Show("请选择修改的角色所属部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  951. return;
  952. }
  953. if (this.ultraComboEditor4.Value.ToString() == "ROOT")
  954. {
  955. this.ultraComboEditor4.Value = null;
  956. MessageBox.Show("必须选择下属部门!");
  957. return;
  958. }
  959. if (allDept.IndexOf("'" + ultraComboEditor4.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  960. {
  961. this.ultraComboEditor4.Value = null;
  962. MessageBox.Show("你没有配置这一部门角色的权限,请重新选择部门!");
  963. return;
  964. }
  965. ArrayList al = new ArrayList();
  966. al.Add(this.ultraTextEditor1.Text.Trim());
  967. al.Add(this.ultraTextEditor2.Text.Trim());
  968. al.Add(ultraTextEditor4.Text.Trim());
  969. al.Add(this.ultraComboEditor4.Value);
  970. try
  971. {
  972. CallingMessage par = new CallingMessage();
  973. par.ServerName = "PurviewManager";
  974. //par.AssemblyName = "Core.Mes.PurviewManager";
  975. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  976. par.MethodName = "UpdateUAM_ROLE";
  977. par.args = new object[] { al };
  978. par.ServerType = MesServerType.MesSystemBaseServer;
  979. string strOut = "";
  980. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  981. if (strOut != "")
  982. {
  983. MessageBox.Show("修改失败 \n" + strOut);
  984. return;
  985. }
  986. else
  987. {
  988. int i = (int)obj;
  989. if (i != 1)
  990. {
  991. MessageBox.Show("修改失败");
  992. return;
  993. }
  994. }
  995. }
  996. catch //(Exception ex)
  997. {
  998. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  999. return;
  1000. }
  1001. ugr.Cells[0].Value = al[0];
  1002. ugr.Cells[1].Value = al[1];
  1003. ugr.Cells[2].Value = al[2];
  1004. ultraGrid1.UpdateData();
  1005. Query();
  1006. }
  1007. private void Query()
  1008. {
  1009. if (this.ultraTextEditor3.Text == null || !this.ultraCheckEditor1.Checked)
  1010. {
  1011. MessageBox.Show("请选择要查询的部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1012. return;
  1013. }
  1014. GetSelDept();
  1015. if (this.ultraCheckEditor1.Checked && this.ultraTextEditor3.Text != "")
  1016. {
  1017. if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
  1018. {
  1019. MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
  1020. return;
  1021. }
  1022. }
  1023. Getroledata("");
  1024. string sqlExt = " where 1=1 ";
  1025. sqlExt += GetRefreshWhere() + "order by ROLEID";
  1026. try
  1027. {
  1028. CallingMessage par = new CallingMessage();
  1029. par.ServerName = "PurviewManager";
  1030. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1031. par.MethodName = "SelectUAM_ROLE";
  1032. par.args = new object[] { sqlExt };
  1033. string strOut = "";
  1034. DataSet dset = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  1035. this.ultraGrid1.DataSource = dset.Tables[0];
  1036. ultraGrid1.UpdateData();
  1037. this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible = true;
  1038. }
  1039. catch (Exception ex)
  1040. {
  1041. Console.WriteLine(ex.Message);
  1042. }
  1043. }
  1044. private string GetRefreshWhere()
  1045. {
  1046. string sqlstr = "";
  1047. if (this.ultraTextEditor3.Enabled && this.ultraCheckEditor1.Checked && this.ultraTextEditor3.Text != "")
  1048. {
  1049. ArrayList al = this.GetRoleID();
  1050. if (al == null || al.Count == 0)
  1051. {
  1052. sqlstr = "1=2";
  1053. }
  1054. else
  1055. {
  1056. sqlstr += "and ROLEID in ('" + al[0].ToString() + "'";
  1057. for (int i = 1; i < al.Count; i++)
  1058. {
  1059. sqlstr += ", '" + al[i].ToString() + "' ";
  1060. }
  1061. sqlstr += ")";
  1062. }
  1063. }
  1064. return sqlstr;
  1065. }
  1066. private ArrayList GetRoleID()
  1067. {
  1068. ArrayList al = new ArrayList();
  1069. DataTable dt = null;
  1070. if (this._roleData == null)
  1071. dt = null;
  1072. else
  1073. dt = this._roleData.Tables[0];
  1074. if (dt != null)
  1075. {
  1076. if (this.ultraTextEditor3.Enabled && this.ultraTextEditor3.Tag != null)
  1077. {
  1078. string partid = this.ultraTextEditor3.Tag.ToString();
  1079. string strFilter = "DEPARTMENTID in (" + partid + ")";
  1080. dt.DefaultView.RowFilter = strFilter;
  1081. }
  1082. for (int i = 0; i < dt.DefaultView.Count; i++)
  1083. {
  1084. al.Add(dt.DefaultView[i]["ROLEID"].ToString());
  1085. }
  1086. return al;
  1087. }
  1088. else
  1089. return null;
  1090. }
  1091. private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
  1092. {
  1093. try
  1094. {
  1095. if (this.ultraGrid1.ActiveRow == null) return;
  1096. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  1097. this.ultraTextEditor1.Text = ugr.Cells[0].Value.ToString();
  1098. this.ultraTextEditor2.Text = ugr.Cells[1].Value.ToString();
  1099. //this.ultraComboEditor1.Value=ugr.Cells[2].Value;
  1100. ultraTextEditor4.Text = ugr.Cells[2].Value.ToString();
  1101. this.ultraComboEditor4.Value = ugr.Cells[3].Value;
  1102. }
  1103. catch (Exception ex)
  1104. {
  1105. Console.WriteLine(ex.Message);
  1106. }
  1107. }
  1108. private void ultraCheckEditor1_CheckedChanged(object sender, System.EventArgs e)
  1109. {
  1110. this.ultraTextEditor3.Enabled = this.ultraCheckEditor1.Checked;
  1111. }
  1112. /* private void ultraComboEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1113. {
  1114. GetFileNames();
  1115. if (_fileNames != null)
  1116. {
  1117. foreach(string fileNames in _fileNames)
  1118. this.ultraComboEditor2 .Items .Add (fileNames);
  1119. if(!this.ultraComboEditor2.Items.Contains(System.DBNull.Value)) this.ultraComboEditor2.Items.Add(System.DBNull.Value);
  1120. }
  1121. }
  1122. */
  1123. private void ultraComboEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1124. {
  1125. try
  1126. {
  1127. FrmSetDepart frm = new FrmSetDepart();
  1128. frm.GetChildIDFlag = false;
  1129. frm.Location = GetChildWindowLocation(frm.Size);
  1130. frm.ShowDialog();
  1131. InitCombo();
  1132. if (frm.SelectedID != "" && frm.SelectedName != "")
  1133. {
  1134. this.ultraComboEditor4.Value = frm.SelectedID;
  1135. if (operDepart != "ROOT" && this.ultraComboEditor4.Value.ToString() == "ROOT")
  1136. {
  1137. this.ultraComboEditor4.Value = null;
  1138. MessageBox.Show("所属权限不允许选择选择整个公司!");
  1139. return;
  1140. }
  1141. if (allDept.IndexOf("'" + ultraComboEditor4.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1142. {
  1143. this.ultraComboEditor4.Value = null;
  1144. MessageBox.Show("你没有配置这一部门用户的权限,请重新选择部门!");
  1145. return;
  1146. }
  1147. }
  1148. }
  1149. catch
  1150. { }
  1151. }
  1152. private Point GetChildWindowLocation(Size ChildWindowSize)
  1153. {
  1154. int width = Cursor.Position.X + ChildWindowSize.Width - Screen.PrimaryScreen.Bounds.Width;
  1155. int height = Cursor.Position.Y + ChildWindowSize.Height - Screen.PrimaryScreen.Bounds.Height + 30;
  1156. if (width > 0)
  1157. width = Cursor.Position.X - width;
  1158. else
  1159. width = Cursor.Position.X;
  1160. if (height > 0)
  1161. height = Cursor.Position.Y - height + 10;
  1162. else
  1163. height = Cursor.Position.Y + 10;
  1164. return new Point(width, height);
  1165. }
  1166. private void GetDepartmentData()
  1167. {
  1168. try
  1169. {
  1170. CallingMessage par = new CallingMessage();
  1171. par.ServerName = "PurviewManager";
  1172. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1173. par.MethodName = "SelectUAM_DEPARTMENT";
  1174. par.args = new object[] { " order by DEPARTMENTID " };
  1175. string strOut = "";
  1176. _departmentData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  1177. }
  1178. catch
  1179. { }
  1180. }
  1181. private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1182. {
  1183. try
  1184. {
  1185. FrmSetDepart frm = new FrmSetDepart();
  1186. frm.Location = GetChildWindowLocation(frm.Size);
  1187. frm.ShowDialog();
  1188. if (frm.SelectedID != "" && frm.SelectedName != "")
  1189. {
  1190. this.ultraTextEditor3.Text = frm.SelectedName;
  1191. this.ultraTextEditor3.Tag = frm.SelectedID;
  1192. GetSelDept();
  1193. if (this.ultraTextEditor3.Text != "" && this.ultraCheckEditor1.Checked)
  1194. {
  1195. if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
  1196. {
  1197. MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
  1198. }
  1199. }
  1200. }
  1201. }
  1202. catch
  1203. { }
  1204. }
  1205. private void ultraComboEditor4_SelectionChanged(object sender, EventArgs e)
  1206. {
  1207. try
  1208. {
  1209. if (operDepart != "ROOT" && ultraComboEditor4.Value.ToString() == "ROOT")
  1210. {
  1211. this.ultraComboEditor4.Value = null;
  1212. MessageBox.Show("所属权限不允许选择选择整个公司!");
  1213. return;
  1214. }
  1215. if (ultraComboEditor4.Value != null && allDept.IndexOf("'" + ultraComboEditor4.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1216. {
  1217. this.ultraComboEditor4.Value = null;
  1218. MessageBox.Show("你没有配置这一部门用户的权限,请重新选择部门!");
  1219. return;
  1220. }
  1221. }
  1222. catch
  1223. { }
  1224. }
  1225. private void GetSelDept()
  1226. {
  1227. try
  1228. {
  1229. if (this.ultraTextEditor3.Text != "" && this.ultraCheckEditor1.Checked)
  1230. {
  1231. DataTable dt = this._departmentData.Tables[0].Copy();
  1232. foreach (DataRow dr in dt.Rows)
  1233. {
  1234. if (dr["DEPARTMENTNAME"].ToString() == this.ultraTextEditor3.Text)
  1235. {
  1236. selDept = dr["DEPARTMENTID"].ToString();
  1237. return;
  1238. }
  1239. }
  1240. }
  1241. }
  1242. catch
  1243. { }
  1244. }
  1245. }
  1246. }