Example #1
0
        public static void UpdateDepartment(Department department)
        {
            string deptCode = department.DeptCode.ToUpper();

            department.DeptCode = deptCode;
            DepartmentDAO.UpdateDepartment(department);
        }
        public bool EditDepartment(Department department)      //修改公司信息
        {
            bool judge = false;

            if (dDAO.SelectDepartment(department.DepartmentNumber) == null)      //如果数据库中不存在该公司
            {
                judge = false;
            }
            else       //数据库内存在该公司
            {
                dDAO.UpdateDepartment(department);
                judge = true;
            }
            return(judge);
        }
Example #3
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            if (!CheckData())
            {
                return;
            }

            if (id == -1)
            {
                MessageBox.Show("请选择", "信息提示", MessageBoxButtons.OK);
                return;
            }

            DataRow[] matches = tabData.Select("Name='" + name + "' and Id<>" + id);
            if (matches.Length > 0)
            {
                MessageBox.Show("该部门已经存在", "信息提示", MessageBoxButtons.OK);
                return;
            }

            int parentId = 0;

            if (comboBoxEditParent.SelectedItem != null)
            {
                matches = tabData.Select("Name='" + comboBoxEditParent.Text + "'");
                if (matches.Length == 0)
                {
                    return;
                }

                parentId = (int)matches[0]["Id"];
            }

            DepartmentBean b = new DepartmentBean();

            b.Id       = id;
            b.Name     = name;
            b.ParentId = parentId;
            b.Code     = code;

            DepartmentDAO dao = new DepartmentDAO();

            dao.UpdateDepartment(b);

            LoadData();
        }
Example #4
0
 public int UpdateDepartment(DepartmentDTO departmentDTO)
 {
     return(departmentDAO.UpdateDepartment(departmentDTO));
 }
 public static void UpdateDepartment(DEPARTMENT department)
 {
     DepartmentDAO.UpdateDepartment(department);
 }
Example #6
0
 public static void UpdateDepartment(Department department)
 {
     DepartmentDAO.UpdateDepartment(department);
 }