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());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync()
        {
            int directorId = await _directorService.Delete(director.Id);

            if (directorId == 0)
            {
                return(NotFound());
            }
            return(RedirectToPage("Index"));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 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)));
        }
Exemplo n.º 7
0
        public ActionResult <Director> DeleteDirector(int id)
        {
            var getDirectorById = _directorService.GetDirectorById(id);

            if (getDirectorById == null)
            {
                return(NotFound());
            }

            _directorService.Delete(getDirectorById);

            return(getDirectorById);
        }
Exemplo n.º 8
0
        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);
     }
 }
Exemplo n.º 10
0
        public async Task <int> Delete(int id)
        {
            await DirectorService.Delete(id);

            return(id);
        }
        public void Delete(Director entity)

        {
            _directorService.Delete(entity);
        }
Exemplo n.º 12
0
 public IActionResult Delete(int id)
 {
     return(Ok(_directorService.Delete(id)));
 }
Exemplo n.º 13
0
 public ActionResult Director_Delete([DataSourceRequest] DataSourceRequest request, Director model)
 {
     _directorService.Delete(model.Id);
     return(Json(new[] { model }.ToDataSourceResult(request, ModelState)));
 }