示例#1
0
        public VenuesLanguage GetAll(int parentID, int LanguageID)
        {
            VenuesLanguageDAC _venuesLanguageComponent = new VenuesLanguageDAC();
            IDataReader       reader          = _venuesLanguageComponent.GetAllVenuesLanguage("parentID=" + parentID + " AND LanguageID = " + LanguageID).CreateDataReader();
            VenuesLanguage    _venuesLanguage = new VenuesLanguage();

            while (reader.Read())
            {
                if (reader["ID"] != DBNull.Value)
                {
                    _venuesLanguage.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _venuesLanguage.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["Description"] != DBNull.Value)
                {
                    _venuesLanguage.Description = Convert.ToString(reader["Description"]);
                }
                if (reader["Location"] != DBNull.Value)
                {
                    _venuesLanguage.Location = Convert.ToString(reader["Location"]);
                }
                if (reader["Star"] != DBNull.Value)
                {
                    _venuesLanguage.Star = Convert.ToInt32(reader["Star"]);
                }
                if (reader["URL"] != DBNull.Value)
                {
                    _venuesLanguage.URL = Convert.ToString(reader["URL"]);
                }
                if (reader["Phone"] != DBNull.Value)
                {
                    _venuesLanguage.Phone = Convert.ToString(reader["Phone"]);
                }
                if (reader["Fax"] != DBNull.Value)
                {
                    _venuesLanguage.Fax = Convert.ToString(reader["Fax"]);
                }
                if (reader["Email"] != DBNull.Value)
                {
                    _venuesLanguage.Email = Convert.ToString(reader["Email"]);
                }
                if (reader["LanguageID"] != DBNull.Value)
                {
                    _venuesLanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]);
                }
                if (reader["parentID"] != DBNull.Value)
                {
                    _venuesLanguage.parentID = Convert.ToInt32(reader["parentID"]);
                }
                _venuesLanguage.NewRecord = false;
            }
            reader.Close();
            return(_venuesLanguage);
        }
示例#2
0
        public List <VenuesLanguage> GetAll()
        {
            VenuesLanguageDAC     _venuesLanguageComponent = new VenuesLanguageDAC();
            IDataReader           reader = _venuesLanguageComponent.GetAllVenuesLanguage().CreateDataReader();
            List <VenuesLanguage> _venuesLanguageList = new List <VenuesLanguage>();

            while (reader.Read())
            {
                if (_venuesLanguageList == null)
                {
                    _venuesLanguageList = new List <VenuesLanguage>();
                }
                VenuesLanguage _venuesLanguage = new VenuesLanguage();
                if (reader["ID"] != DBNull.Value)
                {
                    _venuesLanguage.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _venuesLanguage.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["Description"] != DBNull.Value)
                {
                    _venuesLanguage.Description = Convert.ToString(reader["Description"]);
                }
                if (reader["Location"] != DBNull.Value)
                {
                    _venuesLanguage.Location = Convert.ToString(reader["Location"]);
                }
                if (reader["Star"] != DBNull.Value)
                {
                    _venuesLanguage.Star = Convert.ToInt32(reader["Star"]);
                }
                if (reader["URL"] != DBNull.Value)
                {
                    _venuesLanguage.URL = Convert.ToString(reader["URL"]);
                }
                if (reader["Phone"] != DBNull.Value)
                {
                    _venuesLanguage.Phone = Convert.ToString(reader["Phone"]);
                }
                if (reader["Fax"] != DBNull.Value)
                {
                    _venuesLanguage.Fax = Convert.ToString(reader["Fax"]);
                }
                if (reader["Email"] != DBNull.Value)
                {
                    _venuesLanguage.Email = Convert.ToString(reader["Email"]);
                }
                if (reader["LanguageID"] != DBNull.Value)
                {
                    _venuesLanguage.LanguageID = Convert.ToInt32(reader["LanguageID"]);
                }
                if (reader["parentID"] != DBNull.Value)
                {
                    _venuesLanguage.parentID = Convert.ToInt32(reader["parentID"]);
                }
                _venuesLanguage.NewRecord = false;
                _venuesLanguageList.Add(_venuesLanguage);
            }
            reader.Close();
            return(_venuesLanguageList);
        }