예제 #1
0
        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)));
            }
        }
예제 #2
0
        // 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());
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
        public bool Delete(int id)
        {
            var res = GetById(id);

            if (res != null)
            {
                _doctorRepository.Delete(id);
                _unitOfWork.Complete();
                return(true);
            }
            return(false);
        }
예제 #6
0
 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);
        }
예제 #8
0
 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;
     }
 }
예제 #9
0
        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()
                });
            }
        }
예제 #10
0
        public bool DeleteDoctor(DoctorDto doctor)
        {
            var entity = _DtoMapper.Map(doctor);

            return(_DoctorRepository.Delete(entity));
        }
예제 #11
0
        public void Delete(int id)
        {
            var obj = _idoctorRepository.GetById(id);

            _idoctorRepository.Delete(obj);
        }
예제 #12
0
 public IActionResult Delete(int id)
 {
     db.Delete(id);
     return(RedirectToAction("Index"));
 }
예제 #13
0
 public bool DeleteDoctor(int doctorId)
 {
     return(_doctorRepository.Delete(doctorId));
 }
예제 #14
0
 public override void Remove(DoctorUser doctor)
 {
     _doctorRepository.Delete(doctor.Id);
 }
 public void Delete(Doctor entity)
 {
     DeleteDoctorsBusinessDays(entity);
     _articleService.DeleteArticlesByDoctor(entity);
     _doctorRepository.Delete(entity);
 }
예제 #16
0
 public override void Remove(DoctorUser doctor)
 {
     _doctorRepository.Delete(doctor.id);
     removeDoctorFromSchedule(doctor);
 }
예제 #17
0
        public bool DeleteDoctor(DoctorDTO doctor)
        {
            var entity = _DTOMappers.Map(doctor);

            return(_doctorRepository.Delete(entity));
        }
예제 #18
0
 public async Task Delete(int doctorId)
 {
     await _doctorRepository.Delete(doctorId);
 }
예제 #19
0
 public void DeleteDoctor(string doctorId)
 {
     m_repository.Delete(doctorId);
 }
예제 #20
0
 public ICommandResult Handler(DeleteDoctorCommand command)
 {
     _doctorRepository.Delete(command.DoctorId);
     return(new DeleteDoctorCommandResult(command.DoctorId, true));
 }