Example #1
0
        public VaultKeep GetById(int id)
        {
            var data = _repo.GetById(id);

            if (data == null)
            {
                throw new Exception("Invalid Id");
            }
            return(data);
        }
Example #2
0
        internal IEnumerable <Keep> GetById(Vault v)
        {
            var found = _repo.GetById(v);

            // if (found == null) { throw new Exception("Invalid id"); }
            // if (found.ElementAt(0).UserId != userId) { throw new Exception("Unauthorized"); }
            return(found);
        }
Example #3
0
        public VaultKeep GetById(int Id)
        {
            VaultKeep exists = _repo.GetById(Id);

            if (exists == null)
            {
                throw new Exception("Invalid keep id");
            }
            return(exists);
        }
Example #4
0
        internal IEnumerable <Keep> GetById(int vid, string userId)
        {
            var found = _repo.GetById(vid, userId);

            if (found == null)
            {
                throw new Exception("Invalid id");
            }
            return(found);
        }
        private DTOVaultKeep GetById(int id)
        {
            var found = _repo.GetById(id);

            if (found == null)
            {
                throw new Exception("Invalid Id");
            }
            return(found);
        }
Example #6
0
        internal VaultKeep GetById(int id)
        {
            var res = _repo.GetById(id);

            if (res == null)
            {
                throw new System.Exception("Bad id, please check your input and try again");
            }
            return(res);
        }
Example #7
0
        internal void Delete(int id)
        {
            var data = _repo.GetById(id);

            // if (data == null)
            // {
            //   throw new Exception("Invalid Id");
            // }
            _repo.Delete(id);
        }
Example #8
0
        // internal void Create(VaultKeep newVaultKeep)
        // {
        //   VaultKeep existence = _repo.Find(newVaultKeep);
        //   if (existence != null) { return; }
        //   _repo.Create(newVaultKeep);
        // }



        internal VaultKeep GetById(int id)
        {
            var existenceTest = _repo.GetById(id);

            if (existenceTest == null)
            {
                throw new Exception("Bad Id");
            }
            return(existenceTest);
        }
Example #9
0
        public DTOVaultedKeep Get(int Id)
        {
            DTOVaultedKeep found = _repo.GetById(Id);

            if (found == null)
            {
                throw new Exception("Keep cannot be placed in vault");
            }
            return(found);
        }
Example #10
0
        public VaultKeep GetById(int id)
        {
            VaultKeep foundVK = _repo.GetById(id);

            if (foundVK == null)
            {
                throw new Exception("Invalid VaultKeep Id");
            }
            return(foundVK);
        }
Example #11
0
        internal DTOVaultKeep GetById(int id) //TODO call in a different controller than VKC
        {
            DTOVaultKeep exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("ur wrong bub");
            }
            return(exists);
        }
Example #12
0
        public VaultKeep Get(int id, string userId)
        {
            VaultKeep exists = _repo.GetById(id, userId);

            if (exists == null)
            {
                throw new Exception("Wrong Keep Bud!");
            }
            return(exists);
        }
Example #13
0
        public VaultKeep GetById(int id)
        {
            VaultKeep foundVaultKeep = _repo.GetById(id);

            if (foundVaultKeep == null)
            {
                throw new Exception("invalid id");
            }
            return(foundVaultKeep);
        }
Example #14
0
        public string Delete(int vaultId, int keepId, string userId)
        {
            var exists = _repo.GetById(vaultId, keepId, userId);

            if (exists == null)
            {
                throw new Exception("Invalid request");
            }
            _repo.Delete(vaultId, keepId, userId);
            return("Successfully Deleted");
        }
Example #15
0
        internal object Delete(int id, Profile userInfo)
        {
            VaultKeep data = _repo.GetById(id);

            if (data.CreatorId != userInfo.Id || data == null)
            {
                throw new Exception("Invalid Id, Or Invalid Permissions");
            }
            _repo.Delete(id);
            return("Successfully Deleted!");
        }
Example #16
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid id combination");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Example #17
0
        internal void Delete(int id, string userId)
        {
            VaultKeep original = _repo.GetById(id);

            if (original == null)
            {
                throw new Exception("Invalid Id");
            }
            if (original.CreatorId != userId)
            {
                throw new Exception("You cannot delete that which is not yours.");
            }
            _repo.Delete(id);
        }
Example #18
0
        public VaultKeep Get(int id, string userId)
        {
            VaultKeep exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new System.Exception("VaultKeep does not exist!");
            }
            if (exists.userId != userId)
            {
                throw new System.Exception("VaultKeep does not belong to you.");
            }
            return(exists);
        }
        internal void Delete(int id, string userId)
        {
            var vk = _repo.GetById(id);

            if (vk == null)
            {
                throw new Exception("Invalid Id");
            }
            if (vk.CreatorId != userId)
            {
                throw new Exception("Access Denied");
            }
            _repo.Delete(id);
        }
Example #20
0
        public VaultKeepViewModel GetById(int id, string userId)
        {
            VaultKeepViewModel foundVaultKeep = _repo.GetById(id, userId);

            if (foundVaultKeep == null)
            {
                throw new Exception("Invalid Id");
            }
            if (foundVaultKeep.UserId != userId)
            {
                throw new Exception("This is not yours!");
            }
            return(foundVaultKeep);
        }
Example #21
0
        internal VaultKeep Delete(int id, string userId)
        {
            VaultKeep foundVaultKeep = _repo.GetById(id);

            if (foundVaultKeep.UserId != userId)
            {
                throw new Exception("This is not your VaultKeep!");
            }
            if (_repo.Delete(id))
            {
                return(foundVaultKeep);
            }
            throw new Exception("Need a mulligan on deleting this VaultKeep?");
        }
Example #22
0
        internal string Delete(int vaultId, int keepId, string userId)
        {
            VaultKeep exists = _repo.GetById(vaultId, keepId, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id Delete");
            }
            else if (exists.UserId != userId)
            {
                throw new Exception("This isnt yours, so you cant delete it!");
            }
            _repo.Delete(vaultId, keepId, userId);
            return("This thing is gone!");
        }
Example #23
0
        internal VaultKeep Delete(int id, string userInfoId)
        {
            VaultKeep data = _vaultKeepRepo.GetById(id);

            if (data == null)
            {
                throw new Exception("Invalid Id");
            }
            if (data.CreatorId != userInfoId)
            {
                throw new Exception("Invalid Edit Permissions");
            }
            _vaultKeepRepo.Delete(id);
            return(data);
        }
Example #24
0
        internal string Delete(int vaultId, int keepId, string userId)
        {
            var exists = _vaultKeepRepo.GetById(vaultId, keepId);

            if (exists == null)
            {
                throw new Exception("Item Does not Exist");
            }
            else if (exists.UserId != userId)
            {
                throw new Exception("not yours to delete killer");
            }
            _vaultKeepRepo.Delete(exists.Id);
            return("VaultKeep has been deleted!");
        }
        public string Delete(int vaultId, int keepId, string userId)
        {
            var exists = _repo.GetById(vaultId, keepId);

            if (exists == null)
            {
                throw new Exception("INVALID ID COMBO");
            }
            else if (exists.UserId != userId)
            {
                throw new Exception("THIS AINT YOURS FOOL!");
            }
            _repo.Delete(exists.Id);
            return("SHE GONE");
        }
        internal string Delete(int id, string userId)
        {
            VaultKeep original = _repo.GetById(id);

            if (original == null)
            {
                throw new Exception("Invalid Id");
            }
            if (original.CreatorId != userId)
            {
                throw new Exception("You can only delete your own Keeps");
            }
            _repo.Delete(id);
            return("removed from list");
        }
Example #27
0
        internal void Create(VaultKeep newData)
        {
            VaultKeep exists = _repo.GetById(newData.Id);

            if (exists != null)
            {
                throw new Exception("Relationship already exists");
            }
            // Pretty sure I don't need this on create...
            // else if (exists.UserId != newData.UserId)
            // {
            //   throw new Exception("");
            // }
            _repo.Create(newData);
        }
Example #28
0
        internal object DeleteVaultKeep(int id, string userId)
        {
            VaultKeep data = _repo.GetById(id);

            if (data == null)
            {
                throw new Exception("Invalid Id... from vaultkeepsService");
            }

            if (data.CreatorId != userId)
            {
                throw new Exception("Access Denied NOT YOURS... from vaultkeepsService");
            }
            _repo.DeleteVaultKeep(id);
            return("Successfully deleted... from vaultkeepsService");
        }
Example #29
0
        internal VaultKeep Delete(string userId, int queryId)
        {
            var data = _repo.GetById(queryId);

            if (data == null)
            {
                throw new Exception("invalid Id");
            }
            if (data.CreatorId != userId)
            {
                throw new Exception("This is not yours");
            }
            var deleted = _repo.Delete(queryId);

            return(deleted);
        }
Example #30
0
 // public IEnumerable<VaultKeepViewModel> Get(string userId)
 // {
 //   return _repo.Get(userId);
 // }
 public VaultKeep Get(int id)
 {
     return(_repo.GetById(id));
 }