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

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

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

            _directorService.Delete(getDirectorById);

            return(getDirectorById);
        }
예제 #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);
     }
 }
예제 #10
0
        public async Task <int> Delete(int id)
        {
            await DirectorService.Delete(id);

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

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