public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = (Routes.APIVersion + Routes.SpecificDoctor))] HttpRequest req, ILogger log, int doctorId) { #region AuthCheck AuthResultModel authResult = await DIContainer.Instance.GetService <IAuthorization>().AuthForDoctor(req, doctorId); if (!authResult.Result) { return(new StatusCodeResult((int)authResult.StatusCode)); } #endregion try { IDoctorRepository doctorRepository = DIContainer.Instance.GetService <IDoctorRepository>(); bool success = doctorRepository.Delete(doctorId); return(doctorRepository.Delete(doctorId) ? (ActionResult) new OkResult() : new StatusCodeResult(StatusCodes.Status409Conflict)); } catch (Exception e) { return(new BadRequestObjectResult(new MessageHandler().BuildErrorMessage(e))); } }
// DELETE: api/Doctor/5 public HttpResponseMessage Delete(string doctorid) { int tbleId = _getDoctorList.Find(x => x.DoctorId == doctorid).FirstOrDefault().Id; var result = _doctorRepo.Delete(tbleId); return(Request.CreateResponse(HttpStatusCode.Accepted, result)); }
public async Task <ActionResult <Doctors> > DeleteDoctor(int id) { if (_doctorRepository.Delete(id) == 0) { return(NotFound()); } else { return(Ok()); } }
public async Task Deletar(Guid id) { if (_patientRepository.GetPatientsByDoctorId(id).Result.Any()) { Notificar("The doctor has patients!"); return; } var doctor = await _doctorRepository.GetDoctor(id); await _doctorRepository.Delete(doctor); }
public bool Delete(int id) { var res = GetById(id); if (res != null) { _doctorRepository.Delete(id); _unitOfWork.Complete(); return(true); } return(false); }
public ActionResult Delete(string id) { try { _doctorRepository.Delete(id); return(RedirectToAction(nameof(List))); } catch { return(RedirectToAction(nameof(List))); } }
public Doctor Delete(int id) { var doctor = _repository.Get(id); if (doctor == null) { AddNotification("Doctor", "Não foi encontrado o Doutor solicitado"); } else { _repository.Delete(doctor); } return(doctor); }
public void Delete(int id) { try { _doctorSpecialistRepository.DeleteMulti(x => x.FK_MEDoctorID == id); _doctorRepository.Delete(id); _unitOfWork.Commit(); } catch (Exception ex) { _logService.Create(ex); throw ex; } }
public async Task <Response> Delete(int id) { int result = await _doctorRepository.Delete(id); if (result > 0) { return(new Response { IsSuccess = true, Message = Messages.Delete.ToString(), Result = result }); } else { return(new Response { IsSuccess = false, Message = Messages.NotDelete.ToString() }); } }
public bool DeleteDoctor(DoctorDto doctor) { var entity = _DtoMapper.Map(doctor); return(_DoctorRepository.Delete(entity)); }
public void Delete(int id) { var obj = _idoctorRepository.GetById(id); _idoctorRepository.Delete(obj); }
public IActionResult Delete(int id) { db.Delete(id); return(RedirectToAction("Index")); }
public bool DeleteDoctor(int doctorId) { return(_doctorRepository.Delete(doctorId)); }
public override void Remove(DoctorUser doctor) { _doctorRepository.Delete(doctor.Id); }
public void Delete(Doctor entity) { DeleteDoctorsBusinessDays(entity); _articleService.DeleteArticlesByDoctor(entity); _doctorRepository.Delete(entity); }
public override void Remove(DoctorUser doctor) { _doctorRepository.Delete(doctor.id); removeDoctorFromSchedule(doctor); }
public bool DeleteDoctor(DoctorDTO doctor) { var entity = _DTOMappers.Map(doctor); return(_doctorRepository.Delete(entity)); }
public async Task Delete(int doctorId) { await _doctorRepository.Delete(doctorId); }
public void DeleteDoctor(string doctorId) { m_repository.Delete(doctorId); }
public ICommandResult Handler(DeleteDoctorCommand command) { _doctorRepository.Delete(command.DoctorId); return(new DeleteDoctorCommandResult(command.DoctorId, true)); }