예제 #1
0
        public void Delete(int id)
        {
            QuoteRange qr = repository.GetById(id);

            PermissionManager.RemovePermission(qr.GetType(), qr.Title);
            repository.Delete(qr);
            repository.CommitChange();
        }
예제 #2
0
 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.");
     }
 }
예제 #3
0
        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.");
            }
        }