示例#1
0
        public AirLine GetByID(int _iD)
        {
            AirLineDAC  _airLineComponent = new AirLineDAC();
            IDataReader reader            = _airLineComponent.GetByIDAirLine(_iD);
            AirLine     _airLine          = null;

            while (reader.Read())
            {
                _airLine = new AirLine();
                if (reader["ID"] != DBNull.Value)
                {
                    _airLine.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _airLine.Name = Convert.ToString(reader["Name"]);
                }
                _airLine.NewRecord = false;
            }
            reader.Close();
            return(_airLine);
        }