public ActionResult Edit(int id, Department dep)
 {
     try
     {
         d.EditDepartment(id, (Department)dep);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
        public bool AddApplication(UserApplication application)
        {
            DepartmentRepository departmentRepository = new DepartmentRepository();
            CollegeDepartment    collegeDepartment    = departmentRepository.CheckExistsDepartment(application.DeptID, application.CollegeCode);

            if (collegeDepartment.AvailableSeats > 0)
            {
                collegeDepartment.AvailableSeats = collegeDepartment.AvailableSeats - 1;
                departmentRepository.EditDepartment(collegeDepartment);
                applicationRepository.AddApplication(application);
                return(true);
            }
            return(false);
        }
示例#3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            repository = new DepartmentRepository();
            Department dept = new Department();

            dept.DeptCd = deptCdTextBox.Text.ToUpper();
            dept.DeptNm = deptNmTextBox.Text.ToUpper();
            if (repository.EditDepartment(dept))
            {
                MessageBox.Show("Updated Successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                department.DeptCd = dept.DeptCd;
                department.DeptNm = dept.DeptNm;
                this.Close();
            }
        }
示例#4
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sysDepart"></param>
        /// <returns></returns>
        public bool EditDepart(SysDepart sysDepart)
        {
            var departRepository = new DepartmentRepository();

            return(departRepository.EditDepartment(sysDepart));
        }
示例#5
0
 public Department GetDepartmentId(int DesignationId)
 {
     return(repository.EditDepartment(DesignationId));
 }