Exemplo n.º 1
0
    public static RoleDTO GetRole(int code)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("code={0}", code);

        _responder.Request("roles/get_role", url);
        return(JsonHelper.GetFromJson <RoleDTO>(_responder.Responce));
    }
Exemplo n.º 2
0
    public static bool IsUserAdmin(string user)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("user={0}", user);

        _responder.Request("users_roles/is_user_admin", url);
        return(Convert.ToBoolean(_responder.Responce));
    }
    public static TaskDTO[] GetAllTasksForProject(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("tasks/get_all_tasks_project", url);
        return(JsonHelper.GetArrayFromJson <TaskDTO>(_responder.Responce));
    }
    public static TaskDTO GetTask(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("tasks/get_task", url);
        return(JsonHelper.GetFromJson <TaskDTO>(_responder.Responce));
    }
Exemplo n.º 5
0
    public static RoleDTO[] GetAllRolesForUser(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("users_roles/get_all_roles_for_user", url);
        return(JsonHelper.GetArrayFromJson <RoleDTO>(_responder.Responce));
    }
Exemplo n.º 6
0
    internal static ProjectDTO[] GetAllProjectsByCourator(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("projects/get_all_projects_by_courator", url);
        return(JsonHelper.GetArrayFromJson <ProjectDTO>(_responder.Responce));
    }
    public static MessageDTO[] GetAllMessagesForProject(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("project={0}", id);

        _responder.Request("messages/get_all_messages_for_project", url);
        return(JsonHelper.GetArrayFromJson <MessageDTO>(_responder.Responce));
    }
Exemplo n.º 8
0
    public static string GetPassword(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("users/get_user_password", url);
        return(_responder.Responce);
    }
Exemplo n.º 9
0
    public static UserDTO[] GetAllUsersByRole(int code)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("code={0}", code);

        _responder.Request("users/get_all_users_by_role", url);
        return(JsonHelper.GetArrayFromJson <UserDTO>(_responder.Responce));
    }
    public static TaskDTO[] GetAllTasksForWorkerInWork(string worker)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("worker={0}", worker);

        _responder.Request("tasks/get_all_tasks_user_inwork", url);
        return(JsonHelper.GetArrayFromJson <TaskDTO>(_responder.Responce));
    }
Exemplo n.º 11
0
    public static bool SetProjectInWork(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("projects/set_project_inwork", url);
        LogsController.AddLog(PlayerPrefs.GetString("SessionUserId"), "SET PROJECT INWORK",
                              string.Format("Id: \"{0}\"", id));
        return(Convert.ToBoolean(_responder.Responce));
    }
Exemplo n.º 12
0
    public static UserDTO GetUserById(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("users/get_user_by_id", url);
        var user = JsonHelper.GetFromJson <UserDTO>(_responder.Responce);

        return(user);
    }
Exemplo n.º 13
0
    public static bool DeleteUser(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("users_roles/delete_user", url);
        LogsController.AddLog(PlayerPrefs.GetString("SessionUserId"), "DELETE USER",
                              string.Format("Id: \"{0}\"", id));
        return(Convert.ToBoolean(_responder.Responce));
    }
Exemplo n.º 14
0
    public static bool DeleteRole(int code)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("code={0}", code);

        _responder.Request("roles/delete_role", url);
        LogsController.AddLog(PlayerPrefs.GetString("SessionUserId"), "DELETE ROLE",
                              string.Format("Code: \"{0}\"", code));
        return(Convert.ToBoolean(_responder.Responce));
    }
    public static bool SetTaskCompleted(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("tasks/set_task_completed", url);
        LogsController.AddLog(PlayerPrefs.GetString("SessionUserId"), "SET TASK COMPLETED",
                              string.Format("Id: \"{0}\"", id));
        return(Convert.ToBoolean(_responder.Responce));
    }
Exemplo n.º 16
0
    public static string GetWorkerCountForProject(string id)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("id={0}", id);

        _responder.Request("users/get_worker_count_for_project", url);
        int count;

        int.TryParse(_responder.Responce, out count);
        return(count.ToString());
    }
Exemplo n.º 17
0
    public static UserDTO GetUser(string login)
    {
        _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
        var url = string.Format("login={0}", WWW.EscapeURL(login));

        _responder.Request("users/get_user", url);
        //var user = JsonHelper.GetFromJson<UserDTO>(_responder.Responce);
        //if (user == null)
        //{
        //    url = string.Format("email={0}", login);
        //    _responder.Request("users/get_user", url);
        //}
        return(JsonHelper.GetFromJson <UserDTO>(_responder.Responce));
    }
Exemplo n.º 18
0
 public static UserDTO[] GetAllUsers()
 {
     _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
     _responder.Request("users/get_all_users", "");
     return(JsonHelper.GetArrayFromJson <UserDTO>(_responder.Responce));
 }
Exemplo n.º 19
0
 internal static ProjectDTO[] GetAllProjectsDone()
 {
     _responder = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Responder>();
     _responder.Request("projects/get_all_projects_done", "");
     return(JsonHelper.GetArrayFromJson <ProjectDTO>(_responder.Responce));
 }