Exemplo n.º 1
0
    public string logout(string userData, string filesData)
    {
        User user = JsonConvert.DeserializeObject <User>(userData);

        if (!theDal.isValid(user))
        {
            return("User credentials are not valid.");
        }
        List <File> list = JsonConvert.DeserializeObject <List <File> >(filesData);

        foreach (var file in list)
        {
            if (theDal.contain(user, file))
            {
                theDal.removeFile(file, user.name);
            }
        }
        theDal.logout(user);
        return("User logout.");
    }