Esempio n. 1
0
        public void Delete()
        {
            List <MovieItem> itemsForDelete      = new List <MovieItem>();
            bool             allItemsAllowDelete = true;

            foreach (MovieItem item in SelectedItems)
            {
                if (!item.AllowDelete)
                {
                    allItemsAllowDelete = false;
                }
                else
                {
                    itemsForDelete.Add(item);
                }
            }
            if (!allItemsAllowDelete && MessageBox.Show(ConstStrings.Get("NotAllItemsCanBeDeleted"), ConstStrings.Get("Question"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
            {
                return;
            }
            foreach (MovieItem item in itemsForDelete)
            {
                ObjectHelper.SafeDeleteNoCommit(item, null);
            }
        }
Esempio n. 2
0
        public NewNameGenerator()
        {
            string categoryNamePattern = ConstStrings.Get(string.Format("New{0}", typeof(T).Name));

            categoryUniqueNamePattern = categoryNamePattern + " ({0})";
            currentPattern            = categoryNamePattern;
            currentPatternIndex       = 0;
        }
Esempio n. 3
0
        string GetTextDetailsForFormat()
        {
            GenerateDetailsDictionary();
            string ret = string.Format(ConstStrings.Get("ItemsCountDetailCaptionFlowDocument"), FormatDetailsDictionary[MovieItemStatus.Rented.ToString()], FormatDetailsDictionary[MovieItemStatus.Active.ToString()], FormatDetailsDictionary["For Sell"],
                                       FormatDetailsDictionary[MovieItemStatus.Lost.ToString()], FormatDetailsDictionary[MovieItemStatus.Damaged.ToString()], FormatDetailsDictionary[MovieItemStatus.Sold.ToString()]);

            return(ret);
        }
 public void DebitAmount()
 {
     if (CurrentCustomer.Accounts[0] != null)
     {
         MessageBox.Show("Account Information", ConstStrings.Get("Question"), MessageBoxButton.YesNo,
                         MessageBoxImage.Asterisk);
     }
     CurrentCustomer.DebitMembershipFee(_currentCustomer.DefaultMemberAmount);
 }
Esempio n. 5
0
        void CreateShelves()
        {
            ObservableCollection <string> shelves = new ObservableCollection <string>();
            string namePattern = ConstStrings.Get("ShelfPattern");

            for (int i = 0; i < ReferenceData.ShelvesCount; ++i)
            {
                shelves.Add(string.Format(namePattern, i + 1));
            }
            Shelves = shelves;
        }
Esempio n. 6
0
 internal override void SaveAndDispose()
 {
     VideoRentObject.Location = string.Format(ConstStrings.Get("ShelfPattern"), VideoRentObject.Movie.MovieId % ReferenceData.ShelvesCount + 1);
     for (int i = 0; i < itemsCount - 1; ++i)
     {
         MovieItem item = new MovieItem(VideoRentObject.Movie, VideoRentObject.Format, VideoRentObject.SellingPrice);
         item.AvailableForSell = VideoRentObject.AvailableForSell;
         item.Location         = VideoRentObject.Location;
     }
     base.SaveAndDispose();
 }
Esempio n. 7
0
        static List <PeriodItem> GeneratePeriodsList()
        {
            List <PeriodItem> list = new List <PeriodItem>();

            list.Add(new PeriodItem(ConstStrings.Get("PeriodCustom"), PredefinedPeriods[0]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodMonth"), PredefinedPeriods[1]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodThreeMonths"), PredefinedPeriods[2]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodSixMonths"), PredefinedPeriods[3]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodYear"), PredefinedPeriods[4]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodTwoYears"), PredefinedPeriods[5]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodFiveYears"), PredefinedPeriods[6]));
            list.Add(new PeriodItem(ConstStrings.Get("PeriodTenYears"), PredefinedPeriods[7]));
            return(list);
        }
        public Guid?ReturnRents()
        {
            Receipt overdueReceipt = null;

            if (MessageBox.Show(ReturningLate() ? ConstStrings.Get("ReturnAndPaymentLateFeeQuestion") : ConstStrings.Get("ReturnQuestion"), ConstStrings.Get("Question"), MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            {
                List <Rent> returns = new List <Rent>();
                foreach (Rent rent in checkedRents.Keys)
                {
                    returns.Add(rent);
                }
                overdueReceipt = CurrentCustomer.ReturnRents(returns);
            }
            checkedRents.Clear();
            CheckedRentsChangedSignal = true;
            CheckedRentsChangedSignal = false;
            CanReturnItems            = false;
            return(overdueReceipt == null ? null : (Guid?)overdueReceipt.Oid);
        }
Esempio n. 9
0
 void UpdateFields()
 {
     if (CategoryPrice == null)
     {
         DetailControlsVisible = false;
     }
     else
     {
         DetailControlsVisible = true;;
         DefaultRentalDays     = CategoryPrice.DefaultRentDays.ToString();
         DefaultLateFee        = CategoryPrice.DefaultPrice.ToString();
     }
     if (Format == null)
     {
         TotalCount = string.Format(ConstStrings.Get("ItemsCountCaptionFlowDocument"), CountInfo.Total);
     }
     else
     {
         int formatIndex = CountInfo.FormatIndex(Format.Value);
         TotalCount = string.Format(ConstStrings.Get("ItemsCountCaptionFlowDocument"), CountInfo.WithFormat[formatIndex]);
     }
     DetailCounts = GetTextDetailsForFormat();
 }
Esempio n. 10
0
        protected override YesNoCancel AskSaveChanges()
        {
            MessageBoxResult result = MessageBox.Show(ConstStrings.Get("CloseCancelFormWarning"), TitleDraft, MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.Yes);

            return(result == MessageBoxResult.Yes ? YesNoCancel.Yes : result == MessageBoxResult.No ? YesNoCancel.No : YesNoCancel.Cancel);
        }
Esempio n. 11
0
 static ChartMarker2DKindEditData()
 {
     list = new List <ChartMarker2DKind>();
     list.Add(new ChartMarker2DKind(ConstStrings.Get("None"), null));
     list.AddRange(ChartPredefinedValuesProvider.PredefinedMarker2DKinds);
 }
Esempio n. 12
0
 void DeleteCurrentArtist()
 {
     DeleteObject(CurrentArtist, string.Format(ConstStrings.Get("DeleteRecord"), CurrentArtist.Artist.FullName));
 }
Esempio n. 13
0
 void DeleteCurrentCompany()
 {
     DeleteObject(CurrentCompany, string.Format(ConstStrings.Get("DeleteRecord"), CurrentCompany.Company.Name));
 }
Esempio n. 14
0
 public void DeleteCurrentMovie()
 {
     DeleteObject(CurrentMovie, string.Format(ConstStrings.Get("DeleteRecord"), CurrentMovie.Movie.Title));
 }
Esempio n. 15
0
 public void DeleteCurrentPicture()
 {
     DeleteObject(CurrentPicture, ConstStrings.Get("DeletePictureMessage"));
 }
 void UpdateGridCaption()
 {
     UpdateReceiptsFilter();
     GridCaption = ConstStrings.Get("Receipts") + "|" + string.Format(ConstStrings.Get("DatePeriodCaption"), StartDate, EndDate);
 }
Esempio n. 17
0
 public virtual bool DeleteCurrentRecord()
 {
     return(DeleteObject(CurrentRecord, string.Format(ConstStrings.Get("DeleteRecord"), CurrentRecord.ToString()), (o) => { CurrentRecord = null; }));
 }
Esempio n. 18
0
 protected override void OnEditObjectReloaded(object sender, EventArgs e)
 {
     base.OnEditObjectReloaded(sender, e);
     TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewMovieCategory") : VRObjectDetailEditObject.MovieCategoryEditObject.VideoRentObject.Name;
 }
Esempio n. 19
0
 protected override void OnEditObjectReloaded(object sender, EventArgs e)
 {
     base.OnEditObjectReloaded(sender, e);
     TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewActor") : VRObjectDetailEditObject.ArtistEditObject.VideoRentObject.FullName;
 }
Esempio n. 20
0
 protected override void OnEditObjectReloaded(object sender, EventArgs e)
 {
     base.OnEditObjectReloaded(sender, e);
     TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewCustomer") : VRObjectDetailEditObject.CustomerEditObject.VideoRentObject.FullName;
     UpdateAllowSetCurrentCustomer();
 }