Exemplo n.º 1
0
        public AirLineLanguage GetByID(int _iD)
        {
            AirLineLanguageDAC _airLineLanguageComponent = new AirLineLanguageDAC();
            IDataReader        reader           = _airLineLanguageComponent.GetByIDAirLineLanguage(_iD);
            AirLineLanguage    _airLineLanguage = null;

            while (reader.Read())
            {
                _airLineLanguage = new AirLineLanguage();
                if (reader["ID"] != DBNull.Value)
                {
                    _airLineLanguage.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _airLineLanguage.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["LanguageID"] != DBNull.Value)
                {
                    _airLineLanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]);
                }
                if (reader["AirLineParentID"] != DBNull.Value)
                {
                    _airLineLanguage.AirLineParentID = Convert.ToInt32(reader["AirLineParentID"]);
                }
                _airLineLanguage.NewRecord = false;
            }
            reader.Close();
            return(_airLineLanguage);
        }
Exemplo n.º 2
0
        public List <AirLineLanguage> GetAll(int ParentID)
        {
            AirLineLanguageDAC     _airLineLanguageComponent = new AirLineLanguageDAC();
            IDataReader            reader = _airLineLanguageComponent.GetAllAirLineLanguage("AirLineParentID=" + ParentID).CreateDataReader();
            List <AirLineLanguage> _airLineLanguageList = new List <AirLineLanguage>();

            while (reader.Read())
            {
                if (_airLineLanguageList == null)
                {
                    _airLineLanguageList = new List <AirLineLanguage>();
                }
                AirLineLanguage _airLineLanguage = new AirLineLanguage();
                if (reader["ID"] != DBNull.Value)
                {
                    _airLineLanguage.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _airLineLanguage.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["LanguageID"] != DBNull.Value)
                {
                    _airLineLanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]);
                }
                if (reader["AirLineParentID"] != DBNull.Value)
                {
                    _airLineLanguage.AirLineParentID = Convert.ToInt32(reader["AirLineParentID"]);
                }
                _airLineLanguage.NewRecord = false;
                _airLineLanguageList.Add(_airLineLanguage);
            }
            reader.Close();
            return(_airLineLanguageList);
        }
Exemplo n.º 3
0
        public bool Insert(AirLineLanguage airlinelanguage)
        {
            int autonumber = 0;
            AirLineLanguageDAC airlinelanguageComponent = new AirLineLanguageDAC();
            bool endedSuccessfuly = airlinelanguageComponent.InsertNewAirLineLanguage(ref autonumber, airlinelanguage.Name, airlinelanguage.LanguageID, airlinelanguage.AirLineParentID);

            if (endedSuccessfuly)
            {
                airlinelanguage.ID = autonumber;
            }
            return(endedSuccessfuly);
        }
Exemplo n.º 4
0
        public bool Update(AirLineLanguage airlinelanguage, int old_iD)
        {
            AirLineLanguageDAC airlinelanguageComponent = new AirLineLanguageDAC();

            return(airlinelanguageComponent.UpdateAirLineLanguage(airlinelanguage.Name, airlinelanguage.LanguageID, airlinelanguage.AirLineParentID, old_iD));
        }