コード例 #1
0
        protected override object ReadRow(IRowReader reader)
        {
            LightboxBrand lightboxBrand = LightboxBrand.New();

            // Table Fields
            lightboxBrand.LightboxBrandId = reader.GetInt32("LightboxBrandId");
            lightboxBrand.LightboxId      = reader.GetInt32("LightboxId");
            lightboxBrand.BrandId         = reader.GetInt32("BrandId");


            lightboxBrand.IsDirty = false;
            lightboxBrand.ChangedProperties.Clear();

            return(lightboxBrand);
        }
コード例 #2
0
        public static Lightbox Update(Lightbox lightbox)
        {
            Lightbox lb = LightboxMapper.Instance.Update(lightbox);

            LightboxBrandMapper.Instance.DeleteLightboxBrands(lb.LightboxId);

            foreach (Brand brand in lb.Brands)
            {
                LightboxBrand o = LightboxBrand.New();
                o.LightboxId = lb.LightboxId.GetValueOrDefault();
                o.BrandId    = brand.BrandId.GetValueOrDefault();
                LightboxBrand.Update(o);
            }

            return(lb);
        }