Beispiel #1
0
        public bool DeleteStatus(int statusId)
        {
            logger.LogInformation("Statuses Business Logic - DeleteStatus");

            statusRepository.DeleteStatus(statusId);

            return(true);
        }
        public ActionResult Delete(int Id)
        {
            var deletedStatus = _repository.DeleteStatus(Id);

            if (deletedStatus != null)
            {
                TempData["message"] = $"Usunięto {deletedStatus.Name}";
            }

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> DeleteStatus(int?statusId)
        {
            int result = 0;

            if (statusId == null)
            {
                return(BadRequest());
            }

            try
            {
                result = await statusRepository.DeleteStatus(statusId);

                if (result == 0)
                {
                    return(NotFound());
                }
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
 public ActionResult DeleteStatus(int statusId)
 {
     statusRepository.DeleteStatus(currentUser.UserId, statusId);
     return(RedirectToAction("Index", "Home"));
 }
Beispiel #5
0
 public async Task <ActionResult> Delete(int?id)
 {
     return(Ok(await _repository.DeleteStatus(id)));
 }
        public async Task <ActionResult> Delete(Guid idStatus)
        {
            await statusRepository.DeleteStatus(idStatus);

            return(NoContent());
        }