Exemplo n.º 1
0
 /// <summary>
 /// Deletes a specific clinic
 /// </summary>
 /// <param name="id">The id of the clinic</param>
 /// <returns>OkResult if the clinic is deleted</returns>
 // DELETE: api/clinic/5
 public IHttpActionResult Delete(int id)
 {
     if (_clinicRepository.Delete(id))
     {
         return(Ok());
     }
     return(NotFound());
 }
Exemplo n.º 2
0
        public async Task <ApiResult <bool> > DeleteAsync(int id)
        {
            _logger.LogInformation(_localizer["LogMethodCalled", "api/Clinic/Delete"]);
            ApiResult <bool> response = await _clinicRepository.Delete(id);

            _logger.LogInformation(_localizer["LogMethodResult", "api/Clinic/Delete", response.Deserialize()]);
            return(response);
        }
Exemplo n.º 3
0
 public bool Remove(int patientId)
 {
     try
     {
         var patient = _patientRepository.GetById(patientId);
         var result  = _patientRepository.Delete(patient);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        public bool Remove(int appointmentId)
        {
            try
            {
                var appointment = _appointmentRepository.GetById(appointmentId);

                var result = ValidateCancel(appointment) ? _appointmentRepository.Delete(appointment) : false;

                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public ActionResult DeleteConfirmed(int id)
        {
            try
            {
                repository.Delete(id);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                //If an exception is thrown, log the error and return null.

                log.Error(string.Format("An error has been encountered deleting clinic {0}. Exception Message: {1}", id, ex));
                return(null);
            }
        }
Exemplo n.º 6
0
 public IActionResult DeleteConfirmed(int id)
 {
     _db.Delete(id);
     _db.Save();
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 7
0
        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="id">The id of a record.</param>
        /// <returns>True if the record was deleted, false otherwise.</returns>
        public bool Delete(string id)
        {
            var myData = repository.Delete(id);

            return(myData);
        }
Exemplo n.º 8
0
        public IActionResult Delete(int id)
        {
            _clinicRepository.Delete(id);

            return(RedirectToAction("index"));
        }
Exemplo n.º 9
0
 public ActionResult Delete(string id)
 {
     _repository.Delete(id);
     return(RedirectToAction(nameof(List)));
 }