public void Delete(int id) { QuoteRange qr = repository.GetById(id); PermissionManager.RemovePermission(qr.GetType(), qr.Title); repository.Delete(qr); repository.CommitChange(); }
public QuoteRange Create(string title, Int32 max, Int32 min) { if (!AlreadyExists(title)) { QuoteRange qr = new QuoteRange(); PermissionManager.AddEntityPermision(qr.GetType(), title); return(Update(qr, title, max, min)); } else { throw new Exception("Title already exists."); } }
public QuoteRange Edit(int id, string title, Int32 max, Int32 min) { QuoteRange qr = repository.GetById(id); if (!AlreadyExists(title, qr)) { PermissionManager.UpdateEntityPermission(qr.GetType(), qr.Title, title); return(Update(qr, title, max, min)); } else { throw new Exception("Title already exists."); } }