using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Core.Mes.ClientFrameWork;
using Core.Mes.IBaseInterface;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win.UltraWinEditors ;
using System.Data;
using System.Diagnostics;
using System.IO;

namespace Core.Mes.ClientPurviewManager
{

  /// <summary>
  /// FrmUserManager 的摘要说明。
  /// </summary>
  public class FrmUserManager : Core.Mes.ClientFrameWork.FrmBase
  {
    #region "Varible"
    private System.Windows.Forms.Panel panel1;
    private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
    private System.Windows.Forms.Panel FrmUserManager_Fill_Panel;
    private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left;
    private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right;
    private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top;
    private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom;
    private System.Windows.Forms.Panel panel2;
    private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
    private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
    private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
    private System.Windows.Forms.Panel panel3;
    private Infragistics.Win.Misc.UltraLabel ultraLabel2;
    private Infragistics.Win.Misc.UltraLabel ultraLabel3;
    private Infragistics.Win.Misc.UltraLabel ultraLabel4;
    private Infragistics.Win.Misc.UltraLabel ultraLabel5;
    private Infragistics.Win.Misc.UltraLabel ultraLabel6;
    private Infragistics.Win.Misc.UltraLabel ultraLabel7;
    private Infragistics.Win.Misc.UltraLabel ultraLabel8;
    private Infragistics.Win.Misc.UltraLabel ultraLabel9;
    private Infragistics.Win.Misc.UltraLabel ultraLabel10;
    private Infragistics.Win.Misc.UltraLabel ultraLabel11;
    private Infragistics.Win.UltraWinEditors.UltraComboEditor ulcmeSex;
    private Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit ulmskedtIP;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtUserNo;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtUserName;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtAge;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtGW;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtZW;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtPhono;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultxtMemo;
    private Infragistics.Win.Misc.UltraButton ultraButton1;
    private System.ComponentModel.IContainer components;
    private DataSet _departmentData;
    public TreeView _departmentTree;
    private string _selectPartSQL;
    public string StrUser = "";
    public string operDepart = "";
    public string operDepartname = "";
    public string allDept = "";
    public string selDept = "";

    private DataSet _userData;
    private Infragistics.Win.UltraWinEditors.UltraComboEditor ulcmeDepartment;
    private System.Windows.Forms.ToolTip toolTip1;
    private Infragistics.Win.UltraWinEditors.UltraCheckEditor ultraCheckEditor1;
    private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor8;
    private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ultraGridExcelExporter1;
    private UltraTextEditor ultxtEmail;
    private Infragistics.Win.Misc.UltraLabel ultraLabel1;
    private UltraTextEditor ultLoginID;
    private Infragistics.Win.Misc.UltraLabel ultraLabel12;
    private string _selectUserSQL;
    #endregion

    #region "头部"
    public FrmUserManager()
    {
      //
      // Windows 窗体设计器支持所必需的
      //
      InitializeComponent();

      //
      // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
      //
    }

    /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
        if (components != null)
        {
          components.Dispose();
        }
      }
      base.Dispose(disposing);
    }
    #endregion

    #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("Toolbar1");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("leadin");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("back");
        Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("leadin");
        Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
        Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("USERID");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("DEPARTMENTID", -1, null, 1, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("NAME");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("SEX");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("AGE");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn6 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("COMPUTERIP");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn7 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("HOMEPHONE");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn8 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("WORKPOS");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn9 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("WORKJOB");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn10 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("MEMO");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn11 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("EMAIL");
        Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn12 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("PD", -1, null, 0, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
        Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance16 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance17 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance18 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance19 = new Infragistics.Win.Appearance();
        Infragistics.Win.UltraWinEditors.EditorButton editorButton1 = new Infragistics.Win.UltraWinEditors.EditorButton();
        Infragistics.Win.Appearance appearance20 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance21 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance22 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance23 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance24 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance25 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance26 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance27 = new Infragistics.Win.Appearance();
        Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
        Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
        Infragistics.Win.Appearance appearance28 = new Infragistics.Win.Appearance();
        Infragistics.Win.UltraWinEditors.EditorButton editorButton2 = new Infragistics.Win.UltraWinEditors.EditorButton("SET");
        Infragistics.Win.Appearance appearance29 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance30 = new Infragistics.Win.Appearance();
        Infragistics.Win.Appearance appearance31 = new Infragistics.Win.Appearance();
        Infragistics.Win.UltraWinEditors.EditorButton editorButton3 = new Infragistics.Win.UltraWinEditors.EditorButton("part");
        this.panel1 = new System.Windows.Forms.Panel();
        this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
        this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
        this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
        this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
        this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
        this.FrmUserManager_Fill_Panel = new System.Windows.Forms.Panel();
        this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
        this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
        this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
        this.panel3 = new System.Windows.Forms.Panel();
        this.ultxtEmail = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
        this.ulmskedtIP = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
        this.ulcmeDepartment = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
        this.ultxtMemo = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtPhono = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtZW = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtGW = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtAge = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtUserName = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultxtUserNo = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ulcmeSex = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
        this.ultraLabel11 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel10 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel9 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel8 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel7 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel6 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel5 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel4 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel3 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
        this.panel2 = new System.Windows.Forms.Panel();
        this.ultLoginID = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultraLabel12 = new Infragistics.Win.Misc.UltraLabel();
        this.ultraTextEditor8 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
        this.ultraCheckEditor1 = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
        this.ultraButton1 = new Infragistics.Win.Misc.UltraButton();
        this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
        this.ultraGridExcelExporter1 = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter();
        this.panel1.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
        this.FrmUserManager_Fill_Panel.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
        this.ultraExpandableGroupBox1.SuspendLayout();
        this.ultraExpandableGroupBoxPanel1.SuspendLayout();
        this.panel3.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtEmail)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ulcmeDepartment)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtMemo)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtPhono)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtZW)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtGW)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtAge)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtUserName)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtUserNo)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ulcmeSex)).BeginInit();
        this.panel2.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.ultLoginID)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor8)).BeginInit();
        this.SuspendLayout();
        // 
        // panel1
        // 
        this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left);
        this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right);
        this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top);
        this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom);
        this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
        this.panel1.Location = new System.Drawing.Point(0, 0);
        this.panel1.Name = "panel1";
        this.panel1.Size = new System.Drawing.Size(1012, 32);
        this.panel1.TabIndex = 0;
        // 
        // _panel1_Toolbars_Dock_Area_Left
        // 
        this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
        this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
        this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
        this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
        this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 25);
        this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left";
        this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 7);
        this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
        // 
        // ultraToolbarsManager1
        // 
        this.ultraToolbarsManager1.DesignerFlags = 1;
        this.ultraToolbarsManager1.DockWithinContainer = this.panel1;
        this.ultraToolbarsManager1.ShowQuickCustomizeButton = false;
        this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005;
        ultraToolbar1.DockedColumn = 0;
        ultraToolbar1.DockedRow = 0;
        ultraToolbar1.Text = "Toolbar1";
        buttonTool1.InstanceProps.IsFirstInGroup = true;
        buttonTool2.InstanceProps.IsFirstInGroup = true;
        buttonTool3.InstanceProps.IsFirstInGroup = true;
        buttonTool4.InstanceProps.IsFirstInGroup = true;
        buttonTool5.InstanceProps.IsFirstInGroup = true;
        buttonTool6.InstanceProps.IsFirstInGroup = true;
        buttonTool7.InstanceProps.IsFirstInGroup = true;
        ultraToolbar1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool1,
            buttonTool2,
            buttonTool3,
            buttonTool4,
            buttonTool5,
            buttonTool6,
            buttonTool7});
        this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
            ultraToolbar1});
        buttonTool8.SharedProps.Caption = "新增(&A)";
        buttonTool8.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool8.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
        buttonTool9.SharedProps.Caption = "修改(&U)";
        buttonTool9.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool9.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlU;
        buttonTool10.SharedProps.Caption = "删除(&D)";
        buttonTool10.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool10.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
        buttonTool11.SharedProps.Caption = "查询(&Q)";
        buttonTool11.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool11.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlQ;
        buttonTool12.SharedProps.Caption = "关闭(&E)";
        buttonTool12.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool12.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
        buttonTool13.SharedProps.Caption = "返回(&B)";
        buttonTool13.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        buttonTool13.SharedProps.Visible = false;
        buttonTool14.SharedProps.Caption = "导入EXCEL";
        buttonTool14.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
        this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool8,
            buttonTool9,
            buttonTool10,
            buttonTool11,
            buttonTool12,
            buttonTool13,
            buttonTool14});
        this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
        // 
        // _panel1_Toolbars_Dock_Area_Right
        // 
        this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
        this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
        this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
        this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
        this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(1012, 25);
        this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right";
        this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 7);
        this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
        // 
        // _panel1_Toolbars_Dock_Area_Top
        // 
        this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
        this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
        this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
        this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
        this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
        this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top";
        this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(1012, 25);
        this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
        // 
        // _panel1_Toolbars_Dock_Area_Bottom
        // 
        this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
        this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
        this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
        this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
        this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 32);
        this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom";
        this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(1012, 0);
        this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
        // 
        // FrmUserManager_Fill_Panel
        // 
        this.FrmUserManager_Fill_Panel.Controls.Add(this.ultraGrid1);
        this.FrmUserManager_Fill_Panel.Controls.Add(this.ultraExpandableGroupBox1);
        this.FrmUserManager_Fill_Panel.Controls.Add(this.panel2);
        this.FrmUserManager_Fill_Panel.Controls.Add(this.panel1);
        this.FrmUserManager_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
        this.FrmUserManager_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
        this.FrmUserManager_Fill_Panel.Location = new System.Drawing.Point(0, 0);
        this.FrmUserManager_Fill_Panel.Name = "FrmUserManager_Fill_Panel";
        this.FrmUserManager_Fill_Panel.Size = new System.Drawing.Size(1012, 733);
        this.FrmUserManager_Fill_Panel.TabIndex = 0;
        // 
        // ultraGrid1
        // 
        this.ultraGrid1.Cursor = System.Windows.Forms.Cursors.Hand;
        appearance1.BackColor = System.Drawing.Color.LightSteelBlue;
        this.ultraGrid1.DisplayLayout.AddNewBox.ButtonAppearance = appearance1;
        appearance2.BackColor = System.Drawing.SystemColors.Window;
        appearance2.BorderColor = System.Drawing.SystemColors.InactiveCaption;
        this.ultraGrid1.DisplayLayout.Appearance = appearance2;
        ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn1.Header.Caption = "员工编号";
        ultraGridColumn1.Header.VisiblePosition = 0;
        ultraGridColumn1.Width = 80;
        ultraGridColumn2.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn2.Header.Caption = "部门";
        ultraGridColumn2.Header.VisiblePosition = 2;
        ultraGridColumn2.Width = 100;
        ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn3.Header.Caption = "姓名";
        ultraGridColumn3.Header.VisiblePosition = 5;
        ultraGridColumn3.Width = 80;
        ultraGridColumn4.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn4.Header.Caption = "性别";
        ultraGridColumn4.Header.VisiblePosition = 6;
        ultraGridColumn4.Width = 60;
        ultraGridColumn5.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn5.Header.Caption = "年龄";
        ultraGridColumn5.Header.VisiblePosition = 7;
        ultraGridColumn5.Hidden = true;
        ultraGridColumn6.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn6.Header.Caption = "机器地址";
        ultraGridColumn6.Header.VisiblePosition = 8;
        ultraGridColumn6.Width = 80;
        ultraGridColumn7.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn7.Header.Caption = "联系电话";
        ultraGridColumn7.Header.VisiblePosition = 9;
        ultraGridColumn7.Width = 100;
        ultraGridColumn8.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn8.Header.Caption = "岗位";
        ultraGridColumn8.Header.VisiblePosition = 3;
        ultraGridColumn8.Width = 100;
        ultraGridColumn9.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn9.Header.Caption = "职务";
        ultraGridColumn9.Header.VisiblePosition = 4;
        ultraGridColumn9.Width = 100;
        ultraGridColumn10.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn10.Header.Caption = "备注";
        ultraGridColumn10.Header.VisiblePosition = 11;
        ultraGridColumn10.Width = 100;
        ultraGridColumn11.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn11.Header.Caption = "邮件地址";
        ultraGridColumn11.Header.VisiblePosition = 10;
        ultraGridColumn11.Width = 100;
        ultraGridColumn12.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
        ultraGridColumn12.Header.Caption = "上级部门";
        ultraGridColumn12.Header.VisiblePosition = 1;
        ultraGridColumn12.Width = 100;
        ultraGridBand1.Columns.AddRange(new object[] {
            ultraGridColumn1,
            ultraGridColumn2,
            ultraGridColumn3,
            ultraGridColumn4,
            ultraGridColumn5,
            ultraGridColumn6,
            ultraGridColumn7,
            ultraGridColumn8,
            ultraGridColumn9,
            ultraGridColumn10,
            ultraGridColumn11,
            ultraGridColumn12});
        appearance3.BackColor = System.Drawing.Color.LightSteelBlue;
        ultraGridBand1.Override.RowSelectorAppearance = appearance3;
        appearance4.BackColor = System.Drawing.Color.White;
        ultraGridBand1.Override.RowSelectorHeaderAppearance = appearance4;
        ultraGridBand1.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
        ultraGridBand1.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
        ultraGridBand1.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
        this.ultraGrid1.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
        this.ultraGrid1.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
        this.ultraGrid1.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
        appearance5.BackColor = System.Drawing.SystemColors.ActiveBorder;
        appearance5.BackColor2 = System.Drawing.SystemColors.ControlDark;
        appearance5.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
        appearance5.BorderColor = System.Drawing.SystemColors.Window;
        this.ultraGrid1.DisplayLayout.GroupByBox.Appearance = appearance5;
        appearance6.ForeColor = System.Drawing.SystemColors.GrayText;
        this.ultraGrid1.DisplayLayout.GroupByBox.BandLabelAppearance = appearance6;
        this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
        this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
        appearance7.BackColor = System.Drawing.SystemColors.ControlLightLight;
        appearance7.BackColor2 = System.Drawing.SystemColors.Control;
        appearance7.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
        appearance7.ForeColor = System.Drawing.SystemColors.GrayText;
        this.ultraGrid1.DisplayLayout.GroupByBox.PromptAppearance = appearance7;
        this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1;
        this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1;
        appearance8.BackColor = System.Drawing.SystemColors.Window;
        appearance8.ForeColor = System.Drawing.SystemColors.ControlText;
        this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance = appearance8;
        appearance9.BackColor = System.Drawing.SystemColors.Highlight;
        appearance9.ForeColor = System.Drawing.SystemColors.HighlightText;
        this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance = appearance9;
        this.ultraGrid1.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
        this.ultraGrid1.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Dotted;
        appearance10.BackColor = System.Drawing.SystemColors.Window;
        this.ultraGrid1.DisplayLayout.Override.CardAreaAppearance = appearance10;
        appearance11.BorderColor = System.Drawing.Color.Silver;
        appearance11.TextTrimming = Infragistics.Win.TextTrimming.EllipsisCharacter;
        this.ultraGrid1.DisplayLayout.Override.CellAppearance = appearance11;
        this.ultraGrid1.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
        this.ultraGrid1.DisplayLayout.Override.CellPadding = 0;
        appearance12.BackColor = System.Drawing.SystemColors.Control;
        appearance12.BackColor2 = System.Drawing.SystemColors.ControlDark;
        appearance12.BackGradientAlignment = Infragistics.Win.GradientAlignment.Element;
        appearance12.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
        appearance12.BorderColor = System.Drawing.SystemColors.Window;
        this.ultraGrid1.DisplayLayout.Override.GroupByRowAppearance = appearance12;
        appearance13.BackColor = System.Drawing.Color.LightSteelBlue;
        appearance13.ImageHAlign = Infragistics.Win.HAlign.Center;
        appearance13.TextHAlign = Infragistics.Win.HAlign.Center;
        this.ultraGrid1.DisplayLayout.Override.HeaderAppearance = appearance13;
        this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
        this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
        this.ultraGrid1.DisplayLayout.Override.MinRowHeight = 21;
        appearance14.BackColor = System.Drawing.SystemColors.Window;
        appearance14.BorderColor = System.Drawing.Color.Silver;
        this.ultraGrid1.DisplayLayout.Override.RowAppearance = appearance14;
        appearance15.BackColor = System.Drawing.Color.LightSteelBlue;
        this.ultraGrid1.DisplayLayout.Override.RowSelectorAppearance = appearance15;
        this.ultraGrid1.DisplayLayout.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
        this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
        this.ultraGrid1.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
        appearance16.BackColor = System.Drawing.SystemColors.ControlLight;
        this.ultraGrid1.DisplayLayout.Override.TemplateAddRowAppearance = appearance16;
        this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
        this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
        this.ultraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
        this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.ultraGrid1.Location = new System.Drawing.Point(0, 88);
        this.ultraGrid1.Name = "ultraGrid1";
        this.ultraGrid1.Size = new System.Drawing.Size(1012, 477);
        this.ultraGrid1.TabIndex = 2;
        this.ultraGrid1.Text = "ultraGrid1";
        // 
        // ultraExpandableGroupBox1
        // 
        this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
        this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
        this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(1012, 168);
        this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 565);
        this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
        this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(1012, 168);
        this.ultraExpandableGroupBox1.SupportThemes = false;
        this.ultraExpandableGroupBox1.TabIndex = 3;
        this.ultraExpandableGroupBox1.Text = "编辑区域";
        this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
        // 
        // ultraExpandableGroupBoxPanel1
        // 
        this.ultraExpandableGroupBoxPanel1.Controls.Add(this.panel3);
        this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(2, 22);
        this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
        this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(1008, 144);
        this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
        // 
        // panel3
        // 
        this.panel3.BackColor = System.Drawing.Color.Gainsboro;
        this.panel3.Controls.Add(this.ultxtEmail);
        this.panel3.Controls.Add(this.ultraLabel1);
        this.panel3.Controls.Add(this.ulmskedtIP);
        this.panel3.Controls.Add(this.ulcmeDepartment);
        this.panel3.Controls.Add(this.ultxtMemo);
        this.panel3.Controls.Add(this.ultxtPhono);
        this.panel3.Controls.Add(this.ultxtZW);
        this.panel3.Controls.Add(this.ultxtGW);
        this.panel3.Controls.Add(this.ultxtAge);
        this.panel3.Controls.Add(this.ultxtUserName);
        this.panel3.Controls.Add(this.ultxtUserNo);
        this.panel3.Controls.Add(this.ulcmeSex);
        this.panel3.Controls.Add(this.ultraLabel11);
        this.panel3.Controls.Add(this.ultraLabel10);
        this.panel3.Controls.Add(this.ultraLabel9);
        this.panel3.Controls.Add(this.ultraLabel8);
        this.panel3.Controls.Add(this.ultraLabel7);
        this.panel3.Controls.Add(this.ultraLabel6);
        this.panel3.Controls.Add(this.ultraLabel5);
        this.panel3.Controls.Add(this.ultraLabel4);
        this.panel3.Controls.Add(this.ultraLabel3);
        this.panel3.Controls.Add(this.ultraLabel2);
        this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
        this.panel3.Location = new System.Drawing.Point(0, -8);
        this.panel3.Name = "panel3";
        this.panel3.Size = new System.Drawing.Size(1008, 152);
        this.panel3.TabIndex = 0;
        // 
        // ultxtEmail
        // 
        appearance17.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtEmail.Appearance = appearance17;
        this.ultxtEmail.AutoSize = true;
        this.ultxtEmail.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtEmail.Location = new System.Drawing.Point(560, 85);
        this.ultxtEmail.Name = "ultxtEmail";
        this.ultxtEmail.Size = new System.Drawing.Size(160, 21);
        this.ultxtEmail.TabIndex = 23;
        // 
        // ultraLabel1
        // 
        this.ultraLabel1.Location = new System.Drawing.Point(503, 86);
        this.ultraLabel1.Name = "ultraLabel1";
        this.ultraLabel1.Size = new System.Drawing.Size(54, 16);
        this.ultraLabel1.TabIndex = 22;
        this.ultraLabel1.Text = "邮件地址";
        // 
        // ulmskedtIP
        // 
        appearance18.BackColor = System.Drawing.Color.LightCyan;
        this.ulmskedtIP.Appearance = appearance18;
        this.ulmskedtIP.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.UseSpecifiedMask;
        this.ulmskedtIP.InputMask = "nnn\\.nnn\\.nnn\\.nnn";
        this.ulmskedtIP.Location = new System.Drawing.Point(313, 85);
        this.ulmskedtIP.Name = "ulmskedtIP";
        this.ulmskedtIP.Size = new System.Drawing.Size(136, 21);
        this.ulmskedtIP.TabIndex = 12;
        this.ulmskedtIP.Text = "...";
        // 
        // ulcmeDepartment
        // 
        appearance19.BackColor = System.Drawing.Color.LightCyan;
        this.ulcmeDepartment.Appearance = appearance19;
        this.ulcmeDepartment.AutoSize = true;
        this.ulcmeDepartment.ButtonsRight.Add(editorButton1);
        this.ulcmeDepartment.DropDownButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Never;
        this.ulcmeDepartment.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
        this.ulcmeDepartment.Location = new System.Drawing.Point(560, 17);
        this.ulcmeDepartment.Name = "ulcmeDepartment";
        this.ulcmeDepartment.Size = new System.Drawing.Size(160, 21);
        this.ulcmeDepartment.TabIndex = 21;
        this.ulcmeDepartment.SelectionChanged += new System.EventHandler(this.ultraComboEditor2_SelectionChanged);
        this.ulcmeDepartment.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraComboEditor2_EditorButtonClick);
        // 
        // ultxtMemo
        // 
        appearance20.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtMemo.Appearance = appearance20;
        this.ultxtMemo.AutoSize = true;
        this.ultxtMemo.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtMemo.Location = new System.Drawing.Point(81, 119);
        this.ultxtMemo.Name = "ultxtMemo";
        this.ultxtMemo.Size = new System.Drawing.Size(640, 21);
        this.ultxtMemo.TabIndex = 19;
        // 
        // ultxtPhono
        // 
        appearance21.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtPhono.Appearance = appearance21;
        this.ultxtPhono.AutoSize = true;
        this.ultxtPhono.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtPhono.Location = new System.Drawing.Point(560, 51);
        this.ultxtPhono.Name = "ultxtPhono";
        this.ultxtPhono.Size = new System.Drawing.Size(160, 21);
        this.ultxtPhono.TabIndex = 18;
        // 
        // ultxtZW
        // 
        appearance22.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtZW.Appearance = appearance22;
        this.ultxtZW.AutoSize = true;
        this.ultxtZW.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtZW.Location = new System.Drawing.Point(313, 51);
        this.ultxtZW.Name = "ultxtZW";
        this.ultxtZW.Size = new System.Drawing.Size(136, 21);
        this.ultxtZW.TabIndex = 17;
        // 
        // ultxtGW
        // 
        appearance23.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtGW.Appearance = appearance23;
        this.ultxtGW.AutoSize = true;
        this.ultxtGW.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtGW.Location = new System.Drawing.Point(81, 51);
        this.ultxtGW.Name = "ultxtGW";
        this.ultxtGW.Size = new System.Drawing.Size(136, 21);
        this.ultxtGW.TabIndex = 16;
        // 
        // ultxtAge
        // 
        appearance24.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtAge.Appearance = appearance24;
        this.ultxtAge.AutoSize = true;
        this.ultxtAge.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtAge.Location = new System.Drawing.Point(323, 63);
        this.ultxtAge.Name = "ultxtAge";
        this.ultxtAge.Size = new System.Drawing.Size(100, 21);
        this.ultxtAge.TabIndex = 15;
        this.ultxtAge.Visible = false;
        // 
        // ultxtUserName
        // 
        appearance25.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtUserName.Appearance = appearance25;
        this.ultxtUserName.AutoSize = true;
        this.ultxtUserName.BackColor = System.Drawing.Color.LightCyan;
        this.ultxtUserName.Location = new System.Drawing.Point(313, 17);
        this.ultxtUserName.Name = "ultxtUserName";
        this.ultxtUserName.Size = new System.Drawing.Size(136, 21);
        this.ultxtUserName.TabIndex = 14;
        // 
        // ultxtUserNo
        // 
        appearance26.BackColor = System.Drawing.Color.LavenderBlush;
        this.ultxtUserNo.Appearance = appearance26;
        this.ultxtUserNo.AutoSize = true;
        this.ultxtUserNo.BackColor = System.Drawing.Color.LavenderBlush;
        this.ultxtUserNo.Location = new System.Drawing.Point(81, 17);
        this.ultxtUserNo.Name = "ultxtUserNo";
        this.ultxtUserNo.Size = new System.Drawing.Size(136, 21);
        this.ultxtUserNo.TabIndex = 13;
        // 
        // ulcmeSex
        // 
        appearance27.BackColor = System.Drawing.Color.LightCyan;
        this.ulcmeSex.Appearance = appearance27;
        this.ulcmeSex.AutoSize = true;
        this.ulcmeSex.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
        valueListItem1.DataValue = "男";
        valueListItem1.DisplayText = "男";
        valueListItem2.DataValue = "女";
        valueListItem2.DisplayText = "女";
        this.ulcmeSex.Items.Add(valueListItem1);
        this.ulcmeSex.Items.Add(valueListItem2);
        this.ulcmeSex.Location = new System.Drawing.Point(81, 85);
        this.ulcmeSex.Name = "ulcmeSex";
        this.ulcmeSex.Size = new System.Drawing.Size(136, 21);
        this.ulcmeSex.TabIndex = 11;
        // 
        // ultraLabel11
        // 
        this.ultraLabel11.Location = new System.Drawing.Point(36, 120);
        this.ultraLabel11.Name = "ultraLabel11";
        this.ultraLabel11.Size = new System.Drawing.Size(42, 16);
        this.ultraLabel11.TabIndex = 9;
        this.ultraLabel11.Text = "备  注";
        // 
        // ultraLabel10
        // 
        this.ultraLabel10.Location = new System.Drawing.Point(503, 52);
        this.ultraLabel10.Name = "ultraLabel10";
        this.ultraLabel10.Size = new System.Drawing.Size(54, 16);
        this.ultraLabel10.TabIndex = 8;
        this.ultraLabel10.Text = "联系电话";
        // 
        // ultraLabel9
        // 
        this.ultraLabel9.Location = new System.Drawing.Point(244, 86);
        this.ultraLabel9.Name = "ultraLabel9";
        this.ultraLabel9.Size = new System.Drawing.Size(66, 16);
        this.ultraLabel9.TabIndex = 7;
        this.ultraLabel9.Text = "机器IP地址";
        // 
        // ultraLabel8
        // 
        this.ultraLabel8.Location = new System.Drawing.Point(528, 18);
        this.ultraLabel8.Name = "ultraLabel8";
        this.ultraLabel8.Size = new System.Drawing.Size(29, 16);
        this.ultraLabel8.TabIndex = 6;
        this.ultraLabel8.Text = "部门";
        // 
        // ultraLabel7
        // 
        this.ultraLabel7.Location = new System.Drawing.Point(281, 52);
        this.ultraLabel7.Name = "ultraLabel7";
        this.ultraLabel7.Size = new System.Drawing.Size(29, 16);
        this.ultraLabel7.TabIndex = 5;
        this.ultraLabel7.Text = "职务";
        // 
        // ultraLabel6
        // 
        this.ultraLabel6.Location = new System.Drawing.Point(290, 66);
        this.ultraLabel6.Name = "ultraLabel6";
        this.ultraLabel6.Size = new System.Drawing.Size(32, 16);
        this.ultraLabel6.TabIndex = 4;
        this.ultraLabel6.Text = "年龄";
        this.ultraLabel6.Visible = false;
        // 
        // ultraLabel5
        // 
        this.ultraLabel5.Location = new System.Drawing.Point(281, 18);
        this.ultraLabel5.Name = "ultraLabel5";
        this.ultraLabel5.Size = new System.Drawing.Size(29, 16);
        this.ultraLabel5.TabIndex = 3;
        this.ultraLabel5.Text = "姓名";
        // 
        // ultraLabel4
        // 
        this.ultraLabel4.Location = new System.Drawing.Point(49, 52);
        this.ultraLabel4.Name = "ultraLabel4";
        this.ultraLabel4.Size = new System.Drawing.Size(29, 16);
        this.ultraLabel4.TabIndex = 2;
        this.ultraLabel4.Text = "岗位";
        // 
        // ultraLabel3
        // 
        this.ultraLabel3.Location = new System.Drawing.Point(49, 86);
        this.ultraLabel3.Name = "ultraLabel3";
        this.ultraLabel3.Size = new System.Drawing.Size(29, 16);
        this.ultraLabel3.TabIndex = 1;
        this.ultraLabel3.Text = "性别";
        // 
        // ultraLabel2
        // 
        this.ultraLabel2.Location = new System.Drawing.Point(24, 18);
        this.ultraLabel2.Name = "ultraLabel2";
        this.ultraLabel2.Size = new System.Drawing.Size(54, 16);
        this.ultraLabel2.TabIndex = 0;
        this.ultraLabel2.Text = "员工编号";
        // 
        // panel2
        // 
        this.panel2.BackColor = System.Drawing.Color.Gainsboro;
        this.panel2.Controls.Add(this.ultLoginID);
        this.panel2.Controls.Add(this.ultraLabel12);
        this.panel2.Controls.Add(this.ultraTextEditor8);
        this.panel2.Controls.Add(this.ultraCheckEditor1);
        this.panel2.Controls.Add(this.ultraButton1);
        this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
        this.panel2.Location = new System.Drawing.Point(0, 32);
        this.panel2.Name = "panel2";
        this.panel2.Size = new System.Drawing.Size(1012, 56);
        this.panel2.TabIndex = 1;
        // 
        // ultLoginID
        // 
        appearance28.BackColor = System.Drawing.Color.LightCyan;
        this.ultLoginID.Appearance = appearance28;
        this.ultLoginID.AutoSize = true;
        this.ultLoginID.BackColor = System.Drawing.Color.LightCyan;
        appearance29.TextHAlign = Infragistics.Win.HAlign.Center;
        appearance29.TextVAlign = Infragistics.Win.VAlign.Middle;
        editorButton2.Appearance = appearance29;
        editorButton2.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
        editorButton2.Key = "SET";
        editorButton2.Text = "";
        this.ultLoginID.ButtonsRight.Add(editorButton2);
        this.ultLoginID.FlatMode = true;
        this.ultLoginID.Location = new System.Drawing.Point(371, 18);
        this.ultLoginID.Name = "ultLoginID";
        this.ultLoginID.Size = new System.Drawing.Size(152, 19);
        this.ultLoginID.TabIndex = 3;
        this.ultLoginID.Visible = false;
        this.ultLoginID.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultLoginID_EditorButtonClick);
        // 
        // ultraLabel12
        // 
        appearance30.BackColor = System.Drawing.Color.Gainsboro;
        this.ultraLabel12.Appearance = appearance30;
        this.ultraLabel12.Location = new System.Drawing.Point(313, 22);
        this.ultraLabel12.Name = "ultraLabel12";
        this.ultraLabel12.Size = new System.Drawing.Size(54, 16);
        this.ultraLabel12.TabIndex = 0;
        this.ultraLabel12.Text = "员工编号";
        this.ultraLabel12.Visible = false;
        // 
        // ultraTextEditor8
        // 
        appearance31.BackColor = System.Drawing.Color.Gainsboro;
        this.ultraTextEditor8.Appearance = appearance31;
        this.ultraTextEditor8.AutoSize = true;
        this.ultraTextEditor8.BackColor = System.Drawing.Color.Gainsboro;
        editorButton3.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
        editorButton3.Key = "part";
        editorButton3.Text = "…";
        this.ultraTextEditor8.ButtonsRight.Add(editorButton3);
        this.ultraTextEditor8.Enabled = false;
        this.ultraTextEditor8.FlatMode = true;
        this.ultraTextEditor8.Location = new System.Drawing.Point(86, 18);
        this.ultraTextEditor8.Name = "ultraTextEditor8";
        this.ultraTextEditor8.ReadOnly = true;
        this.ultraTextEditor8.Size = new System.Drawing.Size(149, 19);
        this.ultraTextEditor8.TabIndex = 1;
        this.ultraTextEditor8.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.ultraTextEditor8_EditorButtonClick);
        // 
        // ultraCheckEditor1
        // 
        this.ultraCheckEditor1.Location = new System.Drawing.Point(31, 18);
        this.ultraCheckEditor1.Name = "ultraCheckEditor1";
        this.ultraCheckEditor1.Size = new System.Drawing.Size(48, 20);
        this.ultraCheckEditor1.TabIndex = 0;
        this.ultraCheckEditor1.Text = "部门";
        this.ultraCheckEditor1.CheckedChanged += new System.EventHandler(this.ultraCheckEditor1_CheckedChanged);
        // 
        // ultraButton1
        // 
        this.ultraButton1.Location = new System.Drawing.Point(237, 17);
        this.ultraButton1.Name = "ultraButton1";
        this.ultraButton1.Size = new System.Drawing.Size(27, 21);
        this.ultraButton1.TabIndex = 2;
        this.ultraButton1.Text = ">>";
        this.toolTip1.SetToolTip(this.ultraButton1, "部门维护");
        this.ultraButton1.Visible = false;
        this.ultraButton1.Click += new System.EventHandler(this.ultraButton1_Click);
        // 
        // FrmUserManager
        // 
        this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
        this.ClientSize = new System.Drawing.Size(1012, 733);
        this.Controls.Add(this.FrmUserManager_Fill_Panel);
        this.Name = "FrmUserManager";
        this.Text = "系统用户管理";
        this.Load += new System.EventHandler(this.FrmUserManager_Load);
        this.panel1.ResumeLayout(false);
        ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
        this.FrmUserManager_Fill_Panel.ResumeLayout(false);
        ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
        this.ultraExpandableGroupBox1.ResumeLayout(false);
        this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
        this.panel3.ResumeLayout(false);
        ((System.ComponentModel.ISupportInitialize)(this.ultxtEmail)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ulcmeDepartment)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtMemo)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtPhono)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtZW)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtGW)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtAge)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtUserName)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultxtUserNo)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ulcmeSex)).EndInit();
        this.panel2.ResumeLayout(false);
        ((System.ComponentModel.ISupportInitialize)(this.ultLoginID)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor8)).EndInit();
        this.ResumeLayout(false);

    }
    #endregion

    #region "显示窗体"

    private void FrmUserManager_Load(object sender, System.EventArgs e)
    {
      StrUser = Core.Mes.ClientFrameWork.ClientCommon._UserInfo.UserName;

      GetDepartmentData();
      GetUserData("", true);
      GetOperDepart();
      GetChildDept();
      InitComboBox();
      InitGrid();
      if (operDepart == "ROOT")
      {
        ultraButton1.Visible = true;
      }

    }
    private void GetDepartmentData()
    {
      try
      {
        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "SelectUAM_DEPARTMENT";
        par.args = new object[] { " order by DEPARTMENTID " };

        string strOut = "";

        _departmentData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;

        _selectPartSQL = strOut;
      }
      catch
      { }
    }

    private void InitComboBox()
    {
      if (_departmentData != null && _departmentData.Tables.Count > 0)
      {
        DataTable dt = this._departmentData.Tables[0].Copy();

        this.ulcmeDepartment.Items.Clear();
        foreach (DataRow dr in dt.Rows)
        {
          if (dr["DEPARTMENTID"].ToString() == "ROOT" && operDepart != "ROOT") continue;
          try
          {
            this.ulcmeDepartment.Items.Add(dr["DEPARTMENTID"], dr["DEPARTMENTNAME"].ToString());
          }
          catch
          { }
        }
      }
    }
    private void GetUserData(string strWhere, bool flag)
    {
      try
      {
        if (!flag)
        {
          _userData.Tables[0].DefaultView.RowFilter = strWhere;
          return;
        }
        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "SelectUAM_USER";
        par.args = new object[] { strWhere };

        string strOut = "";

        _userData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;

        _selectUserSQL = strOut;
      }
      catch
      { }
    }
    private void GetOperDepart()
    {
      try
      {
        if (_userData != null && _userData.Tables.Count > 0)
        {
          DataTable dt = this._userData.Tables[0].Copy();

          foreach (DataRow dr in dt.Rows)
          {
            if (dr["NAME"].ToString() == StrUser)
            {
              operDepart = dr["DEPARTMENTID"].ToString();
              //operDepart=operDepart.Substring(0,3);
              //if(operDepart=="xg0")
              //{
              //    operDepart="xg";
              //}
              DataTable dn = this._departmentData.Tables[0].Copy();
              foreach (DataRow dm in dn.Rows)
              {
                if (dm["DEPARTMENTID"].ToString() == operDepart)
                {
                  operDepartname = dm["DEPARTMENTNAME"].ToString();
                }
              }
            }
          }
        }
      }
      catch
      { }
    }
    private void InitGrid()
    {
      #region "	ValueList	"
      GetPartData();
      ultraGrid1.DisplayLayout.Bands[0].Columns["DEPARTMENTID"].ValueList = ultraGrid1.DisplayLayout.ValueLists["part"];
      ultraGrid1.DisplayLayout.Bands[0].Columns["PD"].ValueList = ultraGrid1.DisplayLayout.ValueLists["part"];
      #endregion

      this.ultraCheckEditor1.CheckedValue = true;
      this.ultraTextEditor8.Enabled = true;
      this.ultraTextEditor8.Text = operDepartname;
      this.ultraTextEditor8.Tag = allDept;
      Query();
      //			this.ultraGrid1.DataSource = this._userData.Tables[0];

      this.ultraGrid1.AfterRowActivate += new EventHandler(ultraGrid1_AfterRowActivate);
    }
    private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
    {
      try
      {
        if (this.ultraGrid1.ActiveRow == null) return;
        UltraGridRow ugr = this.ultraGrid1.ActiveRow;

        this.ultxtUserNo.Text = ugr.Cells["USERID"].Value.ToString();
        this.ulcmeDepartment.Value = ugr.Cells["DEPARTMENTID"].Value;
        this.ultxtUserName.Text = ugr.Cells["NAME"].Value.ToString();
        this.ulcmeSex.Text = ugr.Cells["SEX"].Value.ToString();
        this.ultxtAge.Text = ugr.Cells["AGE"].Value.ToString();
        this.ulmskedtIP.Text = ugr.Cells["COMPUTERIP"].Value.ToString();
        this.ultxtPhono.Text = ugr.Cells["HOMEPHONE"].Value.ToString();
        this.ultxtGW.Text = ugr.Cells["WORKPOS"].Value.ToString();
        this.ultxtZW.Text = ugr.Cells["WORKJOB"].Value.ToString();
        this.ultxtMemo.Text = ugr.Cells["MEMO"].Value.ToString();
        this.ultxtEmail.Text = ugr.Cells["EMAIL"].Value.ToString();
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
      }
    }
    private void GetPartData()
    {
      if (ultraGrid1.DisplayLayout.ValueLists.Exists("part"))
        ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
      else
        ultraGrid1.DisplayLayout.ValueLists.Add("part");
      //try
      //{
      //    ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Clear();
      //}
      //catch
      //{
      //    ultraGrid1.DisplayLayout.ValueLists.Add("part");
      //}
      DataTable dt = this._departmentData.Tables[0].Copy();
      foreach (DataRow dr in dt.Rows)
      {
        Infragistics.Win.ValueListItem vli = new Infragistics.Win.ValueListItem();
        vli.DisplayText = dr["DEPARTMENTNAME"].ToString();
        vli.DataValue = dr["DEPARTMENTID"];
        ultraGrid1.DisplayLayout.ValueLists["part"].ValueListItems.Add(vli);
      }
    }
    #endregion

    #region "工具栏操作"
    private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
    {
      switch (e.Tool.Key)
      {
        case "add":
          Add();
          GetUserData("", true);
          break;
        case "del":
          Del();
          break;
        case "edit":
          Edit();
          break;
        case "query":
          Query();
          break;
        case "exit":
          this.Close();
          break;
        case "back":
          //                  this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible=false;
          //				    RefreshGrid("");
          //					ultraCheckEditor1.Checked = false;
          //					ultraTextEditor8.Text = "";
          this.ultraCheckEditor1.CheckedValue = true;
          if (ultLoginID.Text.Trim().Length > 0)
          {
            ultLoginID.Tag = ultLoginID.Text.Trim();
            ultLoginID.Text = "";
          }
          this.ultraTextEditor8.Enabled = true;
          this.ultraTextEditor8.Text = operDepartname;
          this.ultraTextEditor8.Tag = allDept;
          Query();
          break;
        case "leadin":
          try
          {
            string StrfileName = string.Format("c:\\{0}.xls", this.Text);
            this.ultraGridExcelExporter1.Export(this.ultraGrid1, StrfileName);

            ProcessStartInfo p = new ProcessStartInfo(StrfileName);
            p.WorkingDirectory = Path.GetDirectoryName(StrfileName);
            Process.Start(p);
          }
          catch (Exception ex)
          {
            MessageBox.Show(ex.Message);
          }
          break;
      }
    }
    private void Add()
    {
      if (this.ultxtUserNo.Text.Trim() == "")
      {
        MessageBox.Show("请录入员工编号！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ultxtUserName.Text.Trim() == "")
      {
        MessageBox.Show("请录入员工姓名！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ulcmeDepartment.Value == null)
      {
        MessageBox.Show("请选择员工所在部门！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ulcmeDepartment.Value.ToString() == "ROOT")
      {
        this.ulcmeDepartment.Value = null;
        MessageBox.Show("必须选择下属部门!");
        return;
      }
      if (!(RightsComm.CheckRole(ulcmeDepartment.Value.ToString())))
      {
        return;
      }
      //if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
      //{
      //  this.ulcmeDepartment.Value = null;
      //  MessageBox.Show("你没有配置这一部门用户的权限，请重新选择部门!");
      //  return;
      //}
      ArrayList al = new ArrayList();

      al.Add(this.ultxtUserNo.Text.Trim());
      al.Add(this.ulcmeDepartment.Value);
      al.Add(this.ultxtUserName.Text.Trim());
      if (this.ulcmeSex.SelectedIndex != -1)
      {
        al.Add(this.ulcmeSex.Text.Trim());
      }
      else
      {
        al.Add("");
      }

      if (this.ultxtAge.Text == "")
        al.Add(0);
      else
        al.Add(this.ultxtAge.Text.Trim());

      al.Add(this.ulmskedtIP.Text.Trim());
      al.Add(this.ultxtPhono.Text.Trim());
      al.Add(this.ultxtGW.Text.Trim());
      al.Add(this.ultxtZW.Text.Trim());
      al.Add(this.ultxtMemo.Text.Trim());
      al.Add(this.ultxtEmail.Text.Trim());

      try
      {
        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "InsertUAM_USER";
        par.args = new object[] { al };

        string strOut = "";

        object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

        if (strOut != "")
        {
          MessageBox.Show("新增失败! \n" + strOut);
          return;
        }
        else
        {
          if ((int)obj != 1)
          {
            MessageBox.Show("新增失败!");
            return;
          }
        }
      }
      catch
      {
        return;
      }
      this.GetDepartmentData();
      UltraGridRow ugr = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
      ugr.Cells["USERID"].Value = al[0];
      ugr.Cells["DEPARTMENTID"].Value = al[1];
      ugr.Cells["NAME"].Value = al[2];
      ugr.Cells["SEX"].Value = al[3];
      ugr.Cells["AGE"].Value = al[4];
      ugr.Cells["COMPUTERIP"].Value = al[5];
      ugr.Cells["HOMEPHONE"].Value = al[6];
      ugr.Cells["WORKPOS"].Value = al[7];
      ugr.Cells["WORKJOB"].Value = al[8];
      ugr.Cells["MEMO"].Value = al[9];
      ugr.Cells["EMAIL"].Value = al[10];
      for (int i = 0; i < _departmentData.Tables[0].Rows.Count; i++)
      {
        if (_departmentData.Tables[0].Rows[i]["DEPARTMENTID"].ToString() == al[1].ToString())
        {
          ugr.Cells["PD"].Value = _departmentData.Tables[0].Rows[i]["DEPARTMENTPID"].ToString();
          break;
        }
      }

      this.ultraGrid1.UpdateData();
    }
    private void Del()
    {
      int i = 0;
      UltraGridRow ugr = this.ultraGrid1.ActiveRow;
      if (ugr == null)
      {
        MessageBox.Show("请选择要删除的员工!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (MessageBox.Show("是否确认删除选中的员工?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
      {
        return;
      }
      try
      {
        string OpDptID = "";
        if(!(RightsComm.CheckRole(OpDptID)))
          return;
        i = ugr.Index;

        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "DeleteUAM_USER";
        par.args = new object[] { ugr.Cells[0].Value.ToString() };

        string strOut = "";

        object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

        if (strOut != "")
        {
          MessageBox.Show("删除失败! \n" + strOut);
          return;
        }
        else
        {
          if ((int)obj != 1)
          {
            MessageBox.Show("删除失败!");
            return;
          }
        }
      }
      catch //(Exception ex)
      {
        //			CoreMesLogger.log(this.GetType()).Error(ex.Message);
        return;
      }

      this.ultraGrid1.ActiveRow.Delete(false);
      this.ultraGrid1.UpdateData();

      try
      {
        this.ultraGrid1.Rows[i].Activate();
      }
      catch
      {
        int count = this.ultraGrid1.Rows.Count;
        if (count > 0)
          this.ultraGrid1.Rows[count - 1].Activate();
      }
    }
    private void Edit()
    {
      UltraGridRow ugr = this.ultraGrid1.ActiveRow;
      if (ugr == null)
      {
        MessageBox.Show("请选择要修改的员工!");
        return;
      }
      if (this.ultxtUserNo.Text.Trim() != ugr.Cells["USERID"].Text.Trim())
      {
        MessageBox.Show("不能修改员工编号！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ultxtUserName.Text.Trim() == "")
      {
        MessageBox.Show("请录入员工姓名！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ulcmeDepartment.Value == null)
      {
        MessageBox.Show("请选择员工所在部门！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return;
      }
      if (this.ulcmeDepartment.Value.ToString() == "ROOT")
      {
        this.ulcmeDepartment.Value = null;
        MessageBox.Show("必须选择下属部门!");
        return;
      }
      if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
      {
        this.ulcmeDepartment.Value = null;
        MessageBox.Show("你没有修改该用户的权限，请重新选择部门!");
        return;
      }
      ArrayList al = new ArrayList();

      al.Add(this.ultxtUserNo.Text.Trim());

      al.Add(this.ulcmeDepartment.Value);

      al.Add(this.ultxtUserName.Text.Trim());
      al.Add(this.ulcmeSex.Text.Trim());
      al.Add((ultxtAge.Text.Trim() != "") ? ultxtAge.Text.Trim() : "0");
      al.Add(this.ulmskedtIP.Text.Trim());

      al.Add(this.ultxtPhono.Text.Trim());
      al.Add(this.ultxtGW.Text.Trim());
      al.Add(this.ultxtZW.Text.Trim());
      al.Add(this.ultxtMemo.Text.Trim());
      al.Add(this.ultxtEmail.Text.Trim());

      try
      {
        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "UpdateUAM_USER";
        par.args = new object[] { al };

        string strOut = "";

        object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

        if (strOut != "")
        {
          MessageBox.Show("修改失败 \n" + strOut);
          return;
        }
        else
        {
          int i = (int)obj;
          if (i != 1)
          {
            MessageBox.Show("修改失败");
            return;
          }
        }
      }
      catch //(Exception ex)
      {
        //			CoreMesLogger.log(this.GetType()).Error(ex.Message);
        return;
      }
      ugr.Cells["DEPARTMENTID"].Value = al[1];
      ugr.Cells["NAME"].Value = al[2];
      ugr.Cells["SEX"].Value = al[3];
      ugr.Cells["AGE"].Value = al[4];
      ugr.Cells["COMPUTERIP"].Value = al[5];
      ugr.Cells["HOMEPHONE"].Value = al[6];
      ugr.Cells["WORKPOS"].Value = al[7];
      ugr.Cells["WORKJOB"].Value = al[8];
      ugr.Cells["MEMO"].Value = al[9];
      ugr.Cells["EMAIL"].Value = al[10];
      for (int i = 0; i < _departmentData.Tables[0].Rows.Count; i++)
      {
        if (_departmentData.Tables[0].Rows[i]["DEPARTMENTID"].ToString() == al[1].ToString())
        {
          ugr.Cells["PD"].Value = _departmentData.Tables[0].Rows[i]["DEPARTMENTPID"].ToString();
          break;
        }
      }

      this.ultraGrid1.UpdateData();
    }
    private void Query()
    {
      try
      {
        if ((this.ultraTextEditor8.Text == null || !this.ultraCheckEditor1.Checked) &&
            (this.ultLoginID.Text.Trim().Length == 0))
        {
          MessageBox.Show("请选择要查询的部门或员工编号！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
          return;
        }
        if (this.ultraCheckEditor1.Checked && this.ultraTextEditor8.Text != "")
        {
          GetSelDept();
          if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
          {
            MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
            return;
          }
        }
        this.ultraToolbarsManager1.Toolbars[0].Tools["back"].SharedProps.Visible = true;
        string strWhere = "";
        if (this.ultraTextEditor8.Tag.ToString().Length > 0)
          strWhere = " WHERE DEPARTMENTID in (" + this.ultraTextEditor8.Tag.ToString() + ")";
        //strWhere = GetRefreshWhere();
        //strWhere = " where " + strWhere;

        CallingMessage par = new CallingMessage();
        par.ServerName = "PurviewManager";
        par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
        par.MethodName = "GetUAM_USER";
        par.args = new object[] { strWhere };

        string strOut = "";

        DataSet obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
        this.ultraGrid1.DataSource = obj.Tables[0];
        this.ultraGrid1.Refresh();
      }
      catch (System.Exception ex)
      {
        System.Diagnostics.Debug.WriteLine(ex.ToString());
      }
    }
    private string GetRefreshWhere()
    {
      string sqlstr = "";
      if (this.ultraTextEditor8.Enabled && this.ultraCheckEditor1.Checked && this.ultraTextEditor8.Text != "")
      {
        ArrayList al = this.GetUserID();
        if (al == null || al.Count == 0)
        {
          sqlstr = "1=2";
        }
        else
        {
          sqlstr += " USERID in ('" + al[0].ToString() + "'";
          for (int i = 1; i < al.Count; i++)
          {
            sqlstr += ", '" + al[i].ToString() + "' ";
          }
          sqlstr += ")";

        }
      }
      if (this.ultLoginID.Text.Trim().Length > 0)
      {
        if (sqlstr != "")
          sqlstr += " and ";
        sqlstr += " USERID = '" + this.ultLoginID.Text.Trim() + "'";
      }
      return sqlstr;
    }
    private ArrayList GetUserID()
    {
      ArrayList al = new ArrayList();
      DataTable dt = null;
      if (this._userData == null)
        dt = null;
      else
        dt = this._userData.Tables[0];

      if (dt != null)
      {
        if (this.ultraTextEditor8.Enabled && this.ultraTextEditor8.Tag != null)
        {
          string partid = this.ultraTextEditor8.Tag.ToString();

          string strFilter = "DEPARTMENTID in (" + partid + ")";

          dt.DefaultView.RowFilter = strFilter;
        }

        for (int i = 0; i < dt.DefaultView.Count; i++)
        {
          al.Add(dt.DefaultView[i]["USERID"].ToString());
        }

        return al;
      }
      else
        return null;
    }
    private void RefreshGrid(string strWhere)
    {
      CallingMessage par = new CallingMessage();
      par.ServerName = "PurviewManager";
      par.ClassName = "Core.Mes.PurviewManager.PurviewManager";
      par.MethodName = "SelectUAM_USER";
      par.args = new object[] { strWhere };

      string strOut = "";

      DataSet obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;
      this.ultraGrid1.DataSource = obj.Tables[0];
      this.ultraGrid1.Refresh();
    }
    #endregion

    #region "Button"
    private void ultraButton1_Click(object sender, System.EventArgs e)
    {
      foreach (Form mdiChild in this.MdiParent.MdiChildren)
      {
        if (mdiChild.Text == "部门管理")
        {
          mdiChild.Activate();
          return;
        }
      }

      FrmDepartment frmpart = new FrmDepartment();

      //			frmpart.RemotingHelp = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp;
      frmpart.MdiParent = this.ParentForm;
      frmpart.Show();
    }
    #endregion

    #region "TextBox"
    private void ultraTextEditor8_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
    {
      try
      {
        FrmSetDepart frm = new FrmSetDepart();
        frm.Location = GetChildWindowLocation(frm.Size);
        frm.ShowDialog();
        if (frm.SelectedID != "" && frm.SelectedName != "")
        {
          this.ultraTextEditor8.Text = frm.SelectedName;
          this.ultraTextEditor8.Tag = frm.SelectedID;
        }
        if (this.ultraTextEditor8.Text != "" && this.ultraCheckEditor1.Checked)
        {
          GetSelDept();
          if (operDepart != "ROOT" && allDept.IndexOf("'" + selDept + "'") < 0)
          {
            MessageBox.Show("你没有查看这一部门的权限,请重新选择!");
          }
        }
      }
      catch
      { }
    }
    private void ultLoginID_EditorButtonClick(object sender, EditorButtonEventArgs e)
    {
      try
      {
        if (e.Button.Key == "SET")
        {
          if (ultLoginID.Text.Trim().Length > 0)
          {
            ultLoginID.Tag = ultLoginID.Text.Trim();
            ultLoginID.Text = "";
          }
          else
          {
            if (ultLoginID.Tag != null)
              ultLoginID.Text = ultLoginID.Tag.ToString();
          }
        }
      }
      catch { }
    }
    #endregion

    #region "Custom Method"
    private Point GetChildWindowLocation(Size ChildWindowSize)
    {
      int width = Cursor.Position.X + ChildWindowSize.Width - Screen.PrimaryScreen.Bounds.Width;
      int height = Cursor.Position.Y + ChildWindowSize.Height - Screen.PrimaryScreen.Bounds.Height + 30;

      if (width > 0)
        width = Cursor.Position.X - width;
      else
        width = Cursor.Position.X;
      if (height > 0)
        height = Cursor.Position.Y - height + 10;
      else
        height = Cursor.Position.Y + 10;

      return new Point(width, height);
    }
    private void GetChildDept()
    {
      try
      {
        string strOut = "";
        DataSet ds = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("PurviewManager", "Core.Mes.PurviewManager.UAM_USER", "SelectChildDept", new object[] { operDepart }, out strOut) as DataSet;
        if (ds.Tables[0].Rows[0][0].ToString() != "")
        {
          allDept = "'" + ds.Tables[0].Rows[0][0].ToString() + "'" + operDepart + "'";
        }
        else
          allDept = "'" + operDepart + "'";
      }
      catch
      { }
    }
    private void GetSelDept()
    {
      try
      {
        if (this.ultraTextEditor8.Text != "" && this.ultraCheckEditor1.Checked)
        {
          DataTable dt = this._departmentData.Tables[0].Copy();
          foreach (DataRow dr in dt.Rows)
          {
            if (dr["DEPARTMENTNAME"].ToString() == this.ultraTextEditor8.Text)
            {
              selDept = dr["DEPARTMENTID"].ToString();
              return;
            }
          }
        }
      }
      catch
      { }
    }
    #endregion

    #region "ComboBox"
    private void ultraComboEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
    {
      try
      {
        FrmSetDepart frm = new FrmSetDepart();
        frm.GetChildIDFlag = false;
        frm.Location = GetChildWindowLocation(frm.Size);
        frm.ShowDialog();

        InitComboBox();

        if (frm.SelectedID != "" && frm.SelectedName != "")
        {
          this.ulcmeDepartment.Value = frm.SelectedID;
          if (operDepart != "ROOT" && this.ulcmeDepartment.Value.ToString() == "ROOT")
          {
            this.ulcmeDepartment.Value = null;
            MessageBox.Show("所属权限不允许选择选择整个公司!");
            return;
          }
          if (allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
          {
            this.ulcmeDepartment.Value = null;
            MessageBox.Show("你没有配置这一部门用户的权限，请重新选择部门!");
            return;
          }
        }
      }
      catch
      { }
    }
    private void ultraComboEditor2_SelectionChanged(object sender, System.EventArgs e)
    {
      try
      {
        if (operDepart != "ROOT" && ulcmeDepartment.Value.ToString() == "ROOT")
        {
          this.ulcmeDepartment.Value = null;
          MessageBox.Show("所属权限不允许选择选择整个公司!");
          return;
        }
        if (ulcmeDepartment.Value != null && allDept.IndexOf("'" + ulcmeDepartment.Value.ToString() + "'") < 0 && operDepart != "ROOT")
        {
          this.ulcmeDepartment.Value = null;
          MessageBox.Show("你没有配置这一部门用户的权限，请重新选择部门!");
          return;
        }
      }
      catch
      { }
    }
    #endregion

    #region "CheckBox"
    private void ultraCheckEditor1_CheckedChanged(object sender, System.EventArgs e)
    {
      this.ultraTextEditor8.Enabled = this.ultraCheckEditor1.Checked;
    }
    #endregion
  }
}
