public void DeleteDepartments(int id) { DepartmentsRepository departmentsRepository = new DepartmentsRepository(); Departments obj = departmentsRepository.PrintOne(id); departmentsRepository.Delete(obj); }
// 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")); } }
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(); }
public void DeleteCourse(Guid id) { _enrollemntsRepository.DeleteAllCourseEnrollment(id); _departmentsRepository.Delete(id); _context.SaveChanges(); }