// GET: Student/Delete/5 public ActionResult Delete(int id) { try { if (repository.DeleteDoctor(id)) { ViewBag.AlertMsg = "Doctor Deleted Successfully"; } return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <IActionResult> DeleteConfirmed(int?Id) { //var user = HttpContext.Session.GetString("UserName"); //if (string.IsNullOrEmpty(user)) //{ // return RedirectToAction("AccesoDenegado", "Home"); //} if (Id == null) { return(NotFound()); } await _repository.DeleteDoctor(Id.Value); return(RedirectToAction("Index")); }
public async Task <ActionResult> Delete(int id) { var doctor = await _repository.GetById(id); if (doctor == null) { return(NotFound()); } var respose = await _repository.DeleteDoctor(id); if (respose) { return(NoContent()); } else { return(StatusCode(500)); } }
public bool DeleteDoctor(string jmbg) { return(doctorRepository.DeleteDoctor(jmbg)); }
public void RemoveDoctor(Doctor oldDoctor) => _doctorsFile.DeleteDoctor(oldDoctor);
public void DeleteDoctor(int id) { IDoctorRepository repo = new DoctorRepository(); repo.DeleteDoctor(id); }