예제 #1
0
        /// <summary>
        /// 编辑按钮点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void linkEdit_Click(object sender, EventArgs e)
        {
            DataRowView drv = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as DataRowView;

            if (drv != null)
            {
                object dpt_id = drv["dpt_id"];
                if (dpt_id != null && !string.IsNullOrWhiteSpace(dpt_id.ToString()))
                {
                    if (dpt_id.ToString() == TmoComm.login_docInfo.doc_department.ToString())
                    {
                        DXMessageBox.ShowInfo("没有权限!");
                        return;
                    }
                    UCDepartmentEditor edit = new UCDepartmentEditor {
                        Title = "修改部门信息", DbOperaType = DBOperateType.Update, PrimaryKeyValue = dpt_id.ToString()
                    };
                    if (edit.ShowDialog() == DialogResult.OK)
                    {
                        Tmo_CommonClient.Instance.RefreshDocChildrenDpt();
                        GetData();
                        DXMessageBox.Show("部门修改成功!", true);
                    }
                    edit.Dispose();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 添加按钮点击事件
        /// </summary>
        /// <param name="e"></param>
        protected override void OnAddClick(EventArgs e)
        {
            UCDepartmentEditor edit = new UCDepartmentEditor {
                Title = "添加部门", DbOperaType = TmoCommon.DBOperateType.Add
            };

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Tmo_CommonClient.Instance.RefreshDocChildrenDpt();
                GetData();
                DXMessageBox.Show("部门添加成功!", true);
            }
            edit.Dispose();
        }