Beispiel #1
0
        internal void Load(TourBasePriceCollection prices)
        {
            using (SqlConnection cnn = new SqlConnection(sqlConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("TourBasePriceGetAll", cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cnn.Open();

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        if (reader != null && reader.HasRows)
                        {
                            while (reader.Read())
                            {
                                Entities.TourBasePrice price = new Entities.TourBasePrice();
                                price.Id                      = Utils.GetSafeInt32(reader, "PriceId");
                                price.TourType                = DomainModel.TourTypes.GetById(Utils.GetSafeInt32(reader, "TourTypeId"));
                                price.PricePerPerson.Value    = Utils.GetSafeDecimal(reader, "PricePerPerson");
                                price.PricePerPerson.Currency = DomainModel.Currencies.GetById(Utils.GetSafeInt32(reader, "PricePerPersonUnitId"));

                                prices.Add(price);
                            }
                        }
                    }
                }
            }
        }
 internal void CopyTo(TourBasePrice Cost)
 {
     Cost.Id             = this.Id;
     Cost.TourType       = this.TourType;
     Cost.PricePerPerson = this.PricePerPerson;
 }