public ActionResult Edit(int id, Department dep) { try { d.EditDepartment(id, (Department)dep); return(RedirectToAction("Index")); } catch { return(View()); } }
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); }
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(); } }
/// <summary> /// 修改 /// </summary> /// <param name="sysDepart"></param> /// <returns></returns> public bool EditDepart(SysDepart sysDepart) { var departRepository = new DepartmentRepository(); return(departRepository.EditDepartment(sysDepart)); }
public Department GetDepartmentId(int DesignationId) { return(repository.EditDepartment(DesignationId)); }