Exemplo n.º 1
0
        public string Delete(int id, string userId)
        {
            Vault vault = Get(id, userId);

            _repo.Delete(id);
            return("Successfully deleted");
        }
Exemplo n.º 2
0
 internal string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Vault successfully removed.");
     }
     throw new Exception("Could not delete vault");
 }
Exemplo n.º 3
0
        public void Delete(int id, string userId)
        {
            int i = _repo.Delete(id, userId);

            if (i == 0)
            {
                throw new Exception("You can't do that.");
            }
        }
Exemplo n.º 4
0
        internal object Delete(int id, string userId)
        {
            Vault foundVault = GetById(id, userId);

            if (_repo.Delete(id, userId))
            {
                return("Deleted!");
            }
            throw new Exception("errrrr");
        }
Exemplo n.º 5
0
        // NOTE Delete Request
        internal bool Delete(int id, string userId)
        {
            Vault foundVault = GetVaultById(id);

            if (foundVault.UserId != userId)
            {
                throw new Exception("Not your Vault!");
            }
            return(_repo.Delete(id, userId));
        }
Exemplo n.º 6
0
        public string Delete(string userId, int id)
        {
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("Sorry You No Own This!");
            }
            return("Deleted!");
        }
Exemplo n.º 7
0
        internal string Delete(string userId, int id)
        {
            var exists = _repo.GetById(userId, id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(userId, id);
            return("Successfully Deleted");
        }
Exemplo n.º 8
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id);
            return("Mamba Out");
        }
Exemplo n.º 9
0
        internal string Delete(int id)
        {
            var Current = _repo.GetById(id);

            if (Current == null)
            {
                throw new Exception("Invalid ID");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Exemplo n.º 10
0
        public string Delete(string userId, int id)
        {
            GetById(id, userId);
            bool delorted = _repo.Delete(userId, id);

            if (!delorted)
            {
                throw new Exception("Not the author of Vault!");
            }
            return("Vault Deleted!");
        }
Exemplo n.º 11
0
        public string Delete(int id, string userId)
        {
            Vault exists = _vr.Get(id);

            if (exists == null || exists.UserId != userId)
            {
                throw new Exception("Invalid Id");
            }
            _vr.Delete(id);
            return(" unkept man");
        }
Exemplo n.º 12
0
        public String Delete(int id, string userId)
        {
            Vault exists       = GetById(id);
            bool  vaultDeleted = _repo.Delete(id, userId);

            if (!vaultDeleted)
            {
                throw new Exception("Cannot Delete Vault");
            }
            return("Vault Deleted");
        }
Exemplo n.º 13
0
        public string Delete(int id, string userId)
        {
            Vault exists = _repo.GetById(id);

            if (exists == null || exists.UserId != userId)
            {
                throw new Exception("doesn't exist broh");
            }
            _repo.Delete(id);
            return("it's gone, Jim");
        }
Exemplo n.º 14
0
        public string Delete(string userId, int id)
        {
            //GetById(id);
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("You are not the creator of this vault!");
            }
            return("Deleted!");
        }
Exemplo n.º 15
0
        internal string Delete(int id, string userId)
        {
            var exists = _repo.GetVaultDeleteById(id, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
Exemplo n.º 16
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("INVALID ID");
            }
            _repo.Delete(id);
            return("successfully Deleted");
        }
Exemplo n.º 17
0
        internal string Delete(int id, string userId)
        {
            Vault data = GetById(id, userId);

            if (data.CreatorId != userId)
            {
                throw new Exception("Invalid Edit Permissions, This Vault isn't yours to delete.");
            }
            _vaultsRepo.Delete(id);
            return("Vault Removed;");
        }
Exemplo n.º 18
0
        internal object Delete(int id)
        {
            var existenceTest = _repo.GetById(id);

            if (existenceTest == null)
            {
                throw new Exception("Bad request or Id");
            }
            _repo.Delete(id);
            return("Yay you deleted it");
        }
Exemplo n.º 19
0
        public String Delete(string userId, int id)
        {
            GetByVaultId(id, userId);
            bool delorted = _repo.Delete(userId, id);

            if (!delorted)
            {
                throw new Exception("Not your vault to delete");
            }
            return("Deleted!");
        }
Exemplo n.º 20
0
        // internal Vault Edit(Vault update)
        // {
        //   var found = _repo.GetById(update.Id);
        //   if (found == null) { throw new Exception("Invalid Id Bro"); }
        //   _repo.Edit(update);
        //   return update;
        // }

        internal String Delete(int id, string userId)
        {
            var found = _repo.GetById(id);

            if (found == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
Exemplo n.º 21
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid id.");
            }
            _repo.Delete(id);
            return("Successfully deleted");
        }
Exemplo n.º 22
0
        internal string Delete(int id, Profile userInfo)
        {
            var data = GetById(id, userInfo);

            if (data.CreatorId != userInfo.Id)
            {
                throw new Exception("You must own this Vault to delete it.");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Exemplo n.º 23
0
        internal string Delete(int id, string userId)
        {
            var exists = _vaultRepo.GetById(id);

            if (exists.UserId != userId)
            {
                throw new Exception("not your vault to delete");
            }
            _vaultRepo.Delete(id);
            return("Vault has been deleted!");
        }
Exemplo n.º 24
0
        internal object Delete(string userId, int id)
        {
            GetById(userId, id);
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("You can't delete a Vault you don't own!");
            }
            return("Deleted!");
        }
Exemplo n.º 25
0
        internal object Delete(int id, string userId)
        {
            Vault exists = _repo.GetById(id, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id or You Did Not Create This Vault");
            }

            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
Exemplo n.º 26
0
 internal string Delete(int id, string userId)
 {
     // Vault foundVault = GetById(id);
     // if (foundVault.UserId != userId )
     // {
     //     throw new Exception("This is not your Vault!");
     // }
     if (_repo.Delete(id, userId))
     {
         return("Successfully deleted");
     }
     throw new Exception("Something didn't work");
 }
Exemplo n.º 27
0
    }//endof edit

    internal Vault Delete(int id, string userId)
    {
      Vault found = Get(id);
      if (found.UserId != userId)
      {
        throw new Exception("Invalid Request");
      }
      if (_repo.Delete(id))
      {
        return found;
      }
      throw new Exception("Something went terribly wrong");
    }
Exemplo n.º 28
0
        internal string Delete(int id, string userId)
        {
            Vault foundVault = GetById(id);

            if (foundVault.UserId != userId)
            {
                throw new Exception("Not your vault or profile for that matter");
            }
            if (_repo.Delete(id, userId))
            {
                return("Successfully deleted!");
            }
            throw new Exception("We have no idea how you frigged up this bad");
        }
Exemplo n.º 29
0
        internal Vault Delete(int id, string userId)
        {
            Vault found = Get(id, userId);

            if (found.UserId != userId)
            {
                throw new Exception("Invalid Request");
            }
            if (_repo.Delete(id))
            {
                return(found);
            }
            throw new Exception("Something bad happened");
        }
Exemplo n.º 30
0
        public Vault Delete(int id, string UserId)
        {
            Vault found = GetOne(id, UserId);

            if (found.UserId != UserId)
            {
                throw new Exception("Invalid Request");
            }
            if (_repo.Delete(id))
            {
                return(found);
            }
            throw new Exception("Something went very wrong");
        }