示例#1
0
        public void DeleteDepartments(int id)
        {
            DepartmentsRepository departmentsRepository = new DepartmentsRepository();
            Departments           obj = departmentsRepository.PrintOne(id);

            departmentsRepository.Delete(obj);
        }
示例#2
0
 // DELETE: api/Departments/5
 public IHttpActionResult Delete(int id)
 {
     try
     {
         var delete = repo.Delete(id);
         return(Ok("Successfully deleted"));
     }
     catch (Exception)
     {
         return(BadRequest("Failed delete Data"));
     }
 }
示例#3
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            switch (flag)
            {
            case 1:
            {
                // Department
                _departmentRepository.Delete(selectedId);
            }
            break;

            case 2:
            {
                // Role
                _rolesRepository.Delete(selectedId);
            }
            break;

            case 3:
            {
                // User
                _usersRepository.Delete(selectedId);
            }
            break;

            case 4:
            {
                // Shift
                _shiftsRepository.Delete(selectedId);
            }
            break;

            case 5:
            {
                // Attendance
                _attendancesRepository.Delete(selectedId);
            }
            break;

            case 6:
            {
                // Payslip
                _payslipsRepository.Delete(selectedId);
            }
            break;

            default:
                break;
            }
            MessageBox.Show("Delete successfully!");
            LoadData();
        }
示例#4
0
 public void DeleteCourse(Guid id)
 {
     _enrollemntsRepository.DeleteAllCourseEnrollment(id);
     _departmentsRepository.Delete(id);
     _context.SaveChanges();
 }