private void btnAdd_Click(object sender, EventArgs e)
        {
            var edit = new OfficeEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("保存成功!", MainForm);
            }
        }
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var selectedRow = new OfficeEntity();

            selectedRow.parentId = Convert.ToString(treeList1.FocusedNode.GetValue("id"));
            selectedRow.areaId   = Convert.ToString(treeList1.FocusedNode.GetValue("areaId"));
            selectedRow.type     = Convert.ToString(treeList1.FocusedNode.GetValue("type"));
            selectedRow.grade    = Convert.ToString(treeList1.FocusedNode.GetValue("grade"));
            var form = new OfficeEdit();

            form.office = selectedRow;
            if (form.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("添加成功!", MainForm);
            }
        }
        private void btnUp_Click(object sender, EventArgs e)
        {
            String id          = Convert.ToString(treeList1.FocusedNode.GetValue("id"));
            var    selectedRow = new OfficeEntity();

            if (id == null)
            {
                return;
            }
            selectedRow.id = id;
            var form = new OfficeEdit();

            form.office = selectedRow;
            form.Text   = "机构修改";
            if (form.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("修改成功!", MainForm);
            }
        }