Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (cmbOldDept.SelectedIndex == -1 || cmbNewDept.SelectedIndex == -1)
            {
                MessageDialog.ShowPromptMessage("请选择原部门/科室或现部门/科室!");
                return;
            }

            if (cmbOldDept.Text == cmbNewDept.Text)
            {
                MessageDialog.ShowPromptMessage("两个部门一致,无需修改!");
                return;
            }

            string deptNew = m_departmentServer.GetDeptCode(cmbNewDept.Text);
            string deptOld = m_departmentServer.GetDeptCode(cmbOldDept.Text);

            if (MessageDialog.ShowEnquiryMessage("确定将【" + cmbOldDept.Text + "】换成【" + cmbNewDept.Text + "】吗?") == DialogResult.Yes)
            {
                if (!m_personnerServer.UpdateBatchDept(deptOld, deptNew, out m_error))
                {
                    MessageDialog.ShowPromptMessage(m_error);
                    return;
                }

                MessageDialog.ShowPromptMessage("批量修改成功!");
            }
        }