Esempio n. 1
0
        public IHttpActionResult DeleteItem(string Id)
        {
            AU_NHOMQUYEN instance = _service.FindById(Id);

            if (instance == null)
            {
                return(NotFound());
            }
            try
            {
                var result = new TransferObj <AU_NHOMQUYEN>();
                _service.Delete(instance.Id);
                _service.UnitOfWork.Save();
                result.Status  = true;
                result.Message = "Xóa thành công.";
                return(Ok(result));
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }
Esempio n. 2
0
        public IHttpActionResult DeleteItem(string Id)
        {
            AU_NHOMQUYEN instance = _service.FindById(Id);

            if (instance == null)
            {
                return(NotFound());
            }
            try
            {
                if (_service.DeleteNhomQuyen(Id))
                {
                    _service.Delete(instance.Id);
                    _service.UnitOfWork.Save();
                    return(Ok(instance));
                }
                return(InternalServerError());
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }