コード例 #1
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public String GetTypeSelectClause(InformationenAddOn InfoAddOn, Guid? TypesToProcess)
			{
			WCFStandards DataAccess = new WCFStandards();
			DataSet TypeInformationenIDs =
					DataAccess.GetCommonDataSet("Select ID from Informationen where TypID ='"
					+ ((Guid)TypesToProcess).ToString() + "'");
			if (TypeInformationenIDs.Tables["Informationen"].Rows.Count == 0)
				return String.Empty;
			List<string> IDsToSearchFor = new List<string>();
			foreach (DataRow IDRow in TypeInformationenIDs.Tables["Informationen"].Rows)
				IDsToSearchFor.Add(IDRow["ID"].ToString());
			String InfoAddOnSelectClause = " (InformationenID = '" + String.Join("' or InformationenID = '", IDsToSearchFor.ToArray()) + "') ";
			DataSet DistinctEntries =
				DataAccess.GetCommonDataSet("Select distinct (TabelleID), count (*) as Occurence from "
					 + " InformationenAddOn where Tabelle = '" + InfoAddOn.Tabelle + "' and " + InfoAddOnSelectClause
					 + " Group By TabelleID order by Occurence");
			if (DistinctEntries.Tables["InformationenAddOn"].Rows.Count == 0)
				return String.Empty;
			List<string> TabelleIDSearchFor = new List<string>();
			foreach (DataRow IDRow in DistinctEntries.Tables["InformationenAddOn"].Rows)
				TabelleIDSearchFor.Add(IDRow["TabelleID"].ToString());
			return " (ID = '" + String.Join("' or ID = '", TabelleIDSearchFor.ToArray()) + "') ";

			}
コード例 #2
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public String GetMyOrUsedUnifiedTableIDsSelectClause(InformationenAddOn InfoAddOn, AuswahlSelection EntriesToShow)
			{
			String WhereClause = String.Empty;
			if (EntriesToShow == AuswahlSelection.My)
				{
				DataSet MyInformationenIDs =
					BasicAccess.AltErlaaInfoDataBase.GetCommonDataSet("Select ID from Informationen where CreatedBy ='"
							+ Basics.GetCurrentProcessName () + "' or LastModifiedBy = '"
							+ WMB.WPMediaApplicationState.Instance.Properties ["UserName"].ToString ().ToUpper () + "'");
				if (MyInformationenIDs.Tables["Informationen"].Rows.Count == 0)
					return String.Empty;
				List<string> IDsToSearchFor = new List<string>();
				foreach (DataRow IDRow in MyInformationenIDs.Tables["Informationen"].Rows)
					IDsToSearchFor.Add(IDRow["ID"].ToString());
				WhereClause = " and  (InformationenID = '" + String.Join("' or InformationenID = '", IDsToSearchFor.ToArray()) +
									 "') ";
				}
			DataSet OccurenceOrderedMyTableIDs = BasicAccess.AltErlaaInfoDataBase.GetCommonDataSet("Select distinct (TabelleID), count (*) as Occurence from "
					 + " InformationenAddOn where Tabelle = '" + InfoAddOn.Tabelle + "' " + WhereClause + " Group by TabelleID order by Occurence");
			if (OccurenceOrderedMyTableIDs.Tables["InformationenAddOn"].Rows.Count == 0)
				return String.Empty;
			List<string> UnifiedTableIDs = new List<string>();
			foreach (DataRow UnifiedRow in OccurenceOrderedMyTableIDs.Tables["InformationenAddOn"].Rows)
				UnifiedTableIDs.Add(UnifiedRow["TabelleID"].ToString());
			return " (ID = '" + String.Join("' or ID = '", UnifiedTableIDs.ToArray()) + "') ";
			}
コード例 #3
0
		public InformationenAddOn InsertNewSibling (InformationenAddOn SiblingEntry)
			{
			InformationenAddOn ReturnAddOn = null;
			//TemplateElementManagement ExistingTemplateSiblingEntry = null;
			//foreach (TemplateElementManagement Entry in ElementManagementList)
			//	if (Entry.InfoAddOn.ID == SiblingEntry.ID)
			//		ExistingTemplateSiblingEntry = Entry;

			//int NewRenumberInfoModellIndex = TemplateRuntime.CreateOneDataElement (InformationenRuntime,
			//		InformationenRuntime.AllTemplateElementManagementEntries, ActiveInformationen, ref ReturnAddOn,
			//		ExistingTemplateSiblingEntry.DataTemplatesDescriptionEntry,
			//		ExistingTemplateSiblingEntry.IndexInParentsGraphicalAndLogicalList + 1);

			////SiblingEntry.Informationen.ConnectedInformationenAddOn.Insert
			////	(SiblingEntry.Informationen.ConnectedInformationenAddOn.IndexOf (SiblingEntry),
			////	ReturnAddOn);

			//ReturnAddOn.Informationen = SiblingEntry.Informationen;
			//ReturnAddOn.SortOrder = SiblingEntry.SortOrder + 1;
			//ReturnAddOn.Parent_Additional = SiblingEntry.Parent_Additional;
			//ReturnAddOn.DataDependencyID = SiblingEntry.DataDependencyID;
			return ReturnAddOn;
			}
コード例 #4
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public OrganisationenFull GetOrganisationenFullFromID(Guid? ID,
			InformationenAddOn ActiveEntry = null)
			{
			DataRowCollection OrgFull = BasicAccess.AltErlaaInfoDataBase.GetCommonMultiDataSet(new String[]
				{
				String.Format ("select * from OrganisationenFull where ID = '{0}'", ID.ToString ())
				}).Tables["OrganisationenFull"].Rows;
			if (OrgFull.Count < 1)
				{
				DataRow NewRow = DataSetForEmptyTables.Tables["OrganisationenFull"].NewRow();
				NewRow["ID"] = Guid.NewGuid();
				if (DataSetForEmptyTables.Tables["OrganisationenFull"].Columns.Contains("ROWID"))
					NewRow["ROWID"] = NewRow["ID"];
				NewRow["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper();
				DataSetForEmptyTables.Tables["OrganisationenFull"].Rows.Add(NewRow);
				return new OrganisationenFull(NewRow)
				{
					Parent = ActiveEntry
				};
				}
			return new OrganisationenFull(OrgFull[0])
			{
				Parent = ActiveEntry
			};
			}
コード例 #5
0
ファイル: ContentModellFactory.cs プロジェクト: heinzsack/DEV
		private Object CreateTypeCorrectModell (InformationenAddOn ActiveInformationenAddOn)
			{
			String NewClassName = String.Format("AltErlaaInfoWorkList.TableEditoren.{0}EditorClasses.EditorFor{0}TableModell",
				ActiveInformationenAddOn.Tabelle);
			try
				{
				Type DataType = Type.GetType(NewClassName);
				if (DataType == null)
					{
					Basics.ReportErrorToEventViewer("Für den Klassennamen \""
						+ NewClassName + "\" wurde noch keine Handlerklasse definiert");
					return null;
					}
				Object[] CtorParameter = new Object[] { };
				Object ModellClass = (Object)Activator.CreateInstance(DataType, CtorParameter);
				return ModellClass;

				}
			catch (Exception Excp)
				{
				Basics.ReportErrorToEventViewer ("Für den Klassennamen \"" + NewClassName + "\" wurde noch keine Handlerklasse definiert");
				Debug.Assert(false, "Für den Klassennamen \"" + NewClassName + "\" wurde noch keine Handlerklasse definiert");
				return null;
				}
			}
コード例 #6
0
ファイル: UpdateOneAddOnModell.cs プロジェクト: heinzsack/DEV
			public DataCollection<SelectionDataClass> GetSelectionData(List<String> BereicheToUse, String ActiveUser,
				InformationenAddOn InfoAddOnParameter,
				Guid TypID, AuswahlSelection EntriesToShow, AuswahlSortOrder SortOrder)
				{
				if (InfoAddOnParameter.Tabelle == "ProcessConnector")
					return null;
				String SortAddOn = String.Empty;

				FillSearchParameter(InfoAddOnParameter.Tabelle);

				if ((SortingItemsForSelection.Length == 0)
					&& (ItemsToSelectForSelection.Length == 0)
					&& (ItemsToFillHinweisColumn.Length == 0)
					&& (String.IsNullOrEmpty(ViewNameForSelection)))
					return null;

				List<String> ItemsToSelect = new List<string>();
				List<String> ItemsToSort = new List<string>();
				ItemsToSelect.AddRange(ItemsToSelectForSelection);
				foreach (String SortingItem in SortingItemsForSelection)
					{
					if (!ItemsToSelect.Contains(SortingItem.Replace(" desc", "")))
						{
						ItemsToSelect.Add (SortingItem.Replace (" desc", ""));
						}
					ItemsToSort.Add(SortingItem);
					}
				if (ItemsToSort.Count > 0)
					{
					SortAddOn = " order by " + String.Join (", ", ItemsToSort);
					}

				foreach (String HinweisItem in ItemsToFillHinweisColumn)
					if (!ItemsToSelect.Contains(HinweisItem))
						ItemsToSelect.Add(HinweisItem);
				String SelectAddOn = String.Empty;
				List<String> SelectBasisStatements = new List<string>();
				switch (EntriesToShow)
					{
					case AuswahlSelection.All:
						break;
					case AuswahlSelection.My:
						SelectAddOn = String.Format(" and (CreatedBy is null or CreatedBy = '{0}' or LastModifiedBy = '{0}') ",
							ActiveUser.ToUpper());
						break;
					case AuswahlSelection.Used:
						SelectBasisStatements.Add(String.Format("select distinct (TabelleID), count (*) as Anzahl from InformationenAddOn "
							+ " where Tabelle = '{0}' and not TabelleID is null and "
							+ " not TabelleID = '00000000-0000-0000-0000-000000000000' group by TabelleID order by Anzahl desc",
								InfoAddOnParameter.Tabelle));
						SelectAddOn = String.Format(" and ID in (select distinct (TabelleID) from InformationenAddOn "
								+ " where Tabelle = '{0}' and not TabelleID is null "
								+ "and not TabelleID = '00000000-0000-0000-0000-000000000000' )", InfoAddOnParameter.Tabelle);
						break;
					case AuswahlSelection.OnlyWohnPark:
						SelectAddOn = " and (HausID = '766B7B60-7A0D-47AD-8323-638A073FBF77') ";
						SortAddOn = " order by HausKurzbezeichnung, AdressenKurzbezeichnung, Ort, "
						            + "StrassenName, Hausnummer, Stiege, Stock, Tuere ";
						break;
					case AuswahlSelection.OnlyKaufPark:
						SelectAddOn = " and (HausID = '21403101-55E9-4F78-92C7-C89F121D7D6C') ";
						SortAddOn = " order by HausKurzbezeichnung, AdressenKurzbezeichnung, Ort, "
						            + "StrassenName, Hausnummer, Stiege, Stock, Tuere ";
						break;
					case AuswahlSelection.External:
						SelectAddOn = " and ((not HausID = '21403101-55E9-4F78-92C7-C89F121D7D6C' and "
										+ "not HausID = '766B7B60-7A0D-47AD-8323-638A073FBF77') or HausID is null)";
						SortAddOn = " order by HausKurzbezeichnung, AdressenKurzbezeichnung, Ort, "
						            + "StrassenName, Hausnummer, Stiege, Stock, Tuere ";
						break;
					}
				switch (SortOrder)
					{
					case AuswahlSortOrder.Alphabetic:
						break;
					case AuswahlSortOrder.Occurence:
						break;
					}
				String BereichClause = " (Bereich = '" + String.Join ("' or Bereich = '", BereicheToUse) + "') ";
				SelectBasisStatements.Add("select Bereich, " + String.Join(", ", ItemsToSelect) + " from " + ViewNameForSelection
							+ " where " + BereichClause + SelectAddOn + SortAddOn);

				DataSet SearchDataSet = BasicAccess.AltErlaaInfoDataBase.GetCommonMultiDataSet(SelectBasisStatements.ToArray());
				Dictionary<Guid, String> HaeufigkeitProID = new Dictionary<Guid, String>();
				if (SearchDataSet.Tables["InformationenAddOn"] != null)
					{
					foreach (DataRow HaeufigkeitEntry in SearchDataSet.Tables["InformationenAddOn"].Rows)
						{
						String Haeufigkeit = String.Format("    {0:D}", Convert.ToInt32(HaeufigkeitEntry["Anzahl"]));
						HaeufigkeitProID[(Guid)HaeufigkeitEntry["TabelleID"]]
							= Haeufigkeit.Substring(Haeufigkeit.Length - 4);
						}
					}
				DataCollection<SelectionDataClass> Result = new DataCollection<SelectionDataClass>();
				foreach (DataRow SearchEntry in SearchDataSet.Tables[ViewNameForSelection].Rows)
					{
					Result.Add(GetSelectionDataContent(SearchEntry, InfoAddOnParameter));
					if (SearchDataSet.Tables["InformationenAddOn"] != null)
						Result.Last().Haeufigkeit = HaeufigkeitProID[(Guid)SearchEntry["ID"]];
					}

				return Result;

				}
コード例 #7
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public bool InsertOrUpdateNewMaterial(Guid InformationenID, Guid DataDependencyID, ref InformationenAddOn InfoAddOnID, ref Materialien Material,
											  String ContentToStore, String NameOfTheContentToStore,
											  String TypOfTheContentToStore)
			{
			return InsertOrUpdateNewMaterial(InformationenID, DataDependencyID, ref InfoAddOnID, ref Material,
									  Basics.ConvertStringToMemoryStream(ContentToStore), NameOfTheContentToStore,
									  TypOfTheContentToStore);
			}
コード例 #8
0
ファイル: ContentModellFactory.cs プロジェクト: heinzsack/DEV
		public InformationenAddOn  InsertSibling (InformationenAddOn SiblingSourceInformationenAddOn)
			{
			return DataModell.InsertSibling (SiblingSourceInformationenAddOn);
			}
コード例 #9
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public InformationenAddOn InsertSibling(InformationenAddOn SiblingSourceInformationenAddOn)
			{
			DataRow NewRow = SiblingSourceInformationenAddOn.BasisRow.Table.NewRow();
			Basics.CopyRowContent(SiblingSourceInformationenAddOn.BasisRow, NewRow);
			NewRow["ID"] = Guid.NewGuid();
			NewRow["TabelleID"] = Convert.DBNull;
			NewRow["FreiText"] = String.Empty;
			NewRow["SortOrder"] = Convert.ToInt32(NewRow["SortOrder"]) + 1;
			NewRow["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper();
			SiblingSourceInformationenAddOn.BasisRow.Table.Rows.Add(NewRow);
			int InsertIntoInformationenIndex =
				ActiveInformationen.ConnectedInformationenAddOn.IndexOf(SiblingSourceInformationenAddOn);
			InformationenAddOn NewEntry = new InformationenAddOn(NewRow)
			{
				ParentInformationen = ActiveInformationen
			};
			NewEntry.Parent = this;

			ActiveInformationen.ConnectedInformationenAddOn.Insert(InsertIntoInformationenIndex + 1, NewEntry);
			int InsertIntoWorkListIndex =
				InformationAndInformationenAddOns.IndexOf(SiblingSourceInformationenAddOn);
			InformationAndInformationenAddOns.Insert(InsertIntoWorkListIndex + 1, NewEntry);
			SendPropertyChanged("InformationAndInformationenAddOns");
			return NewEntry;
			}
コード例 #10
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public bool DeleteConnectedStandbildEntryViaStandBildManagement(InformationenAddOn InfoAddOn)
			{
			ProcessConnector Connector = (ProcessConnector)InfoAddOn.ConnectedTableClass;
			WMB.DataWrapper.Instance.DeleteAllForOneStandBildEntry(Connector.TableName, Connector.TableID.ToString());
			Connector.TableID = Guid.Empty;
			InfoAddOn.FreiText = Connector.GetFreitext(FreiTextFormat.Full);
			return true;
			}
コード例 #11
0
ファイル: ProcessConnector.cs プロジェクト: heinzsack/DEV
		public void AddToListOfInfoAddOnToProcess (InformationenAddOn Entry)
			{
		    int ChapterIndex = 0;
		    bool InsertedBefore = false;
		    foreach (ChapterBase Base in UsedChapterBase)
		        {
		        if (Base.InformationenAddOnLinkedWithThisChapter.Contains(Entry))
		            {
		            InsertedBefore = true;
                    break;
		            }
                ChapterIndex++;
                }
            if (InsertedBefore)
		        return;
		    ChapterBase ChapterToProcess = new ChapterBase(ChapterIndex) { ChapterName = Entry.GetChapterText () };
			ChapterToProcess.InformationenAddOnLinkedWithThisChapter.Add(Entry);
			UsedChapterBase.Add(ChapterToProcess);
			JoinResourcesUsed();
			}
コード例 #12
0
ファイル: InformationenAddOn.cs プロジェクト: heinzsack/DEV
		private void DoTimingsDefault(String TimingTypID, int PreShowDays, InformationenAddOn SourceInfoAddOn)
			{
			DataModell.FillConnectedTableClasses(this, true, true);
			Timings Timing = (Timings)this.ConnectedTableClass;
			if (String.IsNullOrEmpty (Timing.TimingTypID))
				return;
			Timing.TimingTypID = TimingTypID;
			Timing.ConnectedType = "Informationen";
			Timing.ConnectedID = DataModell.ActiveInformationen.ID;
			if (SourceInfoAddOn.ConnectedTableClass == null)
				return;
			Timings SourceTiming = (Timings) SourceInfoAddOn.ConnectedTableClass;
			Timing.TimeB = (DateTime) SourceTiming.TimeB;
			Timing.TimeA = ((DateTime)Timing.TimeB).AddDays (PreShowDays).Date;
			if (Timing.TimeA < DateTime.Now)
				Timing.TimeA = DateTime.Now.Date;
			FreiText = Timing.GetFreitext (FreiTextFormat.Full);
			}
コード例 #13
0
ファイル: InformationenAddOn.cs プロジェクト: heinzsack/DEV
		private bool ProcessSingleEntryFilling (DefaultFillings Filling, Informationen Info,
						InformationenAddOn SourceInfoAddOn)
			{
			switch (Filling.ContentTypProperty)
				{
				case DefaultFillings.ContentTyp.BannerConnector:
					DoConnectorDefaults("Banner", "BannerData", "WPMediaAddOnDataConnectionString");
					break;
				case DefaultFillings.ContentTyp.StandBildConnector:
					DoConnectorDefaults("StandBild", "WohnParkInfo", "WPMediaAddOnDataConnectionString");
					break;
				case DefaultFillings.ContentTyp.BerichtConnector:
					DoConnectorDefaults("StandBild", "LiesingInfo", "WPMediaAddOnDataConnectionString");
					break;

				case DefaultFillings.ContentTyp.BannerTiming:
					DoTimingsDefault("BannerVonBis", -3, SourceInfoAddOn);
					break;
				case DefaultFillings.ContentTyp.StandBildTiming:
					DoTimingsDefault("AnzVonBis", -14, SourceInfoAddOn);
					break;
				case DefaultFillings.ContentTyp.BerichtStandBildTiming:
					DoTimingsDefault("AnzVonBis", -14, SourceInfoAddOn);
					break;

				case DefaultFillings.ContentTyp.EventTimings:
					DoEventTimingsDefault ("EventVonBis", 0);
					break;
				case DefaultFillings.ContentTyp.BerichtTimings:
					DoBerichtTimingsDefault ("AktivVonBis", 14);
					break;
				}
			return true;
			}
コード例 #14
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public InformationenAddOn UseOrInsertNewInformationenAddOn (String Tabelle, Guid? TabelleID,
			String FreiText, Guid DataDependencyID)
			{
			InformationenAddOn Entry = GetInformationenAddOn(Tabelle, DataDependencyID);
			if (Entry == null)
				{
				DataRow NewRow = WorkDataSet.Tables["InformationenAddOn"].NewRow();
				Entry = new InformationenAddOn(NewRow)
				{
					ParentInformationen = ActiveInformationen
				};
				NewRow ["ID"] = Entry.ID = Guid.NewGuid();
				Entry.DataDependencyID = DataDependencyID;
				NewRow["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper();
				WorkDataSet.Tables["InformationenAddOn"].Rows.Add(NewRow);
				ActiveInformationen.ConnectedInformationenAddOn.Add(Entry);
				}
			if (TabelleID != null)
				Entry.TabelleID = (Guid)TabelleID;
			Entry.Tabelle = Tabelle;
			Entry.FreiText = FreiText;
			Entry.SortOrder = FullDataDependencyCacheInstance.AvailableFullDataDependencies
								[DataDependencyID].SortOrder;
			Entry.ActuallBezeichner =
					FullDataDependencyCacheInstance.AvailableFullDataDependencies
						[DataDependencyID].ActuallBezeichner;
			Entry.DataDependencyID = DataDependencyID;
			Entry.InformationenID = ActiveInformationen.ID;
			Entry.DataDependencyID = DataDependencyID;
			Entry.ParentInformationen = ActiveInformationen;
			Entry.Parent = this;
			if (Entry.ConnectedTableClass == null)
				FillConnectedTableClasses( Entry, true, true);
			SendPropertyChanged("InformationAndInformationenAddOns");
			return Entry;
			}
コード例 #15
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public bool InsertOrUpdateNewMaterial(Guid InformationenID, Guid DataDependencyID, ref InformationenAddOn NewInfAddOn, ref Materialien NewMaterial,
											  MemoryStream MemoryStreamContentToStore, String NameOfTheContentToStore,
											  String TypOfTheContentToStore)
			{
			String SizeString = String.Empty;
			if (MemoryStreamContentToStore.Length < (1024 * 5))
				{
				SizeString = String.Format(" {0:D} Bytes ", MemoryStreamContentToStore.Length);
				}
			else
				{
				SizeString = String.Format(" {0:D} kB ", MemoryStreamContentToStore.Length / 1024);
				}

			String StringToStore = Basics.ConvertMemoryStreamToString(MemoryStreamContentToStore);
			if (StringToStore.Length > 3599)
				StringToStore = StringToStore.Substring(0, 3595) + " ...";
			String FreiText = "Typ = \"" + TypOfTheContentToStore + "\" - " + NameOfTheContentToStore
								   + "." + TypOfTheContentToStore + SizeString
								   + "\r\n" + StringToStore;
			NewInfAddOn = UseOrInsertNewInformationenAddOn ("Materialien", (Guid?) null, FreiText,
				DataDependencyEnums.RootFDDIDsForAVEvent.InformationenMaterialRoot); //	Guid.Parse("5998F56D-0CA6-4FF4-B768-80C308B37394"));
			Guid InformationenAddOnID = NewInfAddOn.ID;

			NewInfAddOn.LastModifiedBy = "Auto";
			if (NewInfAddOn.ConnectedTableClass == null)
				FillConnectedTableClasses(NewInfAddOn, true, true);
			NewMaterial = (Materialien)NewInfAddOn.ConnectedTableClass;
			NewMaterial.OriginalMaterialName = NameOfTheContentToStore;
			NewMaterial.InformationenID = ActiveInformationen.ID;
			NewMaterial.InformationenAddOnID = NewInfAddOn.ID;
			NewMaterial.NameID = NameOfTheContentToStore;
			NewMaterial.Typ = TypOfTheContentToStore;

			CacheStoreMaterialBlobContentDataBaseCommand(NewMaterial, NameOfTheContentToStore,
											 MemoryStreamContentToStore, TypOfTheContentToStore);

			return true;
			}
コード例 #16
0
ファイル: ContentModellFactory.cs プロジェクト: heinzsack/DEV
		public Window InformationenAddOnUpdateStart (InformationenAddOn ActiveInformationenAddOn,
			out UpdateOneAddOnModell UpdateOneAddOnModellInstance, Object Sender, RoutedEventArgs E)
			{
			AltErlaaInfoUpdateOneAddOnControl AddOnCont = new AltErlaaInfoUpdateOneAddOnControl ();
			UpdateOneAddOnModellInstance = AddOnCont.UpdateOneAddOnModellInstance = new UpdateOneAddOnModell();
			UpdateOneAddOnModellInstance.ActiveInformationenAddOn = ActiveInformationenAddOn;

			AddOnCont.UpdateOneAddOnModellInstance.ActiveInformationenAddOn = ActiveInformationenAddOn;
			AddOnCont.UpdateOneAddOnModellInstance.EditorModellsForAddOn = new DataCollection<object> ();
			Window AltErlaaInfoAddOnUpdateInformationenWindow = new Window();
			Grid RootGrid = new Grid ();
			AltErlaaInfoAddOnUpdateInformationenWindow.Content = RootGrid;
			RootGrid.Children.Add (AddOnCont);

			if ((ActiveInformationenAddOn.TableSelectionAllowed != null)
				&& ((bool)ActiveInformationenAddOn.TableSelectionAllowed == true))
				{
				AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance
					= new UpdateOneAddOnModell.EditorForTableSelectionModell();
				if (ActiveInformationenAddOn.Tabelle == "Adressen")
					AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance
						.IsAdresseVisibility = Visibility.Visible;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance
					.ActiveInformationenAddOn = ActiveInformationenAddOn;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance
						.CloseRequestedCall += EditorInstance_CloseRequestedCall;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance
						.ParentWindow = AltErlaaInfoAddOnUpdateInformationenWindow;
				AddOnCont.UpdateOneAddOnModellInstance.EditorModellsForAddOn.Add
					(AddOnCont.UpdateOneAddOnModellInstance.EditorForTableSelectionModellInstance);
				}

			if ((ActiveInformationenAddOn.ControlProcessingAllowed != null)
				&& ((bool)ActiveInformationenAddOn.ControlProcessingAllowed == true))
				{
                if (ActiveInformationenAddOn.Tabelle.Contains(("Full")))
                    ActiveInformationenAddOn.Tabelle = ActiveInformationenAddOn.Tabelle.Replace( "Full", "");
                RootModellForTableInput BasicModellObject = (RootModellForTableInput) CreateTypeCorrectModell(ActiveInformationenAddOn);
				Debug.Assert(BasicModellObject != null, "Keine Handlerklasse definiert für \""
					+ ActiveInformationenAddOn.Tabelle + "\"");
				if (BasicModellObject.GetType () == typeof (EditorForProcessConnectorTableModell))
					((EditorForProcessConnectorTableModell)BasicModellObject).ConnectionDataModellInstance
						= new ConnectionDataModell ();
				BasicModellObject.ActiveInformationenAddOn = ActiveInformationenAddOn;
				BasicModellObject.UpdateOneAddOnModellInstance = UpdateOneAddOnModellInstance;
				AddOnCont.UpdateOneAddOnModellInstance.EditorModellsForAddOn.Add
					(BasicModellObject);
				//AddOnCont.UpdateOneAddOnModellInstance.GetRootModellForTableInputForInfoAddOn ().AddOnInputSource
				//	= DataWrapper.InfoAddOnInputSource.NothingInputed;
				}

			//if ((ActiveInformationenAddOn.TextOnlyAllowed != null)
			//	&& ((bool)ActiveInformationenAddOn.TextOnlyAllowed == true))
			//	{
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance
					= new UpdateOneAddOnModell.EditorForFreeTextputModell();
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance.UpdateOneAddOnModellInstance =
					UpdateOneAddOnModellInstance;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance
					.ActiveInformationenAddOn = ActiveInformationenAddOn;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance
						.CloseRequestedCall += EditorInstance_CloseRequestedCall;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance
						.ParentWindow = AltErlaaInfoAddOnUpdateInformationenWindow;
				AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance
					.ActiveInformationenAddOn = ActiveInformationenAddOn;
				AddOnCont.UpdateOneAddOnModellInstance.EditorModellsForAddOn.Add
					(AddOnCont.UpdateOneAddOnModellInstance.EditorForFreeTextputModellInstance);
				//}


			//AltErlaaInfoAddOnUpdateInformationenWindow.SizeToContent = SizeToContent.WidthAndHeight;
			AltErlaaInfoAddOnUpdateInformationenWindow.Width = 800;
			AltErlaaInfoAddOnUpdateInformationenWindow.Height = 600;
			AltErlaaInfoAddOnUpdateInformationenWindow.Closed += (O, Args) =>
				{
				AddOnCont.Close();
				};
			//AltErlaaInfoAddOnUpdateInformationenWindow.Closing += (O, Args) =>
			//	{
			//	AddOnCont.Close();
			//	};
			AltErlaaInfoAddOnUpdateInformationenWindow.Title = "Neuanlage/Änderung eines " + ActiveInformationenAddOn.ActuallBezeichner + " Eintrages";
			return AltErlaaInfoAddOnUpdateInformationenWindow;
			}
コード例 #17
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public void FillConnectedTableClasses (InformationenAddOn InfoAddOn,
			bool RemoteReloadForEmptyEntries = false,
			bool CreateIfNotDefined = false)
			{
			String IDName = "ID";
			if (InfoAddOn.Tabelle == "Timings")
				IDName = "TimingsID";
			if (InfoAddOn.ConnectedTableClass != null)
				{
				if (IDName == "ID")
					InfoAddOn.TabelleID = ((RootDataClass) InfoAddOn.ConnectedTableClass).ID;
				else
					InfoAddOn.TabelleID = ((Timings) InfoAddOn.ConnectedTableClass).TimingsID;
				((RootDataClass) InfoAddOn.ConnectedTableClass).BackLinkInformationenAddOn = InfoAddOn;
				return;
				}

			DataRow PreloadedRow = DBEntryExits (InfoAddOn.Tabelle, InfoAddOn.TabelleID);
			if (PreloadedRow != null)
				{
				Object [] CtorParameter = new Object [] {PreloadedRow};
				InfoAddOn.ConnectedTableClass = (RootDataClass) Activator.CreateInstance (GetTypeToCreate (InfoAddOn.Tabelle),
					CtorParameter);
				((RootDataClass) InfoAddOn.ConnectedTableClass).BackLinkInformationenAddOn = InfoAddOn;
				return;
				}

			if (((InfoAddOn.TabelleID != null)
			    && (InfoAddOn.TabelleID != Guid.Empty))
			    && (RemoteReloadForEmptyEntries == true))
				{
				List<String> TablesToComplete = new List<string> ();
				List<String> SelectStatements = new List<String> ();

				// check for non existing TableID
				Guid Result;
				if (Guid.TryParse (InfoAddOn.TabelleID.ToString (), out Result))
					SelectStatements.Add ("Select" + CorrectItemList [InfoAddOn.Tabelle]
											+ "from " + InfoAddOn.Tabelle + " where "
											+ IDName + " = '" + InfoAddOn.TabelleID.ToString () + "'");
				else
					SelectStatements.Add ("Select" + CorrectItemList [InfoAddOn.Tabelle]
											+ "from " + InfoAddOn.Tabelle + " where "
											+ Basics.GetSQLFormattedGUIDPhrase (null, IDName));
				TablesToComplete.Add (InfoAddOn.Tabelle);

				// Try to reload from Persistent store, if missing Table Entries
				if (SelectStatements.Count > 0)
					{
					DataSet ExpandedCatalougeDataSet =
						BasicAccess.AltErlaaInfoDataBase.GetCommonMultiDataSet (SelectStatements.ToArray ());
					WMB.Basics.MergeDataSetIntoDataSet (WorkDataSet, ExpandedCatalougeDataSet);
					}
				}

			if (((InfoAddOn.TabelleID == null)
					|| (InfoAddOn.TabelleID == Guid.Empty))
					&& (CreateIfNotDefined == true))
				{
				if (WorkDataSet.Tables [InfoAddOn.Tabelle] == null)
					AddTableToDataSet (WorkDataSet, InfoAddOn.Tabelle);

				if (InfoAddOn.Tabelle == "Timings")
					{
					DataRow NewTimingRow = WorkDataSet.Tables[InfoAddOn.Tabelle].NewRow();
					InfoAddOn.TabelleID = Guid.NewGuid();
					NewTimingRow["TimingsID"] = InfoAddOn.TabelleID;
					NewTimingRow["TimingTypID"] = "VonBis";
					NewTimingRow["TimeA"] = DateTime.MinValue;
					NewTimingRow["TimeB"] = DateTime.MaxValue;
					FillDefaultTimingValuesAccordingToInfoAddOn(NewTimingRow, InfoAddOn);
					NewTimingRow["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper();
					WorkDataSet.Tables[InfoAddOn.Tabelle].Rows.Add(NewTimingRow);
					}
				else
					{
					DataRow NewEmptyRow = WorkDataSet.Tables[InfoAddOn.Tabelle].NewRow();
					InfoAddOn.TabelleID = Guid.NewGuid();
					NewEmptyRow["ID"] = InfoAddOn.TabelleID;
					if (DataSetForEmptyTables.Tables[InfoAddOn.Tabelle].Columns.Contains("LastUpdateToken"))
						NewEmptyRow["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper();
					if (DataSetForEmptyTables.Tables[InfoAddOn.Tabelle].Columns.Contains("ROWID"))
						NewEmptyRow["ROWID"] = InfoAddOn.TabelleID;
					WorkDataSet.Tables[InfoAddOn.Tabelle].Rows.Add(NewEmptyRow);
					}
				}
			if (WorkDataSet.Tables[InfoAddOn.Tabelle] != null)
				{
				try
					{
					DataRow[] Entries = WorkDataSet.Tables[InfoAddOn.Tabelle]
						.Select(String.Format("{0} = '{1}'", IDName, InfoAddOn.TabelleID.ToString()));
					if (Entries.Length == 1)
						{
						Object[] CtorParameter = new Object[] { Entries[0] };
						InfoAddOn.ConnectedTableClass = Activator.CreateInstance(GetTypeToCreate(InfoAddOn.Tabelle),
							CtorParameter);
						((RootDataClass)InfoAddOn.ConnectedTableClass).BackLinkInformationenAddOn = InfoAddOn;
						}

					}
				catch (Exception Excp)
					{
					WMB.Basics.ReportErrorToEventViewer($"InfoAddOn {InfoAddOn.InformationenID}, " +
					                                    $"TableID = {InfoAddOn.ActuallBezeichner}");
					}
				}



			}
コード例 #18
0
ファイル: ContentModellFactory.cs プロジェクト: heinzsack/DEV
		public void DeleteEntry (InformationenAddOn ToDeleteInformationenAddOn)
			{
			ToDeleteInformationenAddOn.BasisRow.Delete ();
			DataModell.InformationAndInformationenAddOns.Remove(ToDeleteInformationenAddOn);
			DataModell.ActiveInformationen.ConnectedInformationenAddOn.Remove(ToDeleteInformationenAddOn);
			DataModell.SendPropertyChanged("InformationAndInformationenAddOns");
			}
コード例 #19
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		private void FillDefaultTimingValuesAccordingToInfoAddOn(DataRow NewTimingRow,
						InformationenAddOn InfoAddOn)
			{
			if (InfoAddOn.ActuallBezeichner == "Termin")
				{
				NewTimingRow["ConnectedID"] = ActiveInformationen.ID;
				NewTimingRow["TimingTypID"] = "EventVonBis";
				NewTimingRow["TimeA"] = DateTime.Now;
				NewTimingRow["TimeB"] = DateTime.Now.AddDays(14);
				}
			if (InfoAddOn.ActuallBezeichner == "Timings")
				{
				NewTimingRow["ConnectedID"] = ActiveInformationen.ID;
				NewTimingRow["TimingTypID"] = "AnzVonBis";
				NewTimingRow["TimeA"] = DateTime.Now;
				NewTimingRow["TimeB"] = DateTime.Now.AddDays(14);
				}
			if (InfoAddOn.ActuallBezeichner == "AktivZeitVonBis")
				{
				NewTimingRow["ConnectedID"] = ActiveInformationen.ID;
				NewTimingRow["TimingTypID"] = "AktivVonBis";
				NewTimingRow["TimeA"] = DateTime.Now;
				NewTimingRow["TimeB"] = DateTime.Now.AddDays(14);
				}
			}
コード例 #20
0
ファイル: UpdateOneAddOnModell.cs プロジェクト: heinzsack/DEV
			private DataCollection<SelectionDataClass> LoadAvailableTableData(String TableName,
				InformationenAddOn InfoAddOnParameter,
				AuswahlSelection Auswahl,
				AuswahlSortOrder SortBy)
				{

				DataCollection<SelectionDataClass> Result = GetSelectionData(new List<String> (){"AltErlaa", "AEAG"},
					WMB.WPMediaApplicationState.Instance.Properties["UserName"].ToString(), InfoAddOnParameter,
					Guid.Empty, Auswahl, SortBy);
				TableDataCounter = Result.Count;
				_tableSelectionHeader = null;
				SendPropertyChanged("TableSelectionHeader");
				return Result;
				}
コード例 #21
0
ファイル: DataWrapper.cs プロジェクト: heinzsack/DEV
		public void CreateInformationenAddOnForNewInformation()
			{
			if (ActiveInformationen.ConnectedInformationenAddOn.Count > 1)
				return;
			DataTable InformationenAddOnTable = ActiveInformationen.BasisRow.Table.DataSet.Tables["InformationenAddOn"];
			Profile.ActiveTyp = Profile.SetActiveTypViaId((Guid) ActiveInformationen.TypID);
			//foreach (DataTemplatesDescription Desc in DataTemplatesDescriptionCacheInstance
			//				.AvailableDataTemplatesDescriptionsForTyp[(Guid)ActiveInformationen.TypID])
			foreach (FullDataDependency Desc in FullDataDependencyCacheInstance
							.AvailableFullDataDependencyForTyp[(Guid)ActiveInformationen.TypID])
					{
				if (Desc.TabellenName == "Informationen")
					continue;
				DataRow NewRow = InformationenAddOnTable.NewRow ();
				NewRow ["ID"] = Guid.NewGuid ();
				NewRow ["InformationenID"] = ActiveInformationen.ID;
				NewRow ["ActuallBezeichner"] = Desc.ActuallBezeichner;
				NewRow ["Tabelle"] = Desc.TabellenName;
				NewRow ["SortOrder"] = Desc.SortOrder;
				NewRow ["DataDependencyID"] = Desc.ID;
				NewRow ["CreatedBy"] = WMB.WPMediaApplicationState.Instance.Properties ["UserName"].ToString ().ToUpper ();
				NewRow ["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper ();
				InformationenAddOnTable.Rows.Add (NewRow);
				InformationenAddOn InfoAddOn = new InformationenAddOn (NewRow)
					{
					ParentInformationen = ActiveInformationen,
					//ParentDataModell = UpdateDataModellInstance,
					Parent = this
					};
				FillConnectedTableClasses (InfoAddOn, true, false);
				ActiveInformationen.ConnectedInformationenAddOn.Add (InfoAddOn);
				}
			InformationAndInformationenAddOns = new DataCollection<object>(ActiveInformationen.ConnectedInformationenAddOn);
			InformationAndInformationenAddOns.Insert(0, ActiveInformationen);
			}
コード例 #22
0
ファイル: UpdateOneAddOnModell.cs プロジェクト: heinzsack/DEV
			private SelectionDataClass GetSelectionDataContent(DataRow SearchData,
						InformationenAddOn ParentParameter)
				{
				SelectionDataClass Result = new SelectionDataClass(SearchData)
				{
					Parent = ParentParameter,
					KatalogTableName = SearchData.Table.TableName,
					KatalogTableID = (Guid)SearchData["ID"]
				};
				List<String> Auswahl = new List<string>();
				foreach (String SelectItem in ItemsToSelectForSelection)
					{
					if (SelectItem == "ID")
						continue;
					if (SearchData[SelectItem] != Convert.DBNull)
						Auswahl.Add(SearchData[SelectItem].ToString());
					}
				List<String> Hinweis = new List<string>();
				foreach (String HinweisItem in ItemsToFillHinweisColumn)
					{
					if (HinweisItem == "ID")
						continue;
					if (SearchData[HinweisItem] != Convert.DBNull)
						Hinweis.Add(SearchData[HinweisItem].ToString());
					}
				Result.ZurAuswahl = String.Join(", ", Auswahl);
				Result.Hinweis = String.Join(", ", Hinweis);
				return Result;
				}
コード例 #23
0
		public Section GetPresentationSection(InformationenAddOn InfoAddOn)
			{
			if ((InfoAddOn.TabelleID == null)
				|| (InfoAddOn.TabelleID == System.Guid.Empty))
				{
				Paragraph SimpleFreitext = new Paragraph(new Run(InfoAddOn.FreiText));
				SimpleFreitext.Margin = new Thickness(0);
				Section SimpleResult = new Section();
				SimpleResult.Blocks.Add(SimpleFreitext);
				return SimpleResult;
				}
			Paragraph Unformatted = new Paragraph(new Run(InfoAddOn.FreiText));
			Unformatted.Margin = new Thickness(0);
			Section Result = new Section();
			Result.Blocks.Add(Unformatted);
			return Result;
			}