예제 #1
0
        public string Delete(int id, string userId)
        {
            Vault vault = Get(id, userId);

            _repo.Delete(id);
            return("Successfully deleted");
        }
예제 #2
0
 internal string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Vault successfully removed.");
     }
     throw new Exception("Could not delete vault");
 }
예제 #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.");
            }
        }
예제 #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");
        }
예제 #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));
        }
예제 #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!");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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!");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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!");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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;");
        }
예제 #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");
        }
예제 #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!");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }
예제 #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!");
        }
예제 #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!");
        }
예제 #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");
        }
예제 #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");
 }
예제 #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");
    }
예제 #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");
        }
예제 #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");
        }
예제 #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");
        }