Ejemplo n.º 1
0
    public static bool IsLoginCorrect(string email, string password)
    {
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/finduser?t={3}&email={1}&password={2}", GuiControllerUrl, email, password, token));

        tmp = tmp.Substring(1, tmp.Length - 2);
        return(bool.Parse(tmp));
    }
Ejemplo n.º 2
0
    public static List <DateHolder> GetUserWeeklyDataDates(int userID)
    {
        //try
        //{
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/getuploaddates?t={1}", GuiControllerUrl, token));

        return(JsonConvert.DeserializeObject <List <DateHolder> >(tmp));
        //}
        //catch
        //{
        //    return null;
        //}
    }
Ejemplo n.º 3
0
    public static Branch GetUserBranch(string email)
    {
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/getusersbranch?t={2}&email={1}", GuiControllerUrl, email, token));

        string[] bits = tmp.Split('"');
        try
        {
            Branch branch = new Branch(int.Parse(bits[1]), bits[3], double.Parse(bits[5]));
            return(branch);
        }
        catch
        {
            return(null);
        }
    }
Ejemplo n.º 4
0
    //OLD ROUTES VVVV

    public static List <DataHolder> GetWeeklyData(string date)
    {
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/getdata?t={2}&fulldate={1}", GuiControllerUrl, date, token)); //JSON decoded

        return(JsonConvert.DeserializeObject <List <DataHolder> >(tmp));
    }
Ejemplo n.º 5
0
    public static List <Branch> GetAllBranches()
    {
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/getbranches?t={1}", GuiControllerUrl, token)); //{0}/getbranches?t={1}

        return(JsonConvert.DeserializeObject <List <Branch> >(tmp));
    }
Ejemplo n.º 6
0
    public static PermissionLevel GetUserRole(string userEmail)
    {
        string tmp = ServerCommunication.DownloadDataGet(string.Format("{0}/getuserrole?t={2}&email={1}", GuiControllerUrl, userEmail, token));

        return((PermissionLevel)(int.Parse(tmp)));
    }