Beispiel #1
0
		public static bool SaveToSaveStore(String FileName, PizzaDataModell MappingData)
			{
			FileName = Basics.ConvertToCorrectFileNameElement(FileName);
			if (File.Exists(SaveStoreDirectoryName + "\\" + FileName + ".ser"))
				{
				File.Delete(SaveStoreDirectoryName + "\\" + FileName + ".ser");
				}
			Basics.SerializeObjectToFile(SaveStoreDirectoryName + "\\" + FileName + ".ser", MappingData);
			return true;
			}
		private void LoadButton_OnClick(object Sender, RoutedEventArgs E)
			{
			OpenFileDialog OFD = new OpenFileDialog();
			OFD.Title = "Pizza Directory Auswahl";
			OFD.InitialDirectory = PizzaDataModell.SaveStoreDirectoryName;
			OFD.Multiselect = false;

			if (OFD.ShowDialog() != (bool?)true)
				return;
			String SelectedFileName = OFD.FileName;
			PizzaDataModellInstance = (PizzaDataModell)PizzaDataModell.LoadFromSaveStore(System.IO.Path.GetFileNameWithoutExtension(SelectedFileName));
			PizzaDataModellInstance.CheckForAllowedSplitting();
			}
Beispiel #3
0
		public void DoSpeisenGesamtSplitting(PizzaDataModell modell)
			{
			Modell = modell;
			Entries = Modell.SpeisenGesamt.Replace("\n", "").Split('\r').ToList();
			RemoveLinesToSkip(Entries);
			CreateGroupsForSpeisen(OnlyAllowedEntries);
			SplitPricesDateAndContent(GroupedEntries);
			String CompleteSpeisen = String.Empty;
			String CompletePreise = String.Empty;
			foreach (string groupingWord in TagesMenuGroupingWords)
				{
				if (!GroupedEntries.ContainsKey(groupingWord))
					continue;
				if (groupingWord == "Mittagsmenü")
					{
					Modell.SpeisenTitel = String.Join("\r\n", GroupedEntries[groupingWord]) + "\r\n\r\n";
					continue;
					}
				else
					{
					CompleteSpeisen += String.Join("\r\n", GroupedEntries[groupingWord].ToArray(),
					 1, GroupedEntries[groupingWord].Count - 1) + "\r\n\r\n"; ;
					}
				CompletePreise += GroupedEntries[groupingWord][0] + "\r\n\r\n";
				}
			Modell.SpeisenSpeisen = CompleteSpeisen;
			Modell.SpeisenPreise = CompletePreise;
			}
		public PizzaStandBildMappingControl ()
			{
			PizzaDataModellInstance = new PizzaDataModell();
			InitializeComponent();
			}