Exemplo n.º 1
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;
			}
Exemplo n.º 2
0
		public System.Guid  InsertOrModifyAddOn (System.Guid ID, System.Guid InformationenID,
			System.Guid TabelleID, DataTemplatesDescription Desc, String FreiText, bool MultipleEntriesAllowed)
			{
			return TemplateManagement.InsertOrModifyInformationenAddOn (ID, InformationenID, TableName,
																TabelleID, Desc, FreiText, MultipleEntriesAllowed);
			}
Exemplo n.º 3
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;
			}