Пример #1
0
        public AuxiliaryWorkersDTO(AuxiliaryWorkersDTO auxiliaryWorker)
            : base(auxiliaryWorker)
        {
            LabelsText.Add("Shift");
            LabelsText.Add("TypeOfWork");

            Shift = auxiliaryWorker.Shift;
            TypeOfWork = auxiliaryWorker.TypeOfWork;
        }
Пример #2
0
        public override TUObjectsDTO Select(int id)
        {
            TUObjectsDTO tuObject = base.Select(id);
            WorkersDTO worker = (WorkersDTO)tuObject;
            AuxiliaryWorkersDTO auxiliaryWorker = new AuxiliaryWorkersDTO(worker);

            dbCommand.CommandText = string.Format("Select Shift, TypeOfWork From AuxiliaryWorkers Where Id = {0}", id);
            dataReader = dbCommand.ExecuteReader();
            dataReader.Read();

            auxiliaryWorker.Shift = dataReader.GetInt32(0);
            auxiliaryWorker.TypeOfWork = dataReader.GetString(1);

            dataReader.Close();
            return auxiliaryWorker;
        }