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); } }
public NewNameGenerator() { string categoryNamePattern = ConstStrings.Get(string.Format("New{0}", typeof(T).Name)); categoryUniqueNamePattern = categoryNamePattern + " ({0})"; currentPattern = categoryNamePattern; currentPatternIndex = 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); }
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; }
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(); }
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); }
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(); }
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); }
static ChartMarker2DKindEditData() { list = new List <ChartMarker2DKind>(); list.Add(new ChartMarker2DKind(ConstStrings.Get("None"), null)); list.AddRange(ChartPredefinedValuesProvider.PredefinedMarker2DKinds); }
void DeleteCurrentArtist() { DeleteObject(CurrentArtist, string.Format(ConstStrings.Get("DeleteRecord"), CurrentArtist.Artist.FullName)); }
void DeleteCurrentCompany() { DeleteObject(CurrentCompany, string.Format(ConstStrings.Get("DeleteRecord"), CurrentCompany.Company.Name)); }
public void DeleteCurrentMovie() { DeleteObject(CurrentMovie, string.Format(ConstStrings.Get("DeleteRecord"), CurrentMovie.Movie.Title)); }
public void DeleteCurrentPicture() { DeleteObject(CurrentPicture, ConstStrings.Get("DeletePictureMessage")); }
void UpdateGridCaption() { UpdateReceiptsFilter(); GridCaption = ConstStrings.Get("Receipts") + "|" + string.Format(ConstStrings.Get("DatePeriodCaption"), StartDate, EndDate); }
public virtual bool DeleteCurrentRecord() { return(DeleteObject(CurrentRecord, string.Format(ConstStrings.Get("DeleteRecord"), CurrentRecord.ToString()), (o) => { CurrentRecord = null; })); }
protected override void OnEditObjectReloaded(object sender, EventArgs e) { base.OnEditObjectReloaded(sender, e); TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewMovieCategory") : VRObjectDetailEditObject.MovieCategoryEditObject.VideoRentObject.Name; }
protected override void OnEditObjectReloaded(object sender, EventArgs e) { base.OnEditObjectReloaded(sender, e); TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewActor") : VRObjectDetailEditObject.ArtistEditObject.VideoRentObject.FullName; }
protected override void OnEditObjectReloaded(object sender, EventArgs e) { base.OnEditObjectReloaded(sender, e); TitleDraft = VRObjectDetailEditObject.WasCreatedNewObject ? ConstStrings.Get("NewCustomer") : VRObjectDetailEditObject.CustomerEditObject.VideoRentObject.FullName; UpdateAllowSetCurrentCustomer(); }