public ActionResult DeleteConfirmed(int id)
        {
            statusRepository.Delete(id);
            statusRepository.Save();

            return(RedirectToAction("Index"));
        }
        public bool Delete(long id)
        {
            bool deleted = Repo.Delete(id);

            Unit.SaveChanges();
            return(deleted);
        }
Example #3
0
        public void deleteStatus(int id)
        {
            Status Status = StatusRepository.GetById(id);

            StatusRepository.Delete(Status);
            SaveChange();
        }
        public bool Delete(int?Id)
        {
            var idDel = Get(Id);

            if (idDel != null)
            {
                status = _statusRepository.Delete(Id);
            }
            return(status);
        }
Example #5
0
        public IActionResult Delete(int idStatus)
        {
            try
            {
                repository.Delete(repository.FindById(idStatus));

                return(Ok("Status deletado com sucesso!"));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
Example #6
0
        public ActionResult Delete(int id)
        {
            var perfil = _compraRepository.GetCompraByStatus(id).Count();

            if (perfil != 0)
            {
                return(BadRequest("Impossivel excluir status já referenciadas."));
            }
            else
            {
                _statusRepository.Delete(id);
                return(Ok());
            }
        }
 public IActionResult StatusDelete(long id)
 {
     try
     {
         var response = _statusRepository.Delete(id);
         if (response == true)
             return Ok(new GenericResult { Response = response, Message = "Record successfully deleted" });
         else
             return NotFound(_NotFound);
     }
     catch (Exception e)
     {
         return BadRequest(e);
     }
 }
Example #8
0
        public IActionResult OnPostDelete(int id)
        {
            if (id > 0)
            {
                var count = _statusRepository.Delete(id);

                if (count > 0)
                {
                    Message = "Status deletado com sucesso!";
                    return(RedirectToPage("/Status/Index"));
                }
            }

            return(Page());
        }
        public async Task <bool> Delete(User user, Status status)
        {
            try
            {
                var realStatus = await GetById(user, status.Id);

                if (realStatus != null && realStatus.fk_UserId == user.Id)
                {
                    status.fk_UserId = user.Id;
                    status.Deleted   = true;
                    status.DeletedOn = DateTime.Today;
                    return(_statusRepository.Delete(status));
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #10
0
        public ActionConfirmation Delete(Guid id)
        {
            var status = Get(id);

            if (status == null)
            {
                return(ActionConfirmation.CreateFailure("Status no existe"));
            }

            try
            {
                _statusRepository.Delete(status);
                return(ActionConfirmation.CreateSuccess("status borrado!"));
            }
            catch (System.Exception exception)
            {
                _eventLogService.AddException(exception.Message, exception.StackTrace, EventCategory.EliminarObjeto.ToString(), exception, "", EventSource.Sistema);

                var confirmation = ActionConfirmation.CreateFailure("status no eliminado | " + exception);
                return(confirmation);
            }
        }
Example #11
0
        public ActionResult Delete(int id)
        {
            var existe = _statusRepository.Get(id);

            if (existe != null)
            {
                var podeExcluir = _statusRepository.PodeExcluir(id);
                if (podeExcluir)
                {
                    _statusRepository.Delete(id);
                }
                else
                {
                    return(new BadRequestObjectResult("Nao Pode Excluir Esse status"));
                }
            }
            else
            {
                return(new BadRequestObjectResult("NAO EXISTE ESSE CODIGO"));
            }

            return(new OkResult());
        }
        public Status DeleteStatus(Status item)
        {
            var result = _statusRepository.Delete(item);

            return(result);
        }
 public bool Delete(int id)
 {
     return(_statusRepository.Delete(id));
 }
Example #14
0
 public void Delete(int id)
 {
     _statusService.Delete(new Status {
         Id = id
     });
 }
Example #15
0
 public void DeleteStatus(int id)
 {
     statusRepository.Delete(id);
 }
 public ActionResult Delete(Status status)
 {
     _status.Delete(status);
     _status.Commit();
     return(View());
 }
Example #17
0
 public void Delete(long id)
 {
     _repository.Delete(id);
 }
Example #18
0
 public IActionResult Delete(int id)
 {
     _status.Delete(id);
     return(RedirectToAction("Index", "Status"));
 }