Esempio n. 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"));
        }
Esempio n. 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"));
 }
Esempio n. 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());
        }