public IActionResult DeleteConfirmation(int id) { var director = _directorService.GetDidectorById(id); _directorService.Delete(director); return(RedirectToAction(nameof(Index))); }
public IActionResult Delete(int id) { if (!UserIsInRole(UserTypeEnum.Admin)) { return(Unauthorized("You are not in role to permit this action")); } _service.Delete(id); return(Ok()); }
public async Task <IActionResult> OnPostAsync() { int directorId = await _directorService.Delete(director.Id); if (directorId == 0) { return(NotFound()); } return(RedirectToPage("Index")); }
public async Task <IActionResult> Delete(int directorId) { var deletedDirector = await _directorService.Delete(directorId); if (deletedDirector != null) { ImageExtensions.ImageDelete(deletedDirector.Data.PicturePath, "directors", _env); return(Json(0)); } return(Json(1)); }
private void DeleteDirector() { try { int id = (int)dgvDirector.CurrentRow.Cells[2].Value; _directorService.Delete(id); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public IActionResult DeleteConfirmed(int Id) { if (ModelState.IsValid) { _directorService.Delete(Id); } else { _logger.LogInformation(LoggerMessageDisplay.DirectorDeleteErrorModelStateInvalid); } return(RedirectToAction(nameof(Index))); }
public ActionResult <Director> DeleteDirector(int id) { var getDirectorById = _directorService.GetDirectorById(id); if (getDirectorById == null) { return(NotFound()); } _directorService.Delete(getDirectorById); return(getDirectorById); }
public ActionResult Delete(Guid id) { Director director = _directorService.Find(id); if (director == null) { return(HttpNotFound()); } _directorService.Delete(director); return(RedirectToAction("Index")); }
public void Delete(User entity) { if (entity.GetType() == typeof(Doctor)) { _doctorService.Delete((Doctor)entity); } if (entity.GetType() == typeof(Director)) { _directorService.Delete((Director)entity); } if (entity.GetType() == typeof(Secretary)) { _secretaryService.Delete((Secretary)entity); } if (entity.GetType() == typeof(Patient)) { _patientService.Delete((Patient)entity); } }
public async Task <int> Delete(int id) { await DirectorService.Delete(id); return(id); }
public void Delete(Director entity) { _directorService.Delete(entity); }
public IActionResult Delete(int id) { return(Ok(_directorService.Delete(id))); }
public ActionResult Director_Delete([DataSourceRequest] DataSourceRequest request, Director model) { _directorService.Delete(model.Id); return(Json(new[] { model }.ToDataSourceResult(request, ModelState))); }