Пример #1
0
 /// <summary>
 /// Creation of a new tram
 /// </summary>
 /// <param name="id">id of the tram</param>
 /// <param name="type">tram type</param>
 /// <param name="rail">rail on which the tram should be placed on</param>
 /// <param name="driver">the driver of the tram</param>
 /// <param name="status">1= OK 2= Dirty 3= Defect 4= DirtyAndDefect</param>
 public Tram(int id, string type, Rail rail, User driver, int status, bool onRail)
 {
     this.Id = id;
     this.Type = type;
     this.Rail = rail;
     this.Driver = driver;
     Status = (Status)status;
     OnRail = onRail;
 }
Пример #2
0
 /// <summary>
 /// logs the user in
 /// </summary>
 /// <param name="username">username of the user</param>
 /// <param name="password">matching password</param>
 /// <returns>bool indicating succes</returns>
 public bool LogIn(string username, string password)
 {
     foreach(Dictionary<string, object> D in addatabase.Getuserpassword(username))
     {
         if((string)D["wachtwoord"] == password)
         {
             LoggedInUser = new User(Convert.ToInt32(D["gebruikerid"]), (string)D["naam"], (string)D["email"], Convert.ToInt32(D["functieid"]));
             return true;
         }
     }
     return false;
 }