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)); }
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; //} }
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); } }
//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)); }
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)); }
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))); }