/// <summary> /// Checks if an account exists in the database. /// </summary> /// <param name="Password">The password of an account</param> /// <param name="Username">The username of an account</param> /// <returns>Trie if an account exists false if not</returns> public static bool Login(string Password, string Username) { ID = DatabaseLogin.CheckUser(Password, Username); if (ID != 0 && GetUserName(ID) && GetPassword(ID) && GetName(ID) && GetFunction(ID) && GetEventID(ID)) { return(true); } else { return(false); } }
/// <summary> /// Get the function that belongs to the corresponding AccountID /// </summary> /// <param name="ID">The id of an Account</param> /// <returns>True if function exists false if not</returns> private static bool GetFunction(int ID) { string Check = DatabaseLogin.GetString(ID, "Functie"); if (Check != "") { Function = TranslateFunction(Check); return(true); } else { return(false); } }
/// <summary> /// Gets the password that belongs to the corresponding AccountID /// </summary> /// <param name="ID">The id of an account</param> /// <returns>True if password exists false if not</returns> private static bool GetPassword(int ID) { string Check = DatabaseLogin.GetString(ID, "Wachtwoord"); if (Check != "") { Password = Check; return(true); } else { return(false); } }
/// <summary> /// Checks if an account exists in the database /// </summary> /// <param name="ID">The id of an account</param> /// <returns>True if account exists false if not</returns> private static bool GetUserName(int ID) { string Check = DatabaseLogin.GetString(ID, "Gebruikersnaam"); if (Check != "") { UserName = Check; return(true); } else { return(false); } }
/// <summary> /// Gets the name that belongs to the corresponding AccountID /// </summary> /// <param name="ID">The id of an Account</param> /// <returns>True if the name exists false if not</returns> private static bool GetName(int ID) { string Check = DatabaseLogin.GetString(ID, "Naam"); if (Check != "") { Name = Check; return(true); } else { return(false); } }
/// <summary> /// Gets the event ID that belongs to the corresponding AccountID /// </summary> /// <param name="ID">The id of an Account</param> /// <returns>True if EventID is bigger than 0 false if not</returns> private static bool GetEventID(int ID) { int?Check = DatabaseLogin.GetInt(ID, "EventID"); if (Check == 0) { EventID = null; return(true); } else if (Check > 0) { EventID = Check; return(true); } else { return(false); } }