public static CommonSelectionControl CreateSelectionControl (InformationenAddOn InfoAddOn,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			CommonSelectionControl SelectionControl = new CommonSelectionControl ();
			SelectionControl.InfoAddOn = InfoAddOn;
			SelectionControl.ConnectedTemplateElementManagement = ConnectedTemplateElementManagement;
			if (SelectionControl.Create (EntriesToShow, SortOrder) == false)
				return null;
			return SelectionControl;
			}
示例#2
0
		public String GetSelectionText (InformationenAddOn InfAddOn)
			{
			return InfAddOn.FreiText;
			}
示例#3
0
		public bool DoShow (InformationenAddOn InfoAddOnParameter)
			{
			InfoAddOn = InfoAddOnParameter;
			if (InfoAddOn.TabelleID == null)
				return false;
			return FillMe ((System.Guid) InfoAddOn.TabelleID, false);
			}
示例#4
0
		public bool DoEdit (InformationenAddOn InfoAddOnParameter)
			{
			InfoAddOn = InfoAddOnParameter;
			if ((InfoAddOn.TabelleID == null)
				|| (InfoAddOn.TabelleID == System.Guid.Empty))
				{
				if (InfoAddOn.ActuallBezeichner == "Termin")
					{
					WorkingTimings = (Timings) GetEmptyEntity ();
					WorkingTimings.TimingsID = System.Guid.Empty;
					WorkingTimings.TimingTypID = "EventVonBis";
					WorkingTimings.ConnectedType = "Informationen"; 
					WorkingTimings.ConnectedID = InfoAddOn.InformationenID;
					WorkingTimings.TimingsID = System.Guid.NewGuid ();
					InfoAddOn.TabelleID = WorkingTimings.TimingsID;
					}
				if (InfoAddOn.ActuallBezeichner == "AktivZeitVonBis")
					{
					WorkingTimings = (Timings) GetEmptyEntity ();
					WorkingTimings.TimingsID = System.Guid.Empty;
					WorkingTimings.TimingTypID = "AktivVonBis";
					WorkingTimings.ConnectedType = "Informationen";
					WorkingTimings.ConnectedID = InfoAddOn.InformationenID;
					WorkingTimings.TimingsID = System.Guid.NewGuid ();
					InfoAddOn.TabelleID = WorkingTimings.TimingsID;
					}
				}
			return FillMe ((System.Guid) InfoAddOn.TabelleID, true);
			}
示例#5
0
		public bool DoEdit (InformationenAddOn InfoAddOnParameter)
			{
			InfoAddOn = InfoAddOnParameter;
			return FillMe ((System.Guid) InfoAddOn.TabelleID, true);
			}
/*
		public Size GetControlSize ()
			{
			return new Size (this.MaxWidth, this.MaxHeight);
			}

		public bool DoEdit (System.Guid ID)
			{
			return FillMe (ID, true);
			}

		public bool DoShow (System.Guid ID)
			{
			return FillMe (ID, false);
			}

		public bool DoEdit (AltErlaaInfo.ODataReference.InformationenAddOn InfoAddOn)
			{
			return false;
			}

		public bool DoShow (AltErlaaInfo.ODataReference.InformationenAddOn InfoAddOn)
			{
			return false;
			}
*/
		public bool DoEdit (InformationenAddOn InfoAddOnParameter)
			{
			InfoAddOn = InfoAddOnParameter;
			if ((InfoAddOn.TabelleID == null)
				|| (InfoAddOn.TabelleID == System.Guid.Empty))
				{
				if (InfoAddOn.ActuallBezeichner.IndexOf( "MultiMedia") != -1)
					{
					WorkingProcessConnector = (ProcessConnector) GetEmptyEntity ();
					WorkingProcessConnector.InformationenID = InfoAddOn.InformationenID;
					WorkingProcessConnector.InformationenAddOnID = InfoAddOnParameter.ID;
					WorkingProcessConnector.ID = System.Guid.NewGuid ();
					InfoAddOn.TabelleID = WorkingProcessConnector.ID;
					WorkingProcessConnector.NameID = WMB.Basics.ConvertToCorrectFileNameElement
						(ConnectedTemplateElementManagement.ParentTemplateRuntime.GetActuallInformation.Titel);
					}
				}
			return FillMe ((System.Guid) InfoAddOn.TabelleID, true);
			}
		private List<SelectionDataClass> LoadMyOrUsedSelectionData (InformationenAddOn InfoAddOn, String BereichToUse, 
			TemplateManagement.AuswahlSelection EntriesToShow, TemplateManagement.AuswahlSortOrder SortOrder)
			{
			String SelectClause = String.Empty;
				SelectClause = TemplateManagement.GetMyOrUsedUnifiedTableIDsSelectClause (InfoAddOn, EntriesToShow);
			
			if (String.IsNullOrEmpty (SelectClause))
				return new List<SelectionDataClass> ();
			WCFStandards DataAccess = new WCFStandards ();
			DataSet ResultDataSet = null;
			if (SortOrder == TemplateManagement.AuswahlSortOrder.Alphabetic)
				ResultDataSet = DataAccess.GetCommonDataSet ("Select " + String.Join (", ", ItemsToSelectForSelection)
								+ " from " + ViewNameForSelection + " where ( " 
								+ TemplateManagement.GetWhereClauseFromBereich (BereichToUse) + " ) and "
								+ SelectClause + " order by " + String.Join (", ", SortingItemsForSelection));
			else
				ResultDataSet = DataAccess.GetCommonDataSet ("Select " + String.Join (", ", ItemsToSelectForSelection)
								+ " from " + ViewNameForSelection + " where ( " 
								+ TemplateManagement.GetWhereClauseFromBereich (BereichToUse) + " ) and "
								+ SelectClause );
			return GetSelectionDataFormatting (ResultDataSet.Tables [ViewNameForSelection]);
			}
示例#8
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;
			}
示例#9
0
		public static Guid InsertOrModifyInformationenAddOn (Guid ID, Guid InformationenID, String TabellenName,
			 Guid TabelleID, DataTemplatesDescription Desc, String FreiText, bool MultipleEntriesAllowed)
			{
			AltErlaaInfoEntities WebAccess = new AltErlaaInfoEntities ();
			InformationenAddOn InfoAO = null;
			IQueryable<InformationenAddOn> OldEntries = from ExistingINF in WebAccess.InformationenAddOn
															where ExistingINF.InformationenID == InformationenID
																  && ExistingINF.DataDependencyID == Desc.ID
															select ExistingINF;
			int ExistingCounter = OldEntries.Count ();
			if (MultipleEntriesAllowed == false)
				{
				InfoAO = OldEntries.First ();
				ID = InfoAO.ID;
				}

			if (ID != Guid.Empty)
				{
				try
					{
					InfoAO.InformationenID = InformationenID;
					InfoAO.Tabelle = TabellenName;
					InfoAO.TabelleID = TabelleID;
					InfoAO.ActuallBezeichner = Desc.ActuallBezeichner;
					if (InfoAO.SortOrder == null)
						{
						if (MultipleEntriesAllowed)
							InfoAO.SortOrder = Desc.SortOrder + ExistingCounter;
						else
							InfoAO.SortOrder = Desc.SortOrder;
						}
					InfoAO.DataDependencyID = Desc.ID;
					InfoAO.FreiText = FreiText;
					InsertOrModifyEntity (null, InfoAO);
					return ID;
					}
				catch (Exception Excp)
					{
					Basics.ReportErrorToEventViewer ("TemplateManagement.InsertOrModifyInformationenAddOn",
							"Fehler bei UpdateObject von ID \"" + ID.ToString () + "\":\r\n"
							+ Excp.ToString());

					}
				}
			else
				{
				try
					{
					InfoAO = new InformationenAddOn ();
					InfoAO.InformationenID = InformationenID;
					InfoAO.Tabelle = TabellenName;
					InfoAO.TabelleID = TabelleID;
					InfoAO.ActuallBezeichner = Desc.ActuallBezeichner;
					if (InfoAO.SortOrder == null)
						{
						if (MultipleEntriesAllowed)
							InfoAO.SortOrder = Desc.SortOrder + ExistingCounter;
						else
							InfoAO.SortOrder = Desc.SortOrder;
						}
					InfoAO.DataDependencyID = Desc.ID;
					InfoAO.FreiText = FreiText;
					InsertOrModifyEntity (null, InfoAO);
					return InfoAO.ID;
					}
				catch (Exception Excp)
					{
					Basics.ReportErrorToEventViewer ("TemplateManagement.InsertOrModifyInformationenAddOn",
							"Fehler bei AddObject von ID \"" + ID.ToString () + "\":\r\n"
							+ Excp.ToString());
					}
				}
			return Guid.Empty;
			}
示例#10
0
		public static List<SelectionDataClass> ReorderSelectionData (InformationenAddOn InfoAddOn, List<SelectionDataClass> UnorderedSelectionData)
			{
			WCFStandards DataAccess = new WCFStandards ();
			DataSet MyUsedEntries = DataAccess.GetCommonDataSet (String.Format (OCCURENCY_SQL_COMMAND,
				   InfoAddOn.ActuallBezeichner, InfoAddOn.Tabelle, String.Empty, CurrentUserName));
			DataSet AllUsedEntries = DataAccess.GetCommonDataSet (String.Format (OCCURENCY_SQL_COMMAND,
				   InfoAddOn.ActuallBezeichner, InfoAddOn.Tabelle, "NOT", CurrentUserName));
			return FillReorderedSelectionDataClass (UnorderedSelectionData, CombineIDEntries
				(MyUsedEntries.Tables ["InformationenAddOn"], AllUsedEntries.Tables ["InformationenAddOn"]));
			}
示例#11
0
		public static String GetMyOrUsedUnifiedTableIDsSelectClause (InformationenAddOn InfoAddOn, AuswahlSelection EntriesToShow)
			{
			WCFStandards DataAccess = new WCFStandards ();
			String WhereClause = String.Empty;
			if (EntriesToShow == AuswahlSelection.My)
				{
				DataSet MyInformationenIDs =
					DataAccess.GetCommonDataSet ("Select ID from Informationen where CreatedBy ='" + CurrentUserName
												 + "' or LastModifiedBy = '" + CurrentUserName + "'");
				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 = DataAccess.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 ()) + "') ";
			}
示例#12
0
		public static 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 ()) + "') ";

			}
示例#13
0
		public static bool InsertNewMaterial(Guid InformationenID, 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);
				}
			Guid InformationenAddOnID = Guid.NewGuid ();
			Guid MaterialienID = Guid.NewGuid ();

			NewInfAddOn = new InformationenAddOn();
			NewInfAddOn.ID = InformationenAddOnID;
			NewInfAddOn.InformationenID = InformationenID;
			NewInfAddOn.Tabelle = "Materialien";
			NewInfAddOn.TabelleID = MaterialienID;
			NewInfAddOn.ActuallBezeichner = "InformationenMaterial";
			String StringToStore = WMB.Basics.ConvertMemoryStreamToString(MemoryStreamContentToStore);
			if (StringToStore.Length > 3999)
				StringToStore = StringToStore.Substring (0, 3995) + " ...";
			NewInfAddOn.FreiText = "Typ = \"" + TypOfTheContentToStore + "\" - " + NameOfTheContentToStore
			                       + "." + TypOfTheContentToStore + SizeString
			                       + "\r\n" + StringToStore;
			NewInfAddOn.SortOrder = 45000;
//			NewInfAddOn.DataDependencyID = Guid.Parse("D8C2E698-4C62-4AA4-A2B2-919E6BB415C8");
			NewInfAddOn.DataDependencyID = Guid.Parse("5998F56D-0CA6-4FF4-B768-80C308B37394");
			NewInfAddOn.LastModifiedBy = "Auto";

			InsertOrModifyEntity (null, NewInfAddOn, true);

			NewMaterial = new Materialien ();
			NewMaterial.ID = MaterialienID;
			NewMaterial.NameID = NameOfTheContentToStore;
			NewMaterial.InformationenID = InformationenID;
			NewMaterial.InformationenAddOnID = InformationenAddOnID;
			NewMaterial.Typ = TypOfTheContentToStore;
			NewMaterial.OriginalMaterialName = NameOfTheContentToStore;

			InsertOrModifyEntity(null, NewMaterial, true);

			CheckOrStoreMaterialBlobContent(NewMaterial, NameOfTheContentToStore,
			                                 MemoryStreamContentToStore, TypOfTheContentToStore);

			return true;
			}
示例#14
0
		public static bool InsertNewMaterial(Guid InformationenID, ref InformationenAddOn InfoAddOnID, ref Materialien Material,
											  String ContentToStore, String NameOfTheContentToStore,
											  String TypOfTheContentToStore)
			{
			return InsertNewMaterial(InformationenID, ref InfoAddOnID, ref Material,
			                          WMB.Basics.ConvertStringToMemoryStream (ContentToStore), NameOfTheContentToStore,
			                          TypOfTheContentToStore);
			}
示例#15
0
		public static Guid? GetTypIDForInfoAddOn (InformationenAddOn InfoAddOn)
			{
			return GetTypIDForInfoAddOn (InfoAddOn.InformationenID);
			}
示例#16
0
		public List<SelectionDataClass> GetSelectionData (String BereichToUse, String ActiveUser, InformationenAddOn InfoAddOnParameter,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			AltErlaaInfoEntities WebAccess = new AltErlaaInfoEntities ();
			IQueryable<Timings> TimingsDaten = from Tim in WebAccess.Timings
											   where Tim.ConnectedID == InfoAddOnParameter.InformationenID
												orderby Tim.TimeA descending 
												select Tim;

			List<SelectionDataClass> Result = new List<SelectionDataClass> ();
			foreach (Timings SelectionEntry in TimingsDaten)
				{
				SelectionDataClass SelectionData = new SelectionDataClass ();
				SelectionData.ID = SelectionEntry.TimingsID;
				SelectionData.ZurAuswahl = FormatFreitext (SelectionEntry, FreiTextFormat.Full);
				Result.Add (SelectionData);
				}
			return Result;
			}
示例#17
0
		public void SetParentInstances (ITemplateElementeBackgroundFunctions ConnectedTemplateElementManagementParam,
										InformationenAddOn InfoAddOnParam)
			{
			if (ConnectedTemplateElementManagementParam != null)
				ConnectedTemplateElementManagement = ConnectedTemplateElementManagementParam as TemplateElementManagement;
			if (InfoAddOnParam != null)
				InfoAddOn = InfoAddOnParam;
			}
示例#18
0
		public static InformationenAddOn GetInformationAddOnForRootEntry (Informationen Info, DataTemplatesDescription Desc)
			{
			InformationenAddOn InfoAddOnHelp = new InformationenAddOn ();
			InfoAddOnHelp.ActuallBezeichner = "Ereignis";
			InfoAddOnHelp.Tabelle = "Informationen";
			InfoAddOnHelp.InformationenID = Info.ID;
			InfoAddOnHelp.TabelleID = Info.ID;
			InfoAddOnHelp.Parent_Additional = Info;
			InfoAddOnHelp.FreiText = GetInterface ["Informationen"]. GetFreitext (Info, FreiTextFormat.Full);
			return InfoAddOnHelp;
			}
		public List<SelectionDataClass> GetSelectionData(String BereichToUse, String ActiveUser, InformationenAddOn InfoAddOnParameter,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			SortingItemsForSelection =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetSortingItemsForSelection ();
			ItemsToSelectForSelection = 
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetItemsToSelectForSelection ();
			ViewNameForSelection =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetViewNameForSelection ();
			ItemsToFillHinweisColumn =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetItemsToFillHinweisColumn ();

			if ((SortingItemsForSelection.Length == 0)
				&& (ItemsToSelectForSelection.Length == 0)
				&& (ItemsToFillHinweisColumn.Length == 0)
				&& (String.IsNullOrEmpty (ViewNameForSelection)))
				return null;
			switch (EntriesToShow)
				{
				case TemplateManagement.AuswahlSelection.AllFromType:
					{
					return LoadTypeSelectionData (InfoAddOnParameter, BereichToUse,
						ConnectedTemplateElementManagement.ParentTemplateRuntime.TypID, EntriesToShow, SortOrder);
					}
					break;
				case TemplateManagement.AuswahlSelection.Used:
				case TemplateManagement.AuswahlSelection.My:
					{
					return LoadMyOrUsedSelectionData (InfoAddOnParameter, BereichToUse, EntriesToShow, SortOrder);
					}
					break;
				case TemplateManagement.AuswahlSelection.All:
					{
					return LoadAllSelectionData (InfoAddOnParameter, BereichToUse);
					}
					break;
				}
			return null;

			}
示例#20
0
		public String GetSelectionText (InformationenAddOn InfAddOn)
			{
			return String.Empty;
			}
		private List<SelectionDataClass> LoadAllSelectionData(InformationenAddOn InfoAddOnParameter, String BereichToUse)
			{

			if (TemplateManagement.TableSelectionCache.ContainsKey (ViewNameForSelection) == false)
				{
				WCFStandardsNS.WCFStandards DataAccess = new WCFStandardsNS.WCFStandards ();
				DataSet PersonenDataSet = DataAccess.GetCommonDataSet ("Select " + String.Join (", ", ItemsToSelectForSelection)
								+ " from " + ViewNameForSelection + " where (" + TemplateManagement.GetWhereClauseFromBereich (BereichToUse)
								+ " ) order by " + String.Join (", ", SortingItemsForSelection));
				List<SelectionDataClass> PersistentResult = GetSelectionDataFormatting (PersonenDataSet.Tables [ViewNameForSelection]);
				TemplateManagement.TableSelectionCache.Add (ViewNameForSelection, PersistentResult);
				}
			List<SelectionDataClass> Result = new List<SelectionDataClass>();
			Result.AddRange (TemplateManagement.TableSelectionCache [ViewNameForSelection]);
			return Result;

			}
示例#22
0
		public void SaveOriginalInfoAddOn ()
			{
			Type TargetType = InfoAddOn.GetType ();
			CachedOriginalInfoAddOn = new InformationenAddOn ();
			foreach (PropertyInfo Prop in TargetType.GetProperties ())
				{
				if ((Prop.IsSpecialName == true)
				    || (Prop.Name.IndexOf ("NM_") == 0))
					continue;
				Prop.SetValue (CachedOriginalInfoAddOn, Prop.GetValue (InfoAddOn, null), null);
				}
			}