Ejemplo n.º 1
0
        public string Delete(int id, string userId)
        {
            VaultKeep exists = Get(id, userId);

            _repo.Delete(id);
            return("VaultKeep successfully deleted.");
        }
Ejemplo n.º 2
0
        internal DTOVaultKeep Delete(int id, string userId)
        {
            DTOVaultKeep exists = GetById(id);

            _repo.Delete(id, userId);
            return(exists);
        }
Ejemplo n.º 3
0
 internal object Delete(int vaultId, int keepId, string userId)
 {
     // var existenceTest = _repo.Find(vaultId, keepId);
     // if (existenceTest.userId == userId) { throw new Exception("Bad request or Id"); }
     _repo.Delete(vaultId, keepId, userId);
     return("Yay you deleted it");
 }
Ejemplo n.º 4
0
 internal string Delete(int vid, int kid, string userId)
 {
     // VaultKeep exists = _repo.Find(vid, kid, userId);
     // if (exists == null) { throw new Exception("Invalid Id Combination"); }
     _repo.Delete(vid, kid, userId);
     return("Successfully Deleted");
 }
Ejemplo n.º 5
0
 internal string Delete(int id, string user)
 {
     if (_repo.Delete(id, user))
     {
         return("Removed from Vault!");
     }
     throw new Exception("Unable to perform this Delete action.");
 }
Ejemplo n.º 6
0
 internal string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Successfully deleted!");
     }
     throw new Exception("Delete request unsuccessful");
 }
Ejemplo n.º 7
0
 internal string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Deleted Succesfully!");
     }
     throw new Exception("Invalid or unable to delete for some reason");
 }
Ejemplo n.º 8
0
 internal object Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Keep successfully removed from Vault.");
     }
     throw new Exception("Could not delete Keep.");
 }
Ejemplo n.º 9
0
 public string Delete(VaultKeeps vk, string userId)
 {
     if (vk == null || vk.UserId != userId)
     {
         throw new Exception("invalid Id");
     }
     _vkr.Delete(vk);
     return("Success");
 }
Ejemplo n.º 10
0
        internal string Delete(int id, string userId)
        {
            VaultKeepViewModel foundVaultKeep = GetById(id, userId);

            if (_repo.Delete(id, userId))
            {
                return("Deleted!");
            }
            throw new Exception("Invalid id");
        }
Ejemplo n.º 11
0
        public string Delete(int id, string userId)
        {
            bool deleted = _repo.Delete(id, userId);

            if (!deleted)
            {
                throw new Exception("Sorry You No Own This!");
            }
            return("Deleted!");
        }
Ejemplo n.º 12
0
        internal void Delete(int id)
        {
            var data = _repo.GetById(id);

            // if (data == null)
            // {
            //   throw new Exception("Invalid Id");
            // }
            _repo.Delete(id);
        }
Ejemplo n.º 13
0
        internal string Delete(int VaultId, int KeepId, string UserId)
        {
            VaultKeep exists = _repo.FindToDelete(VaultId, KeepId, UserId);

            if (exists == null)
            {
                throw new Exception("Invalid ID Combination");
            }
            _repo.Delete(exists.Id);
            return("Successfully Deleted");
        }
Ejemplo n.º 14
0
        internal object Delete(string userId, int id)
        {
            VaultKeep Delete  = GetByVaultKeepId(id);
            bool      deleted = _repo.Delete(userId, id, Delete.KeepId);

            if (!deleted)
            {
                throw new Exception("You can't delete a Vault Keep you don't own!");
            }
            return("Deleted!");
        }
Ejemplo n.º 15
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");
        }
Ejemplo n.º 16
0
        internal object Delete(int vaultId, int keepId, string userId)
        {
            VaultKeep exists = _repo.GetByIds(vaultId, keepId, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id or You Did Not Create This VaultKeep");
            }
            _repo.Delete(vaultId, keepId, userId);
            return("Successfully Deleted");
        }
Ejemplo n.º 17
0
        internal String Delete(VaultKeep vk)
        {
            var exists = _repo.Find(vk);

            if (exists == null)
            {
                throw new Exception("Invalid Id Combination");
            }
            _repo.Delete(vk);
            return("Successfully Deleted");
        }
Ejemplo n.º 18
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!");
        }
Ejemplo n.º 19
0
        public String Delete(int id, string userId)
        {
            VaultKeep exists           = GetById(id);
            bool      vaultKeepDeleted = _repo.Delete(id, userId);

            if (!vaultKeepDeleted)
            {
                throw new Exception("Cannot Delete VaultKeep");
            }
            return("VaultKeep Deleted");
        }
Ejemplo n.º 20
0
        public string Delete(VaultKeep vaultKeep)
        {
            VaultKeep exists = _repo.GetId(vaultKeep.VaultId, vaultKeep.KeepId);

            if (exists == null)
            {
                throw new Exception("nothing here broh");
            }
            _repo.Delete(exists.Id);
            return("it's gone broh");
        }
Ejemplo n.º 21
0
        internal VaultKeep Delete(int id, string userId)
        {
            VaultKeep exists = GetById(id);

            if (exists.UserId != userId)
            {
                throw new Exception("You must be logged in to delete a vaultkeep.");
            }
            _repo.Delete(id);
            return(exists);
        }
Ejemplo n.º 22
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");
        }
Ejemplo n.º 23
0
        public string Delete(string userId, int id)
        {
            GetById(id);
            bool delorted = _repo.Delete(userId, id);

            if (!delorted)
            {
                throw new Exception("Invalid Id or not authorized.");
            }
            return("Removed From Vault.");
        }
Ejemplo n.º 24
0
        internal string Delete(int id, int vaultId, string userId)
        {
            var exists = _repo.GetVaultKeepDeleteById(id, vaultId, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
Ejemplo n.º 25
0
 internal VaultKeep Delete(int id, string UserId)
 {
   VaultKeep found = _repo.Get(id);
   if (found.UserId != UserId)
   {
     throw new UnauthorizedAccessException("Invalid Request");
   }
   if (_repo.Delete(id))
   {
     return found;
   }
   throw new Exception("Something went terribly wrong");
 }
Ejemplo n.º 26
0
        internal string Delete(int id, string userId)
        {
            VaultKeep foundVaultKeep = GetById(id);

            if (foundVaultKeep.userId != userId)
            {
                throw new Exception("not your Keep");
            }
            if (_repo.Delete(id, userId))
            {
                return("deleted.");
            }
            throw new Exception("ooopps");
        }
Ejemplo n.º 27
0
        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);
        }
Ejemplo n.º 28
0
        internal string Delete(int id, string userId)
        {
            VaultKeep found = Get(id);

            if (found.UserId != userId)
            {
                throw new Exception("This isnt your vaultkeep homie.");
            }
            if (_repo.Delete(id, userId))
            {
                return("Successfully Deleted");
            }
            throw new Exception("Uh Oh something went wrong.");
        }
Ejemplo n.º 29
0
        public string Delete(int Id, string UserId)
        {
            VaultKeep vault = Get(Id, UserId);

            if (vault.UserId != UserId)
            {
                throw new Exception("That's not your vault.");
            }
            if (_repo.Delete(Id, UserId))
            {
                return("Deleted.");
            }
            throw new Exception("Delete Failed.");
        }
Ejemplo n.º 30
0
        // NOTE Delete Request
        internal bool Delete(int id, string userId)
        {
            VaultKeep foundVaultKeep = GetVaultKeepById(id);

            if (foundVaultKeep == null)
            {
                throw new Exception("Invalid Id");
            }
            if (foundVaultKeep.UserId != userId)
            {
                throw new Exception("This is not yours");
            }
            return(_repo.Delete(id, userId));
        }