public Information CreateNewInformationWithDefinedType(Typ TypToCreate)
			{
			Data.DbServer3.AltErlaaInfo.LoadAll_IfHasNotBeenLoaded();
			String UserName = "******";
			if (Application.Current.Properties.Contains("UserName"))
				UserName = Application.Current.Properties["UserName"].ToString();
			InformationToProcess = Data.DbServer3.AltErlaaInfo.CreateNewInformation(TypToCreate.Id,
				UserName);
			return InformationToProcess;
			}
Esempio n. 2
0
		private void AddDataDependencyToTyp (Typ typToWhichTheEntryShouldBeAdded, DataDependency entryToAdd)
			{
			UseForTyp newEntry = DbDataContext.AltErlaaInfo.UseForTypen.NewRow();
			newEntry.Id = Guid.NewGuid();
			newEntry.DataDependencyId = entryToAdd.Id;
			newEntry.ModifyTimeStamp = DateTime.Now;
			newEntry.TypId = typToWhichTheEntryShouldBeAdded.Id;
			DbDataContext.AltErlaaInfo.UseForTypen.Rows.Add(newEntry);
			UseFor newUseForEntry = DbDataContext.AltErlaaInfo.UseFors.NewRow();
			newUseForEntry.Id = Guid.NewGuid();
			newUseForEntry.DataDependencyId = entryToAdd.Id;
			newUseForEntry.ModifyTimeStamp = DateTime.Now;
			newUseForEntry.TypId = typToWhichTheEntryShouldBeAdded.Id;
			DbDataContext.AltErlaaInfo.UseFors.Rows.Add(newEntry);
			}
Esempio n. 3
0
		private void RemoveDataDependencyFromTyp (Typ typFromWhichTheEntryShouldBeRemoved, DataDependency entryToRemove)
			{
			UseForTyp useForUsage = Data.DbServer3.AltErlaaInfo.UseForTypen.Where(sel =>
				sel.TypId == typFromWhichTheEntryShouldBeRemoved.Id
				&& sel.DataDependencyId == entryToRemove.Id).FirstOrDefault();
			if (useForUsage != null)
				useForUsage.Delete();
			UseFor useForAssignement = Data.DbServer3.AltErlaaInfo.UseFors.Where(sel =>
						sel.DataDependencyId == entryToRemove.Id
							&& sel.TypId == typFromWhichTheEntryShouldBeRemoved.Id).FirstOrDefault();
			if (useForAssignement != null)
				useForAssignement.Delete(); 
			}
Esempio n. 4
0
			public void AnalyzePreSelectedTyp(Typ PreSelected, out TreeEntryClass SelectedGroup, out TreeEntryClass SelectedTyp)
				{
				SelectedGroup = null;
				SelectedTyp = null;
				foreach (TreeEntryClass RootEntry in DataModell.TreeEntryClassCacheInstance.TypTree)
					{
					foreach (TreeEntryClass ChildEntry in RootEntry.Childs)
						{
						if (((Typ) ChildEntry.ConnectedObject).Id == PreSelected.Id)
							{
							SelectedGroup = RootEntry;
							SelectedTyp = ChildEntry;
							return;
							}
						}

					}

				}
Esempio n. 5
0
	    private bool CreateTypedInformationAddOnsForInformation(Information information, Typ typToCreate, String UserName)
		    {
			List<DataDependency> UsedDataDependencies = new List<DataDependency>();
			foreach (UseFor useFor in DataContext.AltErlaaInfo.UseFors
					.Where(sel => ((sel.TypId != null && sel.TypId == typToCreate.Id)
							|| (sel.RootDataTemplatesId != null && sel.RootDataTemplatesId == typToCreate.RootFormat))
						&& sel.Usage == "Mandatory"
						&& sel.DataDependency.DataElementeTemplate
							.PhysicalDataElement.TabellenName != "Informationen"))
				{
				UsedDataDependencies.Add(useFor.DataDependency);
				}
			foreach (DataDependency dataDependency in UsedDataDependencies.OrderBy(ord => ord.SortOrder))
				{
				InformationAddOn newAddOn = DataContext.AltErlaaInfo.InformationenAddOns.InsertNew(information, dataDependency, UserName);
				}
			foreach (InformationAddOn informationenAddOn in information.InformationenAddOnsOrdered)
				{
				informationenAddOn.ProcessBeforeFirstAccessedDefaultFilling();
				}
			return true;
		    }
Esempio n. 6
0
		public Typ SetActiveTypViaId(Guid? TypId)
			{
			ActiveTyp = DbDataContext.AltErlaaInfo.Typen.Find(TypId);
			return ActiveTyp;
			}
Esempio n. 7
0
		public void SetCorrectStandBildMappingEntries(Typ Trigger)
			{
			ActiveTyp= Trigger;
//			DataModell.StandBildMappingFullCacheInstance.StandBildMappingFullForThisTyp = Trigger;
			DataModell.StandBildMappingFullCacheInstance.CorrectOrderedStandBildMappingFullForTyp = null;
			DataModell.StandBildMappingFullCacheInstance.ActiveStandBildMappingFullCollection
				= DataModell.StandBildMappingFullCacheInstance.CorrectOrderedStandBildMappingFullForTyp;
			}
Esempio n. 8
0
		private void ProcessAllMappingsForTypAndRedaktion (Typ activeTyp, DataRow newRow, ProcessConnector processConnectorToProcess,
			ChapterBase dynamicPageToCreateForThisRun, String pageIDToUse)
			{
			ObservableCollection<StandBildMapping> MappingsForThisTyp = null;
			if (processConnectorToProcess.Redaktion == "StandBild")
				MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForStandBild;
			else
				if (processConnectorToProcess.Redaktion == "Banner")
					MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForBanner;
				else
					MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForAll;
			foreach (StandBildMapping Mapping in MappingsForThisTyp)
				{
				foreach (InformationAddOn InfoAddOn in InformationToProcess.InformationenAddOns)
					{
					if (Mapping.SourceDataDependencyId != InfoAddOn.DataDependencyId)
						continue;
					Profile.ActiveDataDependency = Profile.SetActiveDataDependencyViaId
										((Guid)InfoAddOn.DataDependencyId);
					if ((Profile.ActiveDataDependency.DataElementeTemplate.UseMultiple == "Yes")
						&& (pageIDToUse != "1"))
						continue;
					ProcessThisMapping(InfoAddOn, newRow, processConnectorToProcess,
							Mapping, pageIDToUse);
#if DEBUG
						DoMappingTrace("After Standard Mapping", newRow, Mapping);
#endif

					}
				if (dynamicPageToCreateForThisRun != null)
					foreach (InformationAddOn InfoAddOn in dynamicPageToCreateForThisRun.InformationenAddOnLinkedWithThisChapter)
						{
						if (Mapping.SourceDataDependencyId != InfoAddOn.DataDependencyId)
							continue;
						Profile.ActiveDataDependency = Profile.SetActiveDataDependencyViaId((Guid)InfoAddOn.DataDependencyId);
						if (Profile.ActiveDataDependency.DataElementeTemplate.UseMultiple != "Yes")
							throw new Exception("Profile.ActiveFullDataDependency.UseMultiple != \"Yes\"");
						ProcessThisMapping(InfoAddOn, newRow, processConnectorToProcess,
								Mapping, pageIDToUse);
#if DEBUG
							DoMappingTrace("After Chapter Mapping", newRow, Mapping);
#endif

						}
				}

			}