示例#1
0
        public TeachersDTO(TeachersDTO teacher)
            : base(teacher)
        {
            LabelsText.Add("SientistLevel");
            LabelsText.Add("AmountOfHours");

            SientistLevel = teacher.SientistLevel;
            AmountOfHours = teacher.AmountOfHours;
        }
示例#2
0
        public override TUObjectsDTO Select(int id)
        {
            TUObjectsDTO tuObject = base.Select(id);
            WorkersDTO worker = (WorkersDTO)tuObject;
            TeachersDTO teacher = new TeachersDTO(worker);

            dbCommand.CommandText = string.Format("Select SientistLevel, AmountOfHours From Teachers Where Id = {0}", id);
            dataReader = dbCommand.ExecuteReader();
            dataReader.Read();

            teacher.SientistLevel = dataReader.GetString(0);
            teacher.AmountOfHours = dataReader.GetInt32(1);

            dataReader.Close();
            return teacher;
        }