Пример #1
0
        private void ModifyDepartment_Click(object sender, EventArgs e)
        {
            if (this.CheckIntegrity() == true)
            {
                ////   此处应该注意,这里的dpartment跟底层Uderhelper的数据是同一个数据域
                this.m_sdepartment.Name      = this.textBoxName.Text.Trim();  //
                this.m_sdepartment.ShortCall = this.textBoxShortCall.Text.Trim();
                if (this.CanBoundary.Checked)
                {
                    this.m_sdepartment.CanBoundary = 1;
                }
                else
                {
                    this.m_sdepartment.CanBoundary = 0;
                }

                if (this.CanInLand.Checked)
                {
                    this.m_sdepartment.CanInland = 1;
                }
                else
                {
                    this.m_sdepartment.CanInland = 0;
                }



                string result = _sc.ModifySDepartment(this.m_sdepartment);

                //if (result == Response.MODIFY_DEPARTMENT_SUCCESS.ToString())
                if (result == Response.MODIFY_SDEPARTMENT_SUCCESS.ToString())
                {
                    MessageBox.Show("修改部门成功!", "提示", MessageBoxButtons.OK);
                    //this.m_department.Name = departmentname;
                    this.DialogResult = DialogResult.OK;
                }
                else if (result == "服务器连接中断")
                {
                    MessageBox.Show("服务器连接中断,删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("修改部门失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }