コード例 #1
0
 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
ファイル: frmEditDept.cs プロジェクト: MAISHTHUITA/TESTAPP
        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));
 }