Beispiel #1
0
 public ActionResult Delete(long id)
 {
     newRepository.Delete(new TinTuc()
     {
         NewID = id
     });
     return(RedirectToAction("Index"));
 }
Beispiel #2
0
        public void Delete(int id, long currentUserId)
        {
            try
            {
                var user = _newRepository.GetAll().FirstOrDefault(p => p.Id == id && p.UserId == currentUserId);
                if (user == null)
                {
                    throw new ServiceException("You don`t have permissions to make this action!");
                }

                _logger.Info("Start deleting article with id " + id);
                _newRepository.Delete(p => p.Id == id);
                _logger.Info("Delete Article with id " + id);
            }
            catch (RepositoryException re)
            {
                throw new ServiceException("Repository ex: " + re.Message);
            }
            catch (Exception ex)
            {
                throw new ServiceException(ex.Message);
            }
        }
Beispiel #3
0
 public New Delete(int id)
 {
     return(_newRepository.Delete(id));
 }
 public void Delete(int id)
 {
     _newRepository.Delete(id);
 }
Beispiel #5
0
 public bool Delete(int id)
 {
     return(newRepository.Delete(id));
 }