Ejemplo n.º 1
0
        protected override void OnDeleting()
        {
            base.OnDeleting();
            MovieCategory defaultCategory = MovieCategory.GetDefaultCategory(Session);

            foreach (Movie movie in new List <Movie>(Movies))
            {
                movie.Category = defaultCategory;
            }
        }
Ejemplo n.º 2
0
 protected override void OnSavingOverride()
 {
     base.OnSavingOverride();
     if (!IsDeleted)
     {
         if (Category == null)
         {
             Category = MovieCategory.GetDefaultCategory(Session);
         }
         if (string.IsNullOrEmpty(Title))
         {
             throw new Exception("Title can't be null");
         }
     }
 }
Ejemplo n.º 3
0
        void SetDefaultCategoryPrices()
        {
            MovieCategory category = MovieCategory.GetDefaultCategory(session);

            category.GetPrice(MovieItemFormat.DVD).SetDaysRentPrice(0, 1.5M);
            category.GetPrice(MovieItemFormat.DVD).SetDaysRentPrice(1, 2.25M);
            category.GetPrice(MovieItemFormat.DVD).SetDaysRentPrice(2, 2.0M);
            category.GetPrice(MovieItemFormat.DVD).SetDaysRentPrice(3, 1.75M);
            category.GetPrice(MovieItemFormat.BlueRay).SetDaysRentPrice(0, 3.0M);
            category.GetPrice(MovieItemFormat.BlueRay).SetDaysRentPrice(1, 4.0M);
            category.GetPrice(MovieItemFormat.BlueRay).SetDaysRentPrice(2, 3.75M);
            category.GetPrice(MovieItemFormat.BlueRay).SetDaysRentPrice(3, 3.5M);
            category.GetPrice(MovieItemFormat.BlueRay).SetDaysRentPrice(4, 3.25M);
            category.GetPrice(MovieItemFormat.VideoCD).SetDaysRentPrice(0, 1.0M);
            category.GetPrice(MovieItemFormat.VideoCD).SetDaysRentPrice(1, 1.5M);
            category.GetPrice(MovieItemFormat.VideoCD).SetDaysRentPrice(2, 1.25M);
            sellingPrices.Add(MovieItemFormat.DVD, 12.5M);
            sellingPrices.Add(MovieItemFormat.BlueRay, 22.5M);
            sellingPrices.Add(MovieItemFormat.VideoCD, 7.5M);
        }
Ejemplo n.º 4
0
 public override void AfterConstruction()
 {
     base.AfterConstruction();
     IsColor  = true;
     Category = MovieCategory.GetDefaultCategory(Session);
 }