Beispiel #1
0
 public User mapUser(SqlDataReader reader)
 {
     return(new User()
     {
         Id = Convert.ToInt32(reader["ID"]),
         Email = Convert.ToString(reader["Email"]),
         Password = Convert.ToString(reader["Passwort"]),
         Customer = customerModel.getCustomer(Convert.ToString(reader["Kunde"])),
         Employee = employeeModel.getEmployee(Convert.ToInt32(reader["Mitarbeiter"])),
         Vice = viceModel.getVice(Convert.ToInt32(reader["Stellvertreter"])),
         OrganisationLeader = organisationLeaderModel.getOrganisationLeader(Convert.ToInt32(reader["Filialleiter"]))
     });
 }
Beispiel #2
0
        public Lending mapLending(SqlDataReader reader)
        {
            Lending lending = new Lending()
            {
                Number   = Convert.ToInt32(reader["Ausleihnummer"]),
                Customer = customerModel.getCustomer(Convert.ToString(reader["Kunde"])),
                From     = Convert.ToDateTime(reader["VonDatum"]),
                To       = Convert.ToDateTime(reader["BisDatum"])
            };

            if (reader["Spiel1"] != null)
            {
                lending.Games.Add(gameModel.GetGame(Convert.ToInt32(reader["Spiel1"])));
            }
            if (reader["Spiel2"] != null)
            {
                lending.Games.Add(gameModel.GetGame(Convert.ToInt32(reader["Spiel2"])));
            }
            if (reader["Spiel3"] != null)
            {
                lending.Games.Add(gameModel.GetGame(Convert.ToInt32(reader["Spiel3"])));
            }
            return(lending);
        }