034193745920cc18d36bb5a258f310228edf361a.svn-base 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using Core.Mes.ClientFrameWork;
  7. using Core.Mes.IBaseInterface;
  8. using global::Infragistics.Win.UltraWinGrid;
  9. using global::Infragistics.Win.UltraWinEditors;
  10. using System.Data;
  11. using System.Diagnostics;
  12. using System.IO;
  13. using System.Text.RegularExpressions;
  14. namespace Core.Mes.ClientPurviewManager
  15. {
  16. /// <summary>
  17. /// FrmUserManager 的摘要说明。
  18. /// </summary>
  19. public class FrmUserManager : Core.Mes.ClientFrameWork.FrmBase
  20. {
  21. #region "Varible"
  22. private System.Windows.Forms.Panel panel1;
  23. private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
  24. private System.Windows.Forms.Panel FrmUserManager_Fill_Panel;
  25. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left;
  26. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right;
  27. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top;
  28. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom;
  29. private System.Windows.Forms.Panel panel2;
  30. private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
  31. private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
  32. private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
  33. private System.Windows.Forms.Panel panel3;
  34. private Infragistics.Win.Misc.UltraLabel ultraLabel2;
  35. private Infragistics.Win.Misc.UltraLabel ultraLabel3;
  36. private Infragistics.Win.Misc.UltraLabel ultraLabel4;
  37. private Infragistics.Win.Misc.UltraLabel ultraLabel5;
  38. private Infragistics.Win.Misc.UltraLabel ultraLabel6;
  39. private Infragistics.Win.Misc.UltraLabel ultraLabel7;
  40. private Infragistics.Win.Misc.UltraLabel ultraLabel8;
  41. private Infragistics.Win.Misc.UltraLabel ultraLabel9;
  42. private Infragistics.Win.Misc.UltraLabel ultraLabel10;
  43. private Infragistics.Win.Misc.UltraLabel ultraLabel11;
  44. private Infragistics.Win.UltraWinEditors.UltraComboEditor ulcmeSex;
  45. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtUserNo;
  46. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtUserName;
  47. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtAge;
  48. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtGW;
  49. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtZW;
  50. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtPhono;
  51. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtMemo;
  52. private Infragistics.Win.Misc.UltraButton ultraButton1;
  53. private System.ComponentModel.IContainer components;
  54. private DataSet _departmentData;
  55. public TreeView _departmentTree;
  56. private string _selectPartSQL;
  57. public string StrUser = "";
  58. public string operDepart = "";
  59. public string operDepartname = "";
  60. public string allDept = "";
  61. public string selDept = "";
  62. private DataSet _userData;
  63. private Infragistics.Win.UltraWinEditors.UltraComboEditor ulcmeDepartment;
  64. private System.Windows.Forms.ToolTip toolTip1;
  65. private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor1;
  66. private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor8;
  67. private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ultraGridExcelExporter1;
  68. private UltraTextEditor ultxtEmail;
  69. private Infragistics.Win.Misc.UltraLabel ultraLabel1;
  70. private UltraTextEditor ultLoginID;
  71. private Infragistics.Win.Misc.UltraLabel ultraLabel12;
  72. private FlowLayoutPanel flowLayoutPanel1;
  73. private string _selectUserSQL;
  74. #endregion
  75. #region "头部"
  76. public FrmUserManager()
  77. {
  78. //
  79. // Windows 窗体设计器支持所必需的
  80. //
  81. InitializeComponent();
  82. //
  83. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  84. //
  85. }
  86. /// <summary>
  87. /// 清理所有正在使用的资源。
  88. /// </summary>
  89. protected override void Dispose(bool disposing)
  90. {
  91. if (disposing)
  92. {
  93. if (components != null)
  94. {
  95. components.Dispose();
  96. }
  97. }
  98. base.Dispose(disposing);
  99. }
  100. #endregion
  101. #region Windows 窗体设计器生成的代码
  102. /// <summary>
  103. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  104. /// 此方法的内容。
  105. /// </summary>
  106. private void InitializeComponent()
  107. {
  108. this.components = new System.ComponentModel.Container();
  109. Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("Toolbar1");
  110. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  111. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
  112. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
  113. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
  114. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
  115. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
  116. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("leadin");
  117. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
  118. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
  119. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
  120. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  121. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
  122. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
  123. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("leadin");
  124. Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
  125. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("USERID");
  126. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("DEPARTMENTID", -1, null, 1, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
  127. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("NAME");
  128. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("SEX");
  129. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("AGE");
  130. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn6 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("COMPUTERIP");
  131. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn7 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("HOMEPHONE");
  132. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn8 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("WORKPOS");
  133. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn9 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("WORKJOB");
  134. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn10 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("MEMO");
  135. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn11 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("EMAIL");
  136. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn12 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("PD", -1, null, 0, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
  137. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  138. Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
  139. Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
  140. Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
  141. Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
  142. Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
  143. Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
  144. Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
  145. Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
  146. Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
  147. Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
  148. Infragistics.Win.ValueListItem valueListItem4 = new Infragistics.Win.ValueListItem();
  149. Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
  150. Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
  151. this.panel1 = new System.Windows.Forms.Panel();
  152. this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  153. this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
  154. this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  155. this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  156. this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  157. this.FrmUserManager_Fill_Panel = new System.Windows.Forms.Panel();
  158. this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  159. this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
  160. this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
  161. this.panel3 = new System.Windows.Forms.Panel();
  162. this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
  163. this.ultxtEmail = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  164. this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
  165. this.ulcmeDepartment = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  166. this.ultxtMemo = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  167. this.ultxtPhono = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  168. this.ultxtZW = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  169. this.ultxtGW = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  170. this.ultxtAge = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  171. this.ultxtUserName = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  172. this.ultxtUserNo = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  173. this.ulcmeSex = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  174. this.ultraLabel11 = new Infragistics.Win.Misc.UltraLabel();
  175. this.ultraLabel10 = new Infragistics.Win.Misc.UltraLabel();
  176. this.ultraLabel9 = new Infragistics.Win.Misc.UltraLabel();
  177. this.ultraLabel8 = new Infragistics.Win.Misc.UltraLabel();
  178. this.ultraLabel7 = new Infragistics.Win.Misc.UltraLabel();
  179. this.ultraLabel6 = new Infragistics.Win.Misc.UltraLabel();
  180. this.ultraLabel5 = new Infragistics.Win.Misc.UltraLabel();
  181. this.ultraLabel4 = new Infragistics.Win.Misc.UltraLabel();
  182. this.ultraLabel3 = new Infragistics.Win.Misc.UltraLabel();
  183. this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
  184. this.panel2 = new System.Windows.Forms.Panel();
  185. this.ultLoginID = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  186. this.ultraLabel12 = new Infragistics.Win.Misc.UltraLabel();
  187. this.ultraTextEditor8 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
  188. this.ultraCheckEditor1 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
  189. this.ultraButton1 = new Infragistics.Win.Misc.UltraButton();
  190. this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
  191. this.ultraGridExcelExporter1 = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter();
  192. this.panel1.SuspendLayout();
  193. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
  194. this.FrmUserManager_Fill_Panel.SuspendLayout();
  195. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
  196. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
  197. this.ultraExpandableGroupBox1.SuspendLayout();
  198. this.ultraExpandableGroupBoxPanel1.SuspendLayout();
  199. this.panel3.SuspendLayout();
  200. ((System.ComponentModel.ISupportInitialize)(this.ultxtEmail)).BeginInit();
  201. ((System.ComponentModel.ISupportInitialize)(this.ulcmeDepartment)).BeginInit();
  202. ((System.ComponentModel.ISupportInitialize)(this.ultxtMemo)).BeginInit();
  203. ((System.ComponentModel.ISupportInitialize)(this.ultxtPhono)).BeginInit();
  204. ((System.ComponentModel.ISupportInitialize)(this.ultxtZW)).BeginInit();
  205. ((System.ComponentModel.ISupportInitialize)(this.ultxtGW)).BeginInit();
  206. ((System.ComponentModel.ISupportInitialize)(this.ultxtAge)).BeginInit();
  207. ((System.ComponentModel.ISupportInitialize)(this.ultxtUserName)).BeginInit();
  208. ((System.ComponentModel.ISupportInitialize)(this.ultxtUserNo)).BeginInit();
  209. ((System.ComponentModel.ISupportInitialize)(this.ulcmeSex)).BeginInit();
  210. this.panel2.SuspendLayout();
  211. ((System.ComponentModel.ISupportInitialize)(this.ultLoginID)).BeginInit();
  212. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor8)).BeginInit();
  213. this.SuspendLayout();
  214. //
  215. // panel1
  216. //
  217. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left);
  218. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right);
  219. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top);
  220. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom);
  221. this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
  222. this.panel1.Location = new System.Drawing.Point(0, 0);
  223. this.panel1.Name = "panel1";
  224. this.panel1.Size = new System.Drawing.Size(1012, 32);
  225. this.panel1.TabIndex = 0;
  226. //
  227. // _panel1_Toolbars_Dock_Area_Left
  228. //
  229. this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  230. this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
  231. this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
  232. this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
  233. this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 27);
  234. this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left";
  235. this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 5);
  236. this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
  237. //
  238. // ultraToolbarsManager1
  239. //
  240. this.ultraToolbarsManager1.DesignerFlags = 1;
  241. this.ultraToolbarsManager1.DockWithinContainer = this.panel1;
  242. this.ultraToolbarsManager1.ShowQuickCustomizeButton = false;
  243. this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005;
  244. ultraToolbar1.DockedColumn = 0;
  245. ultraToolbar1.DockedRow = 0;
  246. ultraToolbar1.Text = "Toolbar1";
  247. buttonTool1.InstanceProps.IsFirstInGroup = true;
  248. buttonTool2.InstanceProps.IsFirstInGroup = true;
  249. buttonTool3.InstanceProps.IsFirstInGroup = true;
  250. buttonTool4.InstanceProps.IsFirstInGroup = true;
  251. buttonTool5.InstanceProps.IsFirstInGroup = true;
  252. buttonTool6.InstanceProps.IsFirstInGroup = true;
  253. buttonTool7.InstanceProps.IsFirstInGroup = true;
  254. ultraToolbar1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  255. buttonTool1,
  256. buttonTool2,
  257. buttonTool3,
  258. buttonTool4,
  259. buttonTool5,
  260. buttonTool6,
  261. buttonTool7});
  262. this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
  263. ultraToolbar1});
  264. buttonTool8.SharedProps.Caption = "新增(&A)";
  265. buttonTool8.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  266. buttonTool8.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
  267. buttonTool9.SharedProps.Caption = "修改(&U)";
  268. buttonTool9.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  269. buttonTool9.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlU;
  270. buttonTool10.SharedProps.Caption = "删除(&D)";
  271. buttonTool10.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  272. buttonTool10.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
  273. buttonTool11.SharedProps.Caption = "查询(&Q)";
  274. buttonTool11.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  275. buttonTool11.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlQ;
  276. buttonTool12.SharedProps.Caption = "关闭(&E)";
  277. buttonTool12.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  278. buttonTool12.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
  279. buttonTool13.SharedProps.Caption = "返回(&B)";
  280. buttonTool13.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  281. buttonTool13.SharedProps.Visible = false;
  282. buttonTool14.SharedProps.Caption = "导入EXCEL";
  283. buttonTool14.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  284. this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  285. buttonTool8,
  286. buttonTool9,
  287. buttonTool10,
  288. buttonTool11,
  289. buttonTool12,
  290. buttonTool13,
  291. buttonTool14});
  292. this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
  293. //
  294. // _panel1_Toolbars_Dock_Area_Right
  295. //
  296. this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  297. this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
  298. this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
  299. this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
  300. this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(1012, 27);
  301. this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right";
  302. this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 5);
  303. this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
  304. //
  305. // _panel1_Toolbars_Dock_Area_Top
  306. //
  307. this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  308. this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
  309. this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
  310. this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
  311. this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
  312. this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top";
  313. this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(1012, 27);
  314. this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
  315. //
  316. // _panel1_Toolbars_Dock_Area_Bottom
  317. //
  318. this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  319. this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
  320. this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
  321. this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
  322. this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 32);
  323. this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom";
  324. this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(1012, 0);
  325. this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
  326. //
  327. // FrmUserManager_Fill_Panel
  328. //
  329. this.FrmUserManager_Fill_Panel.Controls.Add(this.ultraGrid1);
  330. this.FrmUserManager_Fill_Panel.Controls.Add(this.ultraExpandableGroupBox1);
  331. this.FrmUserManager_Fill_Panel.Controls.Add(this.panel2);
  332. this.FrmUserManager_Fill_Panel.Controls.Add(this.panel1);
  333. this.FrmUserManager_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
  334. this.FrmUserManager_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
  335. this.FrmUserManager_Fill_Panel.Location = new System.Drawing.Point(0, 0);
  336. this.FrmUserManager_Fill_Panel.Name = "FrmUserManager_Fill_Panel";
  337. this.FrmUserManager_Fill_Panel.Size = new System.Drawing.Size(1012, 733);
  338. this.FrmUserManager_Fill_Panel.TabIndex = 0;
  339. //
  340. // ultraGrid1
  341. //
  342. this.ultraGrid1.Cursor = System.Windows.Forms.Cursors.Hand;
  343. ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  344. ultraGridColumn1.Header.Caption = "员工编号";
  345. ultraGridColumn1.Header.VisiblePosition = 0;
  346. ultraGridColumn1.Width = 80;
  347. ultraGridColumn2.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  348. ultraGridColumn2.Header.Caption = "部门";
  349. ultraGridColumn2.Header.VisiblePosition = 2;
  350. ultraGridColumn2.Width = 100;
  351. ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  352. ultraGridColumn3.Header.Caption = "姓名";
  353. ultraGridColumn3.Header.VisiblePosition = 5;
  354. ultraGridColumn3.Width = 80;
  355. ultraGridColumn4.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  356. ultraGridColumn4.Header.Caption = "性别";
  357. ultraGridColumn4.Header.VisiblePosition = 6;
  358. ultraGridColumn4.Width = 60;
  359. ultraGridColumn5.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  360. ultraGridColumn5.Header.Caption = "年龄";
  361. ultraGridColumn5.Header.VisiblePosition = 7;
  362. ultraGridColumn5.Hidden = true;
  363. ultraGridColumn6.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  364. ultraGridColumn6.Header.Caption = "机器地址";
  365. ultraGridColumn6.Header.VisiblePosition = 8;
  366. ultraGridColumn6.Width = 80;
  367. ultraGridColumn7.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  368. ultraGridColumn7.Header.Caption = "联系电话";
  369. ultraGridColumn7.Header.VisiblePosition = 9;
  370. ultraGridColumn7.Width = 100;
  371. ultraGridColumn8.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  372. ultraGridColumn8.Header.Caption = "岗位";
  373. ultraGridColumn8.Header.VisiblePosition = 3;
  374. ultraGridColumn8.Width = 100;
  375. ultraGridColumn9.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  376. ultraGridColumn9.Header.Caption = "职务";
  377. ultraGridColumn9.Header.VisiblePosition = 4;
  378. ultraGridColumn9.Width = 100;
  379. ultraGridColumn10.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  380. ultraGridColumn10.Header.Caption = "备注";
  381. ultraGridColumn10.Header.VisiblePosition = 11;
  382. ultraGridColumn10.Width = 100;
  383. ultraGridColumn11.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  384. ultraGridColumn11.Header.Caption = "邮件地址";
  385. ultraGridColumn11.Header.VisiblePosition = 10;
  386. ultraGridColumn11.Width = 100;
  387. ultraGridColumn12.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  388. ultraGridColumn12.Header.Caption = "上级部门";
  389. ultraGridColumn12.Header.VisiblePosition = 1;
  390. ultraGridColumn12.Width = 100;
  391. ultraGridBand1.Columns.AddRange(new object[] {
  392. ultraGridColumn1,
  393. ultraGridColumn2,
  394. ultraGridColumn3,
  395. ultraGridColumn4,
  396. ultraGridColumn5,
  397. ultraGridColumn6,
  398. ultraGridColumn7,
  399. ultraGridColumn8,
  400. ultraGridColumn9,
  401. ultraGridColumn10,
  402. ultraGridColumn11,
  403. ultraGridColumn12});
  404. ultraGridBand1.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
  405. ultraGridBand1.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
  406. ultraGridBand1.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
  407. this.ultraGrid1.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
  408. this.ultraGrid1.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
  409. this.ultraGrid1.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
  410. this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  411. this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
  412. this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1;
  413. this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1;
  414. this.ultraGrid1.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
  415. this.ultraGrid1.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Dotted;
  416. this.ultraGrid1.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
  417. this.ultraGrid1.DisplayLayout.Override.CellPadding = 0;
  418. this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
  419. this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
  420. this.ultraGrid1.DisplayLayout.Override.MinRowHeight = 21;
  421. this.ultraGrid1.DisplayLayout.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
  422. this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
  423. this.ultraGrid1.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
  424. this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
  425. this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
  426. this.ultraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
  427. this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
  428. this.ultraGrid1.Location = new System.Drawing.Point(0, 88);
  429. this.ultraGrid1.Name = "ultraGrid1";
  430. this.ultraGrid1.Size = new System.Drawing.Size(1012, 477);
  431. this.ultraGrid1.TabIndex = 2;
  432. this.ultraGrid1.Text = "ultraGrid1";
  433. //
  434. // ultraExpandableGroupBox1
  435. //
  436. this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
  437. this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
  438. this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(1012, 168);
  439. this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 565);
  440. this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
  441. this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(1012, 168);
  442. this.ultraExpandableGroupBox1.SupportThemes = false;
  443. this.ultraExpandableGroupBox1.TabIndex = 3;
  444. this.ultraExpandableGroupBox1.Text = "编辑区域";
  445. this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
  446. //
  447. // ultraExpandableGroupBoxPanel1
  448. //
  449. this.ultraExpandableGroupBoxPanel1.Controls.Add(this.panel3);
  450. this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
  451. this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(2, 22);
  452. this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
  453. this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(1008, 144);
  454. this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
  455. //
  456. // panel3
  457. //
  458. this.panel3.BackColor = System.Drawing.Color.Gainsboro;
  459. this.panel3.Controls.Add(this.flowLayoutPanel1);
  460. this.panel3.Controls.Add(this.ultxtEmail);
  461. this.panel3.Controls.Add(this.ultraLabel1);
  462. this.panel3.Controls.Add(this.ulcmeDepartment);
  463. this.panel3.Controls.Add(this.ultxtMemo);
  464. this.panel3.Controls.Add(this.ultxtPhono);
  465. this.panel3.Controls.Add(this.ultxtZW);
  466. this.panel3.Controls.Add(this.ultxtGW);
  467. this.panel3.Controls.Add(this.ultxtAge);
  468. this.panel3.Controls.Add(this.ultxtUserName);
  469. this.panel3.Controls.Add(this.ultxtUserNo);
  470. this.panel3.Controls.Add(this.ulcmeSex);
  471. this.panel3.Controls.Add(this.ultraLabel11);
  472. this.panel3.Controls.Add(this.ultraLabel10);
  473. this.panel3.Controls.Add(this.ultraLabel9);
  474. this.panel3.Controls.Add(this.ultraLabel8);
  475. this.panel3.Controls.Add(this.ultraLabel7);
  476. this.panel3.Controls.Add(this.ultraLabel6);
  477. this.panel3.Controls.Add(this.ultraLabel5);
  478. this.panel3.Controls.Add(this.ultraLabel4);
  479. this.panel3.Controls.Add(this.ultraLabel3);
  480. this.panel3.Controls.Add(this.ultraLabel2);
  481. this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
  482. this.panel3.Location = new System.Drawing.Point(0, -8);
  483. this.panel3.Name = "panel3";
  484. this.panel3.Size = new System.Drawing.Size(1008, 152);
  485. this.panel3.TabIndex = 0;
  486. //
  487. // flowLayoutPanel1
  488. //
  489. this.flowLayoutPanel1.AutoScroll = true;
  490. this.flowLayoutPanel1.Location = new System.Drawing.Point(806, 19);
  491. this.flowLayoutPanel1.Name = "flowLayoutPanel1";
  492. this.flowLayoutPanel1.Size = new System.Drawing.Size(171, 123);
  493. this.flowLayoutPanel1.TabIndex = 24;
  494. //
  495. // ultxtEmail
  496. //
  497. appearance1.BackColor = System.Drawing.Color.LightCyan;
  498. this.ultxtEmail.Appearance = appearance1;
  499. this.ultxtEmail.AutoSize = true;
  500. this.ultxtEmail.BackColor = System.Drawing.Color.LightCyan;
  501. this.ultxtEmail.Location = new System.Drawing.Point(560, 85);
  502. this.ultxtEmail.Name = "ultxtEmail";
  503. this.ultxtEmail.Size = new System.Drawing.Size(160, 21);
  504. this.ultxtEmail.TabIndex = 23;
  505. //
  506. // ultraLabel1
  507. //
  508. this.ultraLabel1.Location = new System.Drawing.Point(503, 86);
  509. this.ultraLabel1.Name = "ultraLabel1";
  510. this.ultraLabel1.Size = new System.Drawing.Size(54, 16);
  511. this.ultraLabel1.TabIndex = 22;
  512. this.ultraLabel1.Text = "邮件地址";
  513. //
  514. // ulcmeDepartment
  515. //
  516. this.ulcmeDepartment.AutoSize = true;
  517. this.ulcmeDepartment.DropDownButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Never;
  518. this.ulcmeDepartment.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  519. this.ulcmeDepartment.Location = new System.Drawing.Point(560, 17);
  520. this.ulcmeDepartment.Name = "ulcmeDepartment";
  521. this.ulcmeDepartment.Size = new System.Drawing.Size(160, 21);
  522. this.ulcmeDepartment.TabIndex = 21;
  523. this.ulcmeDepartment.SelectionChanged += new System.EventHandler(this.ultraComboEditor2_SelectionChanged);
  524. this.ulcmeDepartment.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraComboEditor2_EditorButtonClick);
  525. //
  526. // ultxtMemo
  527. //
  528. appearance2.BackColor = System.Drawing.Color.LightCyan;
  529. this.ultxtMemo.Appearance = appearance2;
  530. this.ultxtMemo.AutoSize = true;
  531. this.ultxtMemo.BackColor = System.Drawing.Color.LightCyan;
  532. this.ultxtMemo.Location = new System.Drawing.Point(81, 119);
  533. this.ultxtMemo.Name = "ultxtMemo";
  534. this.ultxtMemo.Size = new System.Drawing.Size(640, 21);
  535. this.ultxtMemo.TabIndex = 19;
  536. //
  537. // ultxtPhono
  538. //
  539. appearance3.BackColor = System.Drawing.Color.LightCyan;
  540. this.ultxtPhono.Appearance = appearance3;
  541. this.ultxtPhono.AutoSize = true;
  542. this.ultxtPhono.BackColor = System.Drawing.Color.LightCyan;
  543. this.ultxtPhono.Location = new System.Drawing.Point(560, 51);
  544. this.ultxtPhono.Name = "ultxtPhono";
  545. this.ultxtPhono.Size = new System.Drawing.Size(160, 21);
  546. this.ultxtPhono.TabIndex = 18;
  547. //
  548. // ultxtZW
  549. //
  550. appearance4.BackColor = System.Drawing.Color.LightCyan;
  551. this.ultxtZW.Appearance = appearance4;
  552. this.ultxtZW.AutoSize = true;
  553. this.ultxtZW.BackColor = System.Drawing.Color.LightCyan;
  554. this.ultxtZW.Location = new System.Drawing.Point(313, 51);
  555. this.ultxtZW.Name = "ultxtZW";
  556. this.ultxtZW.Size = new System.Drawing.Size(136, 21);
  557. this.ultxtZW.TabIndex = 17;
  558. //
  559. // ultxtGW
  560. //
  561. appearance5.BackColor = System.Drawing.Color.LightCyan;
  562. this.ultxtGW.Appearance = appearance5;
  563. this.ultxtGW.AutoSize = true;
  564. this.ultxtGW.BackColor = System.Drawing.Color.LightCyan;
  565. this.ultxtGW.Location = new System.Drawing.Point(81, 51);
  566. this.ultxtGW.Name = "ultxtGW";
  567. this.ultxtGW.Size = new System.Drawing.Size(136, 21);
  568. this.ultxtGW.TabIndex = 16;
  569. //
  570. // ultxtAge
  571. //
  572. appearance6.BackColor = System.Drawing.Color.LightCyan;
  573. this.ultxtAge.Appearance = appearance6;
  574. this.ultxtAge.AutoSize = true;
  575. this.ultxtAge.BackColor = System.Drawing.Color.LightCyan;
  576. this.ultxtAge.Location = new System.Drawing.Point(313, 81);
  577. this.ultxtAge.Name = "ultxtAge";
  578. this.ultxtAge.Size = new System.Drawing.Size(136, 21);
  579. this.ultxtAge.TabIndex = 15;
  580. this.ultxtAge.Visible = false;
  581. //
  582. // ultxtUserName
  583. //
  584. appearance7.BackColor = System.Drawing.Color.LightCyan;
  585. this.ultxtUserName.Appearance = appearance7;
  586. this.ultxtUserName.AutoSize = true;
  587. this.ultxtUserName.BackColor = System.Drawing.Color.LightCyan;
  588. this.ultxtUserName.Location = new System.Drawing.Point(313, 17);
  589. this.ultxtUserName.Name = "ultxtUserName";
  590. this.ultxtUserName.Size = new System.Drawing.Size(136, 21);
  591. this.ultxtUserName.TabIndex = 14;
  592. //
  593. // ultxtUserNo
  594. //
  595. appearance8.BackColor = System.Drawing.Color.LavenderBlush;
  596. this.ultxtUserNo.Appearance = appearance8;
  597. this.ultxtUserNo.AutoSize = true;
  598. this.ultxtUserNo.BackColor = System.Drawing.Color.LavenderBlush;
  599. this.ultxtUserNo.Location = new System.Drawing.Point(81, 17);
  600. this.ultxtUserNo.Name = "ultxtUserNo";
  601. this.ultxtUserNo.Size = new System.Drawing.Size(136, 21);
  602. this.ultxtUserNo.TabIndex = 13;
  603. //
  604. // ulcmeSex
  605. //
  606. this.ulcmeSex.AutoSize = true;
  607. this.ulcmeSex.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  608. valueListItem2.DataValue = "男";
  609. valueListItem2.DisplayText = "男";
  610. valueListItem1.DataValue = valueListItem2;
  611. valueListItem1.DisplayText = "男";
  612. valueListItem4.DataValue = "女";
  613. valueListItem4.DisplayText = "女";
  614. valueListItem3.DataValue = valueListItem4;
  615. valueListItem3.DisplayText = "女";
  616. this.ulcmeSex.Items.Add(valueListItem1);
  617. this.ulcmeSex.Items.Add(valueListItem3);
  618. this.ulcmeSex.Location = new System.Drawing.Point(81, 85);
  619. this.ulcmeSex.Name = "ulcmeSex";
  620. this.ulcmeSex.Size = new System.Drawing.Size(136, 21);
  621. this.ulcmeSex.TabIndex = 11;
  622. //
  623. // ultraLabel11
  624. //
  625. this.ultraLabel11.Location = new System.Drawing.Point(36, 120);
  626. this.ultraLabel11.Name = "ultraLabel11";
  627. this.ultraLabel11.Size = new System.Drawing.Size(42, 16);
  628. this.ultraLabel11.TabIndex = 9;
  629. this.ultraLabel11.Text = "备 注";
  630. //
  631. // ultraLabel10
  632. //
  633. this.ultraLabel10.Location = new System.Drawing.Point(503, 52);
  634. this.ultraLabel10.Name = "ultraLabel10";
  635. this.ultraLabel10.Size = new System.Drawing.Size(54, 16);
  636. this.ultraLabel10.TabIndex = 8;
  637. this.ultraLabel10.Text = "联系电话";
  638. //
  639. // ultraLabel9
  640. //
  641. this.ultraLabel9.Location = new System.Drawing.Point(734, 19);
  642. this.ultraLabel9.Name = "ultraLabel9";
  643. this.ultraLabel9.Size = new System.Drawing.Size(66, 16);
  644. this.ultraLabel9.TabIndex = 7;
  645. this.ultraLabel9.Text = "机器IP地址";
  646. this.toolTip1.SetToolTip(this.ultraLabel9, "鼠标左击增加IP框;右击减少");
  647. this.ultraLabel9.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ultraLabel9_MouseClick);
  648. //
  649. // ultraLabel8
  650. //
  651. this.ultraLabel8.Location = new System.Drawing.Point(528, 18);
  652. this.ultraLabel8.Name = "ultraLabel8";
  653. this.ultraLabel8.Size = new System.Drawing.Size(29, 16);
  654. this.ultraLabel8.TabIndex = 6;
  655. this.ultraLabel8.Text = "部门";
  656. //
  657. // ultraLabel7
  658. //
  659. this.ultraLabel7.Location = new System.Drawing.Point(281, 52);
  660. this.ultraLabel7.Name = "ultraLabel7";
  661. this.ultraLabel7.Size = new System.Drawing.Size(29, 16);
  662. this.ultraLabel7.TabIndex = 5;
  663. this.ultraLabel7.Text = "职务";
  664. //
  665. // ultraLabel6
  666. //
  667. this.ultraLabel6.Location = new System.Drawing.Point(280, 84);
  668. this.ultraLabel6.Name = "ultraLabel6";
  669. this.ultraLabel6.Size = new System.Drawing.Size(32, 16);
  670. this.ultraLabel6.TabIndex = 4;
  671. this.ultraLabel6.Text = "年龄";
  672. this.ultraLabel6.Visible = false;
  673. //
  674. // ultraLabel5
  675. //
  676. this.ultraLabel5.Location = new System.Drawing.Point(281, 18);
  677. this.ultraLabel5.Name = "ultraLabel5";
  678. this.ultraLabel5.Size = new System.Drawing.Size(29, 16);
  679. this.ultraLabel5.TabIndex = 3;
  680. this.ultraLabel5.Text = "姓名";
  681. //
  682. // ultraLabel4
  683. //
  684. this.ultraLabel4.Location = new System.Drawing.Point(49, 52);
  685. this.ultraLabel4.Name = "ultraLabel4";
  686. this.ultraLabel4.Size = new System.Drawing.Size(29, 16);
  687. this.ultraLabel4.TabIndex = 2;
  688. this.ultraLabel4.Text = "岗位";
  689. //
  690. // ultraLabel3
  691. //
  692. this.ultraLabel3.Location = new System.Drawing.Point(49, 86);
  693. this.ultraLabel3.Name = "ultraLabel3";
  694. this.ultraLabel3.Size = new System.Drawing.Size(29, 16);
  695. this.ultraLabel3.TabIndex = 1;
  696. this.ultraLabel3.Text = "性别";
  697. //
  698. // ultraLabel2
  699. //
  700. this.ultraLabel2.Location = new System.Drawing.Point(24, 18);
  701. this.ultraLabel2.Name = "ultraLabel2";
  702. this.ultraLabel2.Size = new System.Drawing.Size(54, 16);
  703. this.ultraLabel2.TabIndex = 0;
  704. this.ultraLabel2.Text = "员工编号";
  705. //
  706. // panel2
  707. //
  708. this.panel2.BackColor = System.Drawing.Color.Gainsboro;
  709. this.panel2.Controls.Add(this.ultLoginID);
  710. this.panel2.Controls.Add(this.ultraLabel12);
  711. this.panel2.Controls.Add(this.ultraTextEditor8);
  712. this.panel2.Controls.Add(this.ultraCheckEditor1);
  713. this.panel2.Controls.Add(this.ultraButton1);
  714. this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
  715. this.panel2.Location = new System.Drawing.Point(0, 32);
  716. this.panel2.Name = "panel2";
  717. this.panel2.Size = new System.Drawing.Size(1012, 56);
  718. this.panel2.TabIndex = 1;
  719. //
  720. // ultLoginID
  721. //
  722. appearance9.BackColor = System.Drawing.Color.LightCyan;
  723. this.ultLoginID.Appearance = appearance9;
  724. this.ultLoginID.AutoSize = true;
  725. this.ultLoginID.BackColor = System.Drawing.Color.LightCyan;
  726. this.ultLoginID.FlatMode = true;
  727. this.ultLoginID.Location = new System.Drawing.Point(371, 18);
  728. this.ultLoginID.Name = "ultLoginID";
  729. this.ultLoginID.Size = new System.Drawing.Size(152, 19);
  730. this.ultLoginID.TabIndex = 3;
  731. this.ultLoginID.Visible = false;
  732. this.ultLoginID.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultLoginID_EditorButtonClick);
  733. //
  734. // ultraLabel12
  735. //
  736. this.ultraLabel12.Location = new System.Drawing.Point(313, 22);
  737. this.ultraLabel12.Name = "ultraLabel12";
  738. this.ultraLabel12.Size = new System.Drawing.Size(54, 16);
  739. this.ultraLabel12.TabIndex = 0;
  740. this.ultraLabel12.Text = "员工编号";
  741. this.ultraLabel12.Visible = false;
  742. //
  743. // ultraTextEditor8
  744. //
  745. appearance10.BackColor = System.Drawing.Color.Gainsboro;
  746. this.ultraTextEditor8.Appearance = appearance10;
  747. this.ultraTextEditor8.AutoSize = true;
  748. this.ultraTextEditor8.BackColor = System.Drawing.Color.Gainsboro;
  749. this.ultraTextEditor8.Enabled = false;
  750. this.ultraTextEditor8.FlatMode = true;
  751. this.ultraTextEditor8.Location = new System.Drawing.Point(86, 18);
  752. this.ultraTextEditor8.Name = "ultraTextEditor8";
  753. this.ultraTextEditor8.ReadOnly = true;
  754. this.ultraTextEditor8.Size = new System.Drawing.Size(149, 19);
  755. this.ultraTextEditor8.TabIndex = 1;
  756. this.ultraTextEditor8.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraTextEditor8_EditorButtonClick);
  757. //
  758. // ultraCheckEditor1
  759. //
  760. this.ultraCheckEditor1.Location = new System.Drawing.Point(31, 18);
  761. this.ultraCheckEditor1.Name = "ultraCheckEditor1";
  762. this.ultraCheckEditor1.Size = new System.Drawing.Size(48, 20);
  763. this.ultraCheckEditor1.TabIndex = 0;
  764. this.ultraCheckEditor1.Text = "部门";
  765. this.ultraCheckEditor1.CheckedChanged += new System.EventHandler(this.ultraCheckEditor1_CheckedChanged);
  766. //
  767. // ultraButton1
  768. //
  769. this.ultraButton1.Location = new System.Drawing.Point(237, 17);
  770. this.ultraButton1.Name = "ultraButton1";
  771. this.ultraButton1.Size = new System.Drawing.Size(27, 21);
  772. this.ultraButton1.TabIndex = 2;
  773. this.ultraButton1.Text = ">>";
  774. this.toolTip1.SetToolTip(this.ultraButton1, "部门维护");
  775. this.ultraButton1.Visible = false;
  776. this.ultraButton1.Click += new System.EventHandler(this.ultraButton1_Click);
  777. //
  778. // FrmUserManager
  779. //
  780. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  781. this.ClientSize = new System.Drawing.Size(1012, 733);
  782. this.Controls.Add(this.FrmUserManager_Fill_Panel);
  783. this.Name = "FrmUserManager";
  784. this.Text = "系统用户管理";
  785. this.Load += new System.EventHandler(this.FrmUserManager_Load);
  786. this.panel1.ResumeLayout(false);
  787. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
  788. this.FrmUserManager_Fill_Panel.ResumeLayout(false);
  789. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
  790. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
  791. this.ultraExpandableGroupBox1.ResumeLayout(false);
  792. this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
  793. this.panel3.ResumeLayout(false);
  794. ((System.ComponentModel.ISupportInitialize)(this.ultxtEmail)).EndInit();
  795. ((System.ComponentModel.ISupportInitialize)(this.ulcmeDepartment)).EndInit();
  796. ((System.ComponentModel.ISupportInitialize)(this.ultxtMemo)).EndInit();
  797. ((System.ComponentModel.ISupportInitialize)(this.ultxtPhono)).EndInit();
  798. ((System.ComponentModel.ISupportInitialize)(this.ultxtZW)).EndInit();
  799. ((System.ComponentModel.ISupportInitialize)(this.ultxtGW)).EndInit();
  800. ((System.ComponentModel.ISupportInitialize)(this.ultxtAge)).EndInit();
  801. ((System.ComponentModel.ISupportInitialize)(this.ultxtUserName)).EndInit();
  802. ((System.ComponentModel.ISupportInitialize)(this.ultxtUserNo)).EndInit();
  803. ((System.ComponentModel.ISupportInitialize)(this.ulcmeSex)).EndInit();
  804. this.panel2.ResumeLayout(false);
  805. ((System.ComponentModel.ISupportInitialize)(this.ultLoginID)).EndInit();
  806. ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor8)).EndInit();
  807. this.ResumeLayout(false);
  808. }
  809. #endregion
  810. #region "显示窗体"
  811. private void FrmUserManager_Load(object sender, System.EventArgs e)
  812. {
  813. StrUser = Core.Mes.ClientFrameWork.ClientCommon._UserInfo.UserName;
  814. GetDepartmentData();
  815. GetUserData("", true);
  816. GetOperDepart();
  817. GetChildDept();
  818. InitComboBox();
  819. InitGrid();
  820. if (operDepart == "ROOT")
  821. {
  822. ultraButton1.Visible = true;
  823. }
  824. this.createIpedt(1);
  825. }
  826. private void GetDepartmentData()
  827. {
  828. try
  829. {
  830. CallingMessage par = new CallingMessage();
  831. par.ServerName = "PurviewManager";
  832. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  833. par.MethodName = "SelectUAM_DEPARTMENT";
  834. par.args = new object[] { " order by DEPARTMENTID " };
  835. string strOut = "";
  836. _departmentData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  837. _selectPartSQL = strOut;
  838. }
  839. catch
  840. { }
  841. }
  842. private void InitComboBox()
  843. {
  844. if (_departmentData != null && _departmentData.Tables.Count > 0)
  845. {
  846. DataTable dt = this._departmentData.Tables[0].Copy();
  847. this.ulcmeDepartment.Items.Clear();
  848. foreach (DataRow dr in dt.Rows)
  849. {
  850. if (dr["DEPARTMENTID"].ToString() == "ROOT" && operDepart != "ROOT") continue;
  851. try
  852. {
  853. this.ulcmeDepartment.Items.Add(dr["DEPARTMENTID"], dr["DEPARTMENTNAME"].ToString());
  854. }
  855. catch
  856. { }
  857. }
  858. }
  859. }
  860. private void GetUserData(string strWhere, bool flag)
  861. {
  862. try
  863. {
  864. if (!flag)
  865. {
  866. _userData.Tables[0].DefaultView.RowFilter = strWhere;
  867. return;
  868. }
  869. CallingMessage par = new CallingMessage();
  870. par.ServerName = "PurviewManager";
  871. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  872. par.MethodName = "SelectUAM_USER";
  873. par.args = new object[] { strWhere };
  874. string strOut = "";
  875. _userData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  876. _selectUserSQL = strOut;
  877. }
  878. catch
  879. { }
  880. }
  881. private void GetOperDepart()
  882. {
  883. try
  884. {
  885. if (_userData != null && _userData.Tables.Count > 0)
  886. {
  887. DataTable dt = this._userData.Tables[0].Copy();
  888. foreach (DataRow dr in dt.Rows)
  889. {
  890. if (dr["NAME"].ToString() == StrUser)
  891. {
  892. operDepart = dr["DEPARTMENTID"].ToString();
  893. //operDepart=operDepart.Substring(0,3);
  894. //if(operDepart=="xg0")
  895. //{
  896. // operDepart="xg";
  897. //}
  898. DataTable dn = this._departmentData.Tables[0].Copy();
  899. foreach (DataRow dm in dn.Rows)
  900. {
  901. if (dm["DEPARTMENTID"].ToString() == operDepart)
  902. {
  903. operDepartname = dm["DEPARTMENTNAME"].ToString();
  904. }
  905. }
  906. }
  907. }
  908. }
  909. }
  910. catch
  911. { }
  912. }
  913. private void InitGrid()
  914. {
  915. #region " ValueList "
  916. GetPartData();
  917. ultraGrid1.DisplayLayout.Bands[0].Columns["DEPARTMENTID"].ValueList = ultraGrid1.DisplayLayout.ValueLists["part"];
  918. ultraGrid1.DisplayLayout.Bands[0].Columns["PD"].ValueList = ultraGrid1.DisplayLayout.ValueLists["part"];
  919. #endregion
  920. this.ultraCheckEditor1.CheckedValue = true;
  921. this.ultraTextEditor8.Enabled = true;
  922. this.ultraTextEditor8.Text = operDepartname;
  923. this.ultraTextEditor8.Tag = allDept;
  924. Query();
  925. // this.ultraGrid1.DataSource = this._userData.Tables[0];
  926. this.ultraGrid1.AfterRowActivate += new EventHandler(ultraGrid1_AfterRowActivate);
  927. }
  928. private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
  929. {
  930. try
  931. {
  932. if (this.ultraGrid1.ActiveRow == null) return;
  933. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  934. this.ultxtUserNo.Text = ugr.Cells["USERID"].Value.ToString();
  935. this.ulcmeDepartment.Value = ugr.Cells["DEPARTMENTID"].Value;
  936. this.ultxtUserName.Text = ugr.Cells["NAME"].Value.ToString();
  937. this.ulcmeSex.Text = ugr.Cells["SEX"].Value.ToString();
  938. this.ultxtAge.Text = ugr.Cells["AGE"].Value.ToString();
  939. //this.ulmskedtIP.Text = ugr.Cells["COMPUTERIP"].Value.ToString();
  940. this.analysisIpstr(ugr.Cells["COMPUTERIP"].Value.ToString());
  941. this.ultxtPhono.Text = ugr.Cells["HOMEPHONE"].Value.ToString();
  942. this.ultxtGW.Text = ugr.Cells["WORKPOS"].Value.ToString();
  943. this.ultxtZW.Text = ugr.Cells["WORKJOB"].Value.ToString();
  944. this.ultxtMemo.Text = ugr.Cells["MEMO"].Value.ToString();
  945. this.ultxtEmail.Text = ugr.Cells["EMAIL"].Value.ToString();
  946. }
  947. catch (Exception ex)
  948. {
  949. Console.WriteLine(ex.Message);
  950. }
  951. }
  952. private void GetPartData()
  953. {
  954. if (ultraGrid1.DisplayLayout.ValueLists.Exists("part"))
  955. ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
  956. else
  957. ultraGrid1.DisplayLayout.ValueLists.Add("part");
  958. //try
  959. //{
  960. // ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
  961. //}
  962. //catch
  963. //{
  964. // ultraGrid1.DisplayLayout.ValueLists.Add("part");
  965. //}
  966. DataTable dt = this._departmentData.Tables[0].Copy();
  967. foreach (DataRow dr in dt.Rows)
  968. {
  969. Infragistics.Win.ValueListItem vli = new Infragistics.Win.ValueListItem();
  970. vli.DisplayText = dr["DEPARTMENTNAME"].ToString();
  971. vli.DataValue = dr["DEPARTMENTID"];
  972. ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Add(vli);
  973. }
  974. }
  975. #endregion
  976. #region "工具栏操作"
  977. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  978. {
  979. switch (e.Tool.Key)
  980. {
  981. case "add":
  982. Add();
  983. GetUserData("", true);
  984. break;
  985. case "del":
  986. Del();
  987. break;
  988. case "edit":
  989. Edit();
  990. break;
  991. case "query":
  992. Query();
  993. break;
  994. case "exit":
  995. this.Close();
  996. break;
  997. case "back":
  998. // this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible=false;
  999. // RefreshGrid("");
  1000. // ultraCheckEditor1.Checked = false;
  1001. // ultraTextEditor8.Text = "";
  1002. this.ultraCheckEditor1.CheckedValue = true;
  1003. if (ultLoginID.Text.Trim().Length > 0)
  1004. {
  1005. ultLoginID.Tag = ultLoginID.Text.Trim();
  1006. ultLoginID.Text = "";
  1007. }
  1008. this.ultraTextEditor8.Enabled = true;
  1009. this.ultraTextEditor8.Text = operDepartname;
  1010. this.ultraTextEditor8.Tag = allDept;
  1011. Query();
  1012. break;
  1013. case "leadin":
  1014. try
  1015. {
  1016. string StrfileName = string.Format("c:\\{0}.xls", this.Text);
  1017. this.ultraGridExcelExporter1.Export(this.ultraGrid1, StrfileName);
  1018. ProcessStartInfo p = new ProcessStartInfo(StrfileName);
  1019. p.WorkingDirectory = Path.GetDirectoryName(StrfileName);
  1020. Process.Start(p);
  1021. }
  1022. catch (Exception ex)
  1023. {
  1024. MessageBox.Show(ex.Message);
  1025. }
  1026. break;
  1027. }
  1028. }
  1029. private void Add()
  1030. {
  1031. if (this.ultxtUserNo.Text.Trim() == "")
  1032. {
  1033. MessageBox.Show("请录入员工编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1034. return;
  1035. }
  1036. if (this.ultxtUserName.Text.Trim() == "")
  1037. {
  1038. MessageBox.Show("请录入员工姓名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1039. return;
  1040. }
  1041. if (this.ulcmeDepartment.Value == null)
  1042. {
  1043. MessageBox.Show("请选择员工所在部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1044. return;
  1045. }
  1046. if (this.ulcmeDepartment.Value.ToString() == "ROOT")
  1047. {
  1048. this.ulcmeDepartment.Value = null;
  1049. MessageBox.Show("必须选择下属部门!");
  1050. return;
  1051. }
  1052. if (!(RightsComm.CheckRole(ulcmeDepartment.Value.ToString())))
  1053. {
  1054. return;
  1055. }
  1056. //if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1057. //{
  1058. // this.ulcmeDepartment.Value = null;
  1059. // MessageBox.Show("你没有配置这一部门用户的权限,请重新选择部门!");
  1060. // return;
  1061. //}
  1062. ArrayList al = new ArrayList();
  1063. al.Add(this.ultxtUserNo.Text.Trim());
  1064. al.Add(this.ulcmeDepartment.Value);
  1065. al.Add(this.ultxtUserName.Text.Trim());
  1066. if (this.ulcmeSex.SelectedIndex != -1)
  1067. {
  1068. al.Add(this.ulcmeSex.Text.Trim());
  1069. }
  1070. else
  1071. {
  1072. al.Add("");
  1073. }
  1074. if (this.ultxtAge.Text == "")
  1075. al.Add(0);
  1076. else
  1077. al.Add(this.ultxtAge.Text.Trim());
  1078. //al.Add(this.ulmskedtIP.Text.Trim());
  1079. al.Add(this.getIpstr());
  1080. this.checkIpstr(this.getIpstr());
  1081. al.Add(this.ultxtPhono.Text.Trim());
  1082. al.Add(this.ultxtGW.Text.Trim());
  1083. al.Add(this.ultxtZW.Text.Trim());
  1084. al.Add(this.ultxtMemo.Text.Trim());
  1085. al.Add(this.ultxtEmail.Text.Trim());
  1086. try
  1087. {
  1088. CallingMessage par = new CallingMessage();
  1089. par.ServerName = "PurviewManager";
  1090. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1091. par.MethodName = "InsertUAM_USER";
  1092. par.args = new object[] { al };
  1093. string strOut = "";
  1094. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  1095. if (strOut != "")
  1096. {
  1097. MessageBox.Show("新增失败! \n" + strOut);
  1098. return;
  1099. }
  1100. else
  1101. {
  1102. if ((int)obj != 1)
  1103. {
  1104. MessageBox.Show("新增失败!");
  1105. return;
  1106. }
  1107. }
  1108. }
  1109. catch
  1110. {
  1111. return;
  1112. }
  1113. this.GetDepartmentData();
  1114. UltraGridRow ugr = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
  1115. ugr.Cells["USERID"].Value = al[0];
  1116. ugr.Cells["DEPARTMENTID"].Value = al[1];
  1117. ugr.Cells["NAME"].Value = al[2];
  1118. ugr.Cells["SEX"].Value = al[3];
  1119. ugr.Cells["AGE"].Value = al[4];
  1120. //ugr.Cells["COMPUTERIP"].Value = al[5];
  1121. this.analysisIpstr(ugr.Cells["COMPUTERIP"].Value.ToString());
  1122. ugr.Cells["HOMEPHONE"].Value = al[6];
  1123. ugr.Cells["WORKPOS"].Value = al[7];
  1124. ugr.Cells["WORKJOB"].Value = al[8];
  1125. ugr.Cells["MEMO"].Value = al[9];
  1126. ugr.Cells["EMAIL"].Value = al[10];
  1127. for (int i = 0; i < _departmentData.Tables[0].Rows.Count; i++)
  1128. {
  1129. if (_departmentData.Tables[0].Rows[i]["DEPARTMENTID"].ToString() == al[1].ToString())
  1130. {
  1131. ugr.Cells["PD"].Value = _departmentData.Tables[0].Rows[i]["DEPARTMENTPID"].ToString();
  1132. break;
  1133. }
  1134. }
  1135. this.ultraGrid1.UpdateData();
  1136. }
  1137. private void Del()
  1138. {
  1139. int i = 0;
  1140. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  1141. if (ugr == null)
  1142. {
  1143. MessageBox.Show("请选择要删除的员工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1144. return;
  1145. }
  1146. if (MessageBox.Show("是否确认删除选中的员工?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  1147. {
  1148. return;
  1149. }
  1150. string targetName = ugr.Cells["NAME"].Value.ToString();
  1151. if (MessageBox.Show("是否确认删除员工----" + targetName + "----", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  1152. {
  1153. return;
  1154. }
  1155. try
  1156. {
  1157. string OpDptID = "";
  1158. OpDptID = ugr.Cells["DEPARTMENTID"].Value.ToString();
  1159. if (!(RightsComm.CheckRole(OpDptID)))
  1160. return;
  1161. i = ugr.Index;
  1162. CallingMessage par = new CallingMessage();
  1163. par.ServerName = "PurviewManager";
  1164. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1165. par.MethodName = "DeleteUAM_USER";
  1166. par.args = new object[] { ugr.Cells[0].Value.ToString() };
  1167. string strOut = "";
  1168. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  1169. if (strOut != "")
  1170. {
  1171. MessageBox.Show("删除失败! \n" + strOut);
  1172. return;
  1173. }
  1174. else
  1175. {
  1176. if ((int)obj != 1)
  1177. {
  1178. MessageBox.Show("删除失败!");
  1179. return;
  1180. }
  1181. }
  1182. }
  1183. catch //(Exception ex)
  1184. {
  1185. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  1186. return;
  1187. }
  1188. this.ultraGrid1.ActiveRow.Delete(false);
  1189. this.ultraGrid1.UpdateData();
  1190. try
  1191. {
  1192. this.ultraGrid1.Rows[i].Activate();
  1193. }
  1194. catch
  1195. {
  1196. int count = this.ultraGrid1.Rows.Count;
  1197. if (count > 0)
  1198. this.ultraGrid1.Rows[count - 1].Activate();
  1199. }
  1200. }
  1201. private void Edit()
  1202. {
  1203. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  1204. if (ugr == null)
  1205. {
  1206. MessageBox.Show("请选择要修改的员工!");
  1207. return;
  1208. }
  1209. if (this.ultxtUserNo.Text.Trim() != ugr.Cells["USERID"].Text.Trim())
  1210. {
  1211. MessageBox.Show("不能修改员工编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1212. return;
  1213. }
  1214. if (this.ultxtUserName.Text.Trim() == "")
  1215. {
  1216. MessageBox.Show("请录入员工姓名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1217. return;
  1218. }
  1219. if (this.ulcmeDepartment.Value == null)
  1220. {
  1221. MessageBox.Show("请选择员工所在部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1222. return;
  1223. }
  1224. if (this.ulcmeDepartment.Value.ToString() == "ROOT")
  1225. {
  1226. this.ulcmeDepartment.Value = null;
  1227. MessageBox.Show("必须选择下属部门!");
  1228. return;
  1229. }
  1230. if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1231. {
  1232. this.ulcmeDepartment.Value = null;
  1233. MessageBox.Show("你没有修改该用户的权限,请重新选择部门!");
  1234. return;
  1235. }
  1236. ArrayList al = new ArrayList();
  1237. al.Add(this.ultxtUserNo.Text.Trim());
  1238. al.Add(this.ulcmeDepartment.Value);
  1239. al.Add(this.ultxtUserName.Text.Trim());
  1240. al.Add(this.ulcmeSex.Text.Trim());
  1241. al.Add((ultxtAge.Text.Trim() != "") ? ultxtAge.Text.Trim() : "0");
  1242. //al.Add(this.ulmskedtIP.Text.Trim());
  1243. al.Add(this.getIpstr());
  1244. this.checkIpstr(this.getIpstr());
  1245. al.Add(this.ultxtPhono.Text.Trim());
  1246. al.Add(this.ultxtGW.Text.Trim());
  1247. al.Add(this.ultxtZW.Text.Trim());
  1248. al.Add(this.ultxtMemo.Text.Trim());
  1249. al.Add(this.ultxtEmail.Text.Trim());
  1250. try
  1251. {
  1252. CallingMessage par = new CallingMessage();
  1253. par.ServerName = "PurviewManager";
  1254. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1255. par.MethodName = "UpdateUAM_USER";
  1256. par.args = new object[] { al };
  1257. string strOut = "";
  1258. object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);
  1259. if (strOut != "")
  1260. {
  1261. MessageBox.Show("修改失败 \n" + strOut);
  1262. return;
  1263. }
  1264. else
  1265. {
  1266. int i = (int)obj;
  1267. if (i != 1)
  1268. {
  1269. MessageBox.Show("修改失败");
  1270. return;
  1271. }
  1272. }
  1273. }
  1274. catch //(Exception ex)
  1275. {
  1276. // CoreMesLogger.log(this.GetType()).Error(ex.Message);
  1277. return;
  1278. }
  1279. ugr.Cells["DEPARTMENTID"].Value = al[1];
  1280. ugr.Cells["NAME"].Value = al[2];
  1281. ugr.Cells["SEX"].Value = al[3];
  1282. ugr.Cells["AGE"].Value = al[4];
  1283. //ugr.Cells["COMPUTERIP"].Value = al[5];
  1284. this.analysisIpstr(ugr.Cells["COMPUTERIP"].Value.ToString());
  1285. ugr.Cells["HOMEPHONE"].Value = al[6];
  1286. ugr.Cells["WORKPOS"].Value = al[7];
  1287. ugr.Cells["WORKJOB"].Value = al[8];
  1288. ugr.Cells["MEMO"].Value = al[9];
  1289. ugr.Cells["EMAIL"].Value = al[10];
  1290. for (int i = 0; i < _departmentData.Tables[0].Rows.Count; i++)
  1291. {
  1292. if (_departmentData.Tables[0].Rows[i]["DEPARTMENTID"].ToString() == al[1].ToString())
  1293. {
  1294. ugr.Cells["PD"].Value = _departmentData.Tables[0].Rows[i]["DEPARTMENTPID"].ToString();
  1295. break;
  1296. }
  1297. }
  1298. this.ultraGrid1.UpdateData();
  1299. }
  1300. private void Query()
  1301. {
  1302. try
  1303. {
  1304. if ((this.ultraTextEditor8.Text == null || !this.ultraCheckEditor1.Checked) &&
  1305. (this.ultLoginID.Text.Trim().Length == 0))
  1306. {
  1307. MessageBox.Show("请选择要查询的部门或员工编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1308. return;
  1309. }
  1310. if (this.ultraCheckEditor1.Checked && this.ultraTextEditor8.Text != "")
  1311. {
  1312. GetSelDept();
  1313. if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
  1314. {
  1315. MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
  1316. return;
  1317. }
  1318. }
  1319. this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible = true;
  1320. string strWhere = "";
  1321. if (this.ultraTextEditor8.Tag.ToString().Length > 0)
  1322. strWhere = " WHERE DEPARTMENTID in (" + this.ultraTextEditor8.Tag.ToString() + ")";
  1323. //strWhere = GetRefreshWhere();
  1324. //strWhere = " where " + strWhere;
  1325. CallingMessage par = new CallingMessage();
  1326. par.ServerName = "PurviewManager";
  1327. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1328. par.MethodName = "GetUAM_USER";
  1329. par.args = new object[] { strWhere };
  1330. string strOut = "";
  1331. DataSet obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  1332. this.ultraGrid1.DataSource = obj.Tables[0];
  1333. this.ultraGrid1.Refresh();
  1334. }
  1335. catch (System.Exception ex)
  1336. {
  1337. System.Diagnostics.Debug.WriteLine(ex.ToString());
  1338. }
  1339. }
  1340. private string GetRefreshWhere()
  1341. {
  1342. string sqlstr = "";
  1343. if (this.ultraTextEditor8.Enabled && this.ultraCheckEditor1.Checked && this.ultraTextEditor8.Text != "")
  1344. {
  1345. ArrayList al = this.GetUserID();
  1346. if (al == null || al.Count == 0)
  1347. {
  1348. sqlstr = "1=2";
  1349. }
  1350. else
  1351. {
  1352. sqlstr += " USERID in ('" + al[0].ToString() + "'";
  1353. for (int i = 1; i < al.Count; i++)
  1354. {
  1355. sqlstr += ", '" + al[i].ToString() + "' ";
  1356. }
  1357. sqlstr += ")";
  1358. }
  1359. }
  1360. if (this.ultLoginID.Text.Trim().Length > 0)
  1361. {
  1362. if (sqlstr != "")
  1363. sqlstr += " and ";
  1364. sqlstr += " USERID = '" + this.ultLoginID.Text.Trim() + "'";
  1365. }
  1366. return sqlstr;
  1367. }
  1368. private ArrayList GetUserID()
  1369. {
  1370. ArrayList al = new ArrayList();
  1371. DataTable dt = null;
  1372. if (this._userData == null)
  1373. dt = null;
  1374. else
  1375. dt = this._userData.Tables[0];
  1376. if (dt != null)
  1377. {
  1378. if (this.ultraTextEditor8.Enabled && this.ultraTextEditor8.Tag != null)
  1379. {
  1380. string partid = this.ultraTextEditor8.Tag.ToString();
  1381. string strFilter = "DEPARTMENTID in (" + partid + ")";
  1382. dt.DefaultView.RowFilter = strFilter;
  1383. }
  1384. for (int i = 0; i < dt.DefaultView.Count; i++)
  1385. {
  1386. al.Add(dt.DefaultView[i]["USERID"].ToString());
  1387. }
  1388. return al;
  1389. }
  1390. else
  1391. return null;
  1392. }
  1393. private void RefreshGrid(string strWhere)
  1394. {
  1395. CallingMessage par = new CallingMessage();
  1396. par.ServerName = "PurviewManager";
  1397. par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
  1398. par.MethodName = "SelectUAM_USER";
  1399. par.args = new object[] { strWhere };
  1400. string strOut = "";
  1401. DataSet obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
  1402. this.ultraGrid1.DataSource = obj.Tables[0];
  1403. this.ultraGrid1.Refresh();
  1404. }
  1405. #endregion
  1406. #region "Button"
  1407. private void ultraButton1_Click(object sender, System.EventArgs e)
  1408. {
  1409. foreach (Form mdiChild in this.MdiParent.MdiChildren)
  1410. {
  1411. if (mdiChild.Text == "部门管理")
  1412. {
  1413. mdiChild.Activate();
  1414. return;
  1415. }
  1416. }
  1417. FrmDepartment frmpart = new FrmDepartment();
  1418. // frmpart.RemotingHelp = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp;
  1419. frmpart.MdiParent = this.ParentForm;
  1420. frmpart.Show();
  1421. }
  1422. #endregion
  1423. #region "TextBox"
  1424. private void ultraTextEditor8_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1425. {
  1426. try
  1427. {
  1428. FrmSetDepart frm = new FrmSetDepart();
  1429. frm.Location = GetChildWindowLocation(frm.Size);
  1430. frm.ShowDialog();
  1431. if (frm.SelectedID != "" && frm.SelectedName != "")
  1432. {
  1433. this.ultraTextEditor8.Text = frm.SelectedName;
  1434. this.ultraTextEditor8.Tag = frm.SelectedID;
  1435. }
  1436. if (this.ultraTextEditor8.Text != "" && this.ultraCheckEditor1.Checked)
  1437. {
  1438. GetSelDept();
  1439. if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
  1440. {
  1441. MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
  1442. }
  1443. }
  1444. }
  1445. catch
  1446. { }
  1447. }
  1448. private void ultLoginID_EditorButtonClick(object sender, EditorButtonEventArgs e)
  1449. {
  1450. try
  1451. {
  1452. if (e.Button.Key == "SET")
  1453. {
  1454. if (ultLoginID.Text.Trim().Length > 0)
  1455. {
  1456. ultLoginID.Tag = ultLoginID.Text.Trim();
  1457. ultLoginID.Text = "";
  1458. }
  1459. else
  1460. {
  1461. if (ultLoginID.Tag != null)
  1462. ultLoginID.Text = ultLoginID.Tag.ToString();
  1463. }
  1464. }
  1465. }
  1466. catch { }
  1467. }
  1468. #endregion
  1469. #region "Custom Method"
  1470. private Point GetChildWindowLocation(Size ChildWindowSize)
  1471. {
  1472. int width = Cursor.Position.X + ChildWindowSize.Width - Screen.PrimaryScreen.Bounds.Width;
  1473. int height = Cursor.Position.Y + ChildWindowSize.Height - Screen.PrimaryScreen.Bounds.Height + 30;
  1474. if (width > 0)
  1475. width = Cursor.Position.X - width;
  1476. else
  1477. width = Cursor.Position.X;
  1478. if (height > 0)
  1479. height = Cursor.Position.Y - height + 10;
  1480. else
  1481. height = Cursor.Position.Y + 10;
  1482. return new Point(width, height);
  1483. }
  1484. private void GetChildDept()
  1485. {
  1486. try
  1487. {
  1488. string strOut = "";
  1489. DataSet ds = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("PurviewManager", "Core.Mes.PurviewManager.UAM_USER", "SelectChildDept", new object[] { operDepart }, out strOut) as DataSet;
  1490. if (ds.Tables[0].Rows[0][0].ToString() != "")
  1491. {
  1492. allDept = "'" + ds.Tables[0].Rows[0][0].ToString() + "'" + operDepart + "'";
  1493. }
  1494. else
  1495. allDept = "'" + operDepart + "'";
  1496. }
  1497. catch
  1498. { }
  1499. }
  1500. private void GetSelDept()
  1501. {
  1502. try
  1503. {
  1504. if (this.ultraTextEditor8.Text != "" && this.ultraCheckEditor1.Checked)
  1505. {
  1506. DataTable dt = this._departmentData.Tables[0].Copy();
  1507. foreach (DataRow dr in dt.Rows)
  1508. {
  1509. if (dr["DEPARTMENTNAME"].ToString() == this.ultraTextEditor8.Text)
  1510. {
  1511. selDept = dr["DEPARTMENTID"].ToString();
  1512. return;
  1513. }
  1514. }
  1515. }
  1516. }
  1517. catch
  1518. { }
  1519. }
  1520. #endregion
  1521. #region "ComboBox"
  1522. private void ultraComboEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1523. {
  1524. try
  1525. {
  1526. FrmSetDepart frm = new FrmSetDepart();
  1527. frm.GetChildIDFlag = false;
  1528. frm.Location = GetChildWindowLocation(frm.Size);
  1529. frm.ShowDialog();
  1530. InitComboBox();
  1531. if (frm.SelectedID != "" && frm.SelectedName != "")
  1532. {
  1533. this.ulcmeDepartment.Value = frm.SelectedID;
  1534. if (operDepart != "ROOT" && this.ulcmeDepartment.Value.ToString() == "ROOT")
  1535. {
  1536. this.ulcmeDepartment.Value = null;
  1537. MessageBox.Show("所属权限不允许选择选择整个公司!");
  1538. return;
  1539. }
  1540. if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1541. {
  1542. this.ulcmeDepartment.Value = null;
  1543. MessageBox.Show("你没有配置这一部门用户的权限,请重新选择部门!");
  1544. return;
  1545. }
  1546. }
  1547. }
  1548. catch
  1549. { }
  1550. }
  1551. private void ultraComboEditor2_SelectionChanged(object sender, System.EventArgs e)
  1552. {
  1553. try
  1554. {
  1555. if (operDepart != "ROOT" && ulcmeDepartment.Value.ToString() == "ROOT")
  1556. {
  1557. this.ulcmeDepartment.Value = null;
  1558. MessageBox.Show("所属权限不允许选择选择整个公司!");
  1559. return;
  1560. }
  1561. if (ulcmeDepartment.Value != null && allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
  1562. {
  1563. this.ulcmeDepartment.Value = null;
  1564. MessageBox.Show("你没有配置这一部门用户的权限,请重新选择部门!");
  1565. return;
  1566. }
  1567. }
  1568. catch
  1569. { }
  1570. }
  1571. #endregion
  1572. #region "CheckBox"
  1573. private void ultraCheckEditor1_CheckedChanged(object sender, System.EventArgs e)
  1574. {
  1575. this.ultraTextEditor8.Enabled = this.ultraCheckEditor1.Checked;
  1576. }
  1577. #endregion
  1578. private ArrayList listIpedt = new ArrayList();
  1579. private void createIpedt(int sum)
  1580. {
  1581. for (int i = 0; i < sum; i++)
  1582. {
  1583. if (this.listIpedt.Count >= 4)
  1584. {
  1585. break;
  1586. }
  1587. Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit ipedt = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
  1588. ipedt = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
  1589. ipedt.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.UseSpecifiedMask;
  1590. ipedt.InputMask = "nnn\\.nnn\\.nnn\\.nnn";
  1591. ipedt.Location = new System.Drawing.Point(3, 3);
  1592. ipedt.Name = "ulmskedtIP";
  1593. ipedt.Size = new System.Drawing.Size(136, 21);
  1594. ipedt.TabIndex = 12;
  1595. ipedt.Text = "...";
  1596. //this.toolTip1.SetToolTip(ipedt, "鼠标左击增加IP框;右击减少");
  1597. this.flowLayoutPanel1.Controls.Add(ipedt);
  1598. listIpedt.Add(ipedt);
  1599. }
  1600. }
  1601. private void deleteIpedt(int sum)
  1602. {
  1603. if (sum > 0 && listIpedt.Count - sum > 0)
  1604. {
  1605. int cnt = listIpedt.Count -sum;
  1606. for (int i=listIpedt.Count;i>cnt;i--){
  1607. Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit ipedt = (Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit) listIpedt[listIpedt.Count - 1];
  1608. ipedt.Dispose();
  1609. listIpedt.RemoveAt(listIpedt.Count - 1);
  1610. }
  1611. }
  1612. }
  1613. private string getIpstr()
  1614. {
  1615. string ipstr = "";
  1616. Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit ipedt;
  1617. for (int i = 0; i < listIpedt.Count; i++)
  1618. {
  1619. ipedt = (Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit)listIpedt[i];
  1620. if (!"...".Equals(ipedt.Value.ToString().Trim()) && !"".Equals(ipedt.Value.ToString().Trim()))
  1621. {
  1622. ipstr += ipedt.Value.ToString().Trim() + ";";
  1623. }
  1624. }
  1625. if (ipstr.Trim().Length>0&&";".Equals(ipstr.Substring(ipstr.Length - 1, 1)))
  1626. {
  1627. ipstr = ipstr.Substring(0, ipstr.Length - 1);
  1628. }
  1629. return ipstr;
  1630. }
  1631. private void ultraLabel9_MouseClick(object sender, MouseEventArgs e)
  1632. {
  1633. if (e.Button == MouseButtons.Left)
  1634. {
  1635. this.createIpedt(1);
  1636. }
  1637. if (e.Button == MouseButtons.Right)
  1638. {
  1639. this.deleteIpedt(1);
  1640. }
  1641. }
  1642. private void analysisIpstr(string ipstr)
  1643. {
  1644. Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit ipedt;
  1645. string[] ipR = ipstr.Split(new string[] { ";", @";" }, StringSplitOptions.None);
  1646. this.createIpedt(ipR.GetLength(0) - listIpedt.Count);
  1647. this.deleteIpedt(listIpedt.Count - ipR.GetLength(0));
  1648. for (int i = 0; i < ipR.GetLength(0); i++)
  1649. {
  1650. ipedt = (Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit) listIpedt[i];
  1651. ipedt.Text = ipR[i].ToString();
  1652. }
  1653. }
  1654. private bool checkIpstr(string IpRule)
  1655. {
  1656. if (string.IsNullOrEmpty(IpRule)) return true;
  1657. string[] ipR = IpRule.Split(new string[] { ";", @";" }, StringSplitOptions.None);
  1658. for (int i = 0; i < ipR.GetLength(0); i++)
  1659. {
  1660. string iprs = ipR[i].Trim();
  1661. string[] ipRules = iprs.Split(new string[] { ".", @"。" }, StringSplitOptions.None);
  1662. int min_len = ipRules.GetLength(0);
  1663. for (int idx = 0; idx < (min_len >= 4 ? 4 : min_len); idx++)
  1664. {
  1665. string ip_segment = ipRules[idx].Trim();
  1666. if (string.IsNullOrEmpty(ip_segment)) continue;
  1667. //检查ip规则配置是否正确 只允许包含 [数字]、[*]、[?] 三种字符;
  1668. Regex regex_segment = new Regex(@"^[0-9\?\*]{1,3}$");
  1669. if (!regex_segment.IsMatch(ip_segment))
  1670. {
  1671. MessageBox.Show(string.Format("IP规则第三段配置不正确![{0}]", ip_segment));
  1672. }
  1673. }
  1674. }
  1675. return true;
  1676. }
  1677. }
  1678. }