Exemple #1
0
		public ReProcessEntry(AddOnDataToReProcess parent, Guid id, String nameId,
                    DateTime? dBTimeStampToConfirm, DateTime? fileTimeStampToConfirm)
			{
			Id = id;
			NameId = nameId;
			Parent = parent;
			Position = Parent.EntriesToReProcess.Count + 1;
			if (dBTimeStampToConfirm != null)
				DBTimeStampToConfirm = dBTimeStampToConfirm;
			if (fileTimeStampToConfirm != null)
				FileTimeStampToConfirm = fileTimeStampToConfirm;
			LastModifiedTimeToUse = dBTimeStampToConfirm;
			}
Exemple #2
0
		public ObservableCollection<AddOnDataToReProcess> LoadTestEntriesToReProcess
				(ObservableCollection<AddOnDataToReProcess> listOfWPMediaAddOnDataToReProcess)
			{
			listOfWPMediaAddOnDataToReProcess.Clear();
			if (Application.Current.Properties.Contains("TestEntries"))
				{
				Dictionary<String,Dictionary<Guid,String>> testEntries = (Dictionary<String, Dictionary<Guid, String>>) Application.Current.Properties["TestEntries"];
				foreach (string tableKey in testEntries.Keys)
					{
					AddOnDataToReProcess newInfoTestTableEntry = new AddOnDataToReProcess(this,
						Data.DbServer3.MultiMedia.MMUnitTypen.Find_By_Name(tableKey));
					if (tableKey == "Beitraege")
						newInfoTestTableEntry.CsTableToProcess = Data.DbServer3.WPMedia
							.GetTableByName(tableKey);
					else
						newInfoTestTableEntry.CsTableToProcess = Data.DbServer3.WPMediaAddOnData
							.GetTableByName (tableKey);
					newInfoTestTableEntry.Activate(true);
					newInfoTestTableEntry.EntriesToReProcess = new ObservableCollection<ReProcessEntry>();
					foreach(Guid entryKey in testEntries[tableKey].Keys)
						{
						newInfoTestTableEntry.EntriesToReProcess.Add(new ReProcessEntry(newInfoTestTableEntry,
							entryKey, testEntries[tableKey][entryKey], DateTime.Now, null)
							{
							RecreationRequired = true
							});
						}
					listOfWPMediaAddOnDataToReProcess.Add(newInfoTestTableEntry);
					}
				return listOfWPMediaAddOnDataToReProcess;
				}
			AddOnDataToReProcess newWohnParkInfoTestEntry = new AddOnDataToReProcess(this);
			newWohnParkInfoTestEntry.MMUnitTypToProcess = Data.DbServer3.MultiMedia
				.MMUnitTypen.Find_By_Name("KaufParkWerbung");
			newWohnParkInfoTestEntry.EntriesToReProcess = new ObservableCollection<ReProcessEntry>()
				{
				new ReProcessEntry(newWohnParkInfoTestEntry, Guid.Parse("BBB16454-1B26-44AA-9A72-EB7D3C27D8CE"),
					"KP_2016_03 - Kaufparkverein - Verein der Kaufleute", null, null)
				};
			newWohnParkInfoTestEntry.CsTableToProcess = Data.DbServer3.WPMediaAddOnData.GetTableByName
											(newWohnParkInfoTestEntry.MMUnitTypToProcess.TypNameId);
			listOfWPMediaAddOnDataToReProcess.Add(newWohnParkInfoTestEntry);

			return listOfWPMediaAddOnDataToReProcess;

/*
			AddOnDataToReProcess newSportTestEntry = new AddOnDataToReProcess(this);
			newSportTestEntry.MMUnitTypToProcess = Data.DbServer3.WPMediaAddOnData.TableDefinitions.Find_via_TableName("AEAGSport");
			newSportTestEntry.ReProcessEntriesToProcess = new ObservableCollection<ReProcessEntry>()
						{
						new ReProcessEntry(newSportTestEntry, Guid.Parse("4EFC0CE8-FF86-4D6E-8F63-51C5FA5A01AA"), "SportBelegung",
							null, null)
						};
			newSportTestEntry.CsTableToProcess = Data.DbServer3.WPMediaAddOnData.GetTableByName
											(newSportTestEntry.MMUnitTypToProcess.TableName);

			AddOnDataToReProcess newWellnessTestEntry = new AddOnDataToReProcess(this);
			newWellnessTestEntry.MMUnitTypToProcess = Data.DbServer3.WPMediaAddOnData.TableDefinitions.Find_via_TableName("AEAGWellness");
			newWellnessTestEntry.ReProcessEntriesToProcess = new ObservableCollection<ReProcessEntry>()
						{
						new ReProcessEntry(newWellnessTestEntry, Guid.Parse("8BC50B75-B9C6-41CF-87F0-5FBB88086EDD"), "WellnessBelegung",
							null, null)
						};
			newWellnessTestEntry.CsTableToProcess = Data.DbServer3.WPMediaAddOnData.GetTableByName
											(newWellnessTestEntry.MMUnitTypToProcess.TableName);

			listOfWPMediaAddOnDataToReProcess.Add(newSportTestEntry);
			listOfWPMediaAddOnDataToReProcess.Add(newWellnessTestEntry);

			return listOfWPMediaAddOnDataToReProcess;

*/
			}
Exemple #3
0
		public void GetListOfTableEntriesToProcess(ObservableCollection<AddOnDataToReProcess>
			ListOfWPMediaAddOnDataToReProcess, List<String> desiredFunction)
			{
			ListOfWPMediaAddOnDataToReProcess.Clear();

			StatusCollector CollectNewUnits = new StatusCollector(this);
			if (desiredFunction.Contains("Test"))
				{
				LoadTestEntriesToReProcess(ListOfWPMediaAddOnDataToReProcess);
				CollectNewUnits.CollectTableEntriesForLaterProcessing(ListOfWPMediaAddOnDataToReProcess, 150);
				return;
				}

			List<MMUnitTyp> mmUnitTypsToProcess = new List<MMUnitTyp>();
			mmUnitTypsToProcess = Data.DbServer3.MultiMedia
					.MMUnitTypen.Collection.Where(sel => 
						sel.Redaktion == "StandBild" 
						|| sel.Redaktion == "Banner" 
						|| sel.Redaktion == "Video").ToList();

			if ((desiredFunction.Count == 0)
				|| (desiredFunction.Contains("Load")))
				{
				foreach (MMUnitTyp mmUnitTypToProcess in mmUnitTypsToProcess.OrderBy(ord => ord.TypNameId))
					{
					AddOnDataToReProcess newEntry = new AddOnDataToReProcess
						(this, mmUnitTypToProcess);
					ListOfWPMediaAddOnDataToReProcess.Add(newEntry);
					newEntry.Activate(true);
					}
				return;
				}

			foreach (MMUnitTyp mmUnitTypToProcess in mmUnitTypsToProcess.OrderBy(ord => ord.TypNameId))
				{
				AddOnDataToReProcess newEntry = new AddOnDataToReProcess
					(this, mmUnitTypToProcess);
				ListOfWPMediaAddOnDataToReProcess.Add(newEntry);
				if (desiredFunction.Contains("Actualize"))
					{
					newEntry.Activate(true);
					continue;
					}
				if (desiredFunction.Contains(mmUnitTypToProcess.TypNameId))
					{
					newEntry.Activate(true);
					}
				else
					{
					newEntry.Activate(false);
					}
				}
			CollectNewUnits.CollectTableEntriesForLaterProcessing(ListOfWPMediaAddOnDataToReProcess, 150);
			}
Exemple #4
0
		private void DoCompletenessCheck(AddOnDataToReProcess addOnDataToReProcess)
			{
			String ProtokollDirectory = "\\\\WebServer2\\WPMediaSender\\Temp\\WPMediaCompletenessCheck";
			if (!Directory.Exists(ProtokollDirectory))
				Directory.CreateDirectory(ProtokollDirectory);
			MMUnitTyp mmUnitTypToProcess = addOnDataToReProcess.MMUnitTypToProcess;
			StreamWriter Protokoll = new StreamWriter(File
				.Create(Path.Combine(ProtokollDirectory, mmUnitTypToProcess.TypNameId + ".Log")));
			CsDbTable dynamicTable = null;
			switch (mmUnitTypToProcess.Redaktion)
				{
				case "Banner":
				case "StandBild":
					dynamicTable = Data.DbServer3.WPMediaAddOnData.GetTableByName(mmUnitTypToProcess.TypNameId);
					break;
				case "Video":
					dynamicTable = Data.DbServer3.WPMedia.GetTableByName(mmUnitTypToProcess.TypNameId);
					break;
				}
			dynamicTable.Generic_DownloadRows($"Select {dynamicTable.DefaultSqlSelector} from {mmUnitTypToProcess.TypNameId} ");
			dynamicTable.HasBeenLoaded = true;
			Protokoll.WriteLine($"Anzahl Rows in {mmUnitTypToProcess.TypNameId} = {dynamicTable.Rows.Count}");
			DbEntities.dbserver3.wpmediaaddondata.rows.Timing[] AllTimings
				= Data.DbServer3.WPMediaAddOnData.Timings.Load_Via_ConnectedType(mmUnitTypToProcess.TypNameId);
			Protokoll.WriteLine($"Anzahl Timings in Timings = {AllTimings.Length}");
			MMUnit[] AllMMUnits = Data.DbServer3.MultiMedia.MMUnits.Collection
				.Where(sel => sel.ForeignUnitTypId == mmUnitTypToProcess.Id).ToArray();
			Protokoll.WriteLine($"Anzahl der MMUnits  = {AllMMUnits.Length}");
			Protokoll.WriteLine("");
			Protokoll.Close();
			dynamicTable.HasBeenLoaded = false;
			}
Exemple #5
0
		public bool? ReConvertAllConnectedForeignEntries(Guid informationId)
			{
			DoStartup();
			ListOfAddOnDataToReProcessInstance.Clear();
			if (!Data.DbServer3.AltErlaaInfo.PreLoadAddOnsForOneInformation(informationId))
				return false;
			List<Guid> MMUnitIdsToProcess = new List<Guid>();
            foreach (ProcessConnector connector in Data.DbServer3.AltErlaaInfo.ProcessConnectoren.Collection
				.Where(sel => sel.InformationenId == informationId))
				{
				if ((String.IsNullOrEmpty(connector.TableName))
				    || (connector.TableId == null)
				    || (connector.TableId == Guid.Empty))
					continue;
				if ((connector.TableName == "Beitraege")
//					|| (connector.TableName == "BannerData")
					|| (connector.TableName == "ButtonData"))
                    continue;
				AddOnDataToReProcess addOnDataToReProcess = new AddOnDataToReProcess
					(this, Data.DbServer3.MultiMedia.MMUnitTypen.Find_By_Name(connector.TableName));
				addOnDataToReProcess.IsBatchRun = false;
				CsDbRowBase Helper = addOnDataToReProcess.CsTableToProcess.Generic_FindOrLoad(connector.TableId);
				ReProcessEntry newReProcessEntry = new ReProcessEntry(addOnDataToReProcess,
					(Guid)connector.TableId, Helper["NameId"].ToString() , Convert.ToDateTime(Helper["ModifyTimeStamp"]), null);
				addOnDataToReProcess.EntriesToReProcess.Add(newReProcessEntry);
				MMUnitIdsToProcess.Add(newReProcessEntry.Id);
				ListOfAddOnDataToReProcessInstance.Add(addOnDataToReProcess);
				}
			if (MMUnitIdsToProcess.Count > 0)
				Data.DbServer3.MultiMedia.PreLoadAllForAllMMUnits(MMUnitIdsToProcess);
			if (Data.DbServer3.MultiMedia.GetChanges() != null)
				throw new Exception("Data.DbServer3.MultiMedia.GetChanges() != null");
			foreach (AddOnDataToReProcess addOnDataToReProcess in
				ListOfAddOnDataToReProcessInstance)
				{
				addOnDataToReProcess.LastCheckedTime = DateTime.Now;
				addOnDataToReProcess.SummOfProcessingDurations = 0;
				new StandBildConversion().ConvertToMMUnits(addOnDataToReProcess, false);
				//(new TimingsConversion()).CheckAndCorrectWPMediaAddOnDataTimings
				//	(addOnDataToReProcess.ReProcessEntriesToProcess.Select(sel => sel.Id).ToList());
				(new InformationConversion()).CheckOrCreateWPMediaAddOnDataDummyInformation
					(addOnDataToReProcess.EntriesToReProcess.Select(sel => sel.Id).ToList());
				addOnDataToReProcess.SetAllProcessingDone();
				}
			ClearAllConnectedForAllMMUnitLocally(MMUnitIdsToProcess);
			return false;

			}