Esempio n. 1
0
        protected void MapServiceToObject(SqlDataReader reader, object userData)
        {
            Entities.Service service = new Entities.Service();

            service.Id          = Utils.GetSafeInt32(reader, "ServiceId");
            service.ServiceType = DomainModel.ServiceTypes.GetById(
                Utils.GetSafeInt32(reader, "TypeId"));
            service.PricePerPerson.Value    = Utils.GetSafeDecimal(reader, "PricePerPerson");
            service.PricePerPerson.Currency = DomainModel.Currencies.GetById(
                Utils.GetSafeInt32(reader, "PriceUnitId"));
            service.Name = Utils.GetSafeString(reader, "ServiceName");

            service.IsDirty = false;

            Entities.ServiceCollection services =
                (Entities.ServiceCollection)userData;
            services.Add(service);
        }