Пример #1
0
		public CreateDataForLeisureDisplay ()
			{
			WPMediaAddOnDataAccess= new WCFStandards (); 
			WPMediaAddOnDataAccess.DefaultConnectionStringName = "WPMediaAddOnDataConnectionString";
			AEAGDataAccess = new WCFStandards ();
			AEAGDataAccess.DefaultConnectionStringName = "AEAGConnectionString";
			}
Пример #2
0
		public static List<String> GetMaterialElementeForThisInformation (String InformationenID)
			{
			WCFStandards Helper = new WCFStandards ();
			DataTable MaterialTable = Helper.GetCommonDataSet ("Select TechnicalAddOn from InformationenAddOn where InformationenID = '"
					+ InformationenID + "' and TechnicalAddOn > ' '").Tables ["InformationenAddOn"];
			List<String> PictureElementeForThisInformation = new List<String> ();
			foreach (DataRow PictureElementRow in MaterialTable.Rows)
				{
				String [] SingleTechnicalAddOn = PictureElementRow ["TechnicalAddOn"].ToString ().Split (';');
				foreach (String Entry in SingleTechnicalAddOn)
					PictureElementeForThisInformation.Add (Entry.Trim ( ));
				}
			return PictureElementeForThisInformation;
			}
Пример #3
0
		public Object CheckAndGetInstatiatedPackage
			(WCFStandards m_DataBase , String TableToProcess , String SelectedID )
			{
			Paketieren.PackagingHandler Pkg;
			DataSet ActuallRowDataSet = m_DataBase.GetCommonDataSet ("Select * from "
			              + TableToProcess + " where ID = '" + SelectedID + "'");
			if ((ActuallRowDataSet.Tables.Count != 1)
			    || (ActuallRowDataSet.Tables [0].Rows.Count != 1))
				throw new Exception ("ActuallRowDataSet nicht gefüllt bei Table " + TableToProcess + " und ID = " + SelectedID);
			if (!CheckForIncompleteEntry (ActuallRowDataSet.Tables [0].Rows [0]))
				{
				Pkg = (Paketieren.PackagingHandler) GetInstatiatedPackage
					                                      (m_DataBase, TableToProcess, SelectedID);
				}
			else
				{
				String PackageName = GetPackageName (TableToProcess, SelectedID);
				if (File.Exists (PackageName))
					{
					FileInfo FInfo = new FileInfo (PackageName);
					DateTime RemoteLastWriteTime = DateTime.MinValue;

					RemoteLastWriteTime = GetLastWriteTimeForServerFileCall
						(Basics.GetRemoteFileNameFromLocalFileName (PackageName));
					if (RemoteLastWriteTime == DateTime.MinValue)
						RemoteLastWriteTime = GetLastWriteTimeForServerFileCall
							(Basics.GetRemoteArchivFileNameFromLocalFileName (PackageName));
					if (RemoteLastWriteTime != DateTime.MinValue)
						{
						if (RemoteLastWriteTime > FInfo.LastWriteTime.AddSeconds (180))
							Basics.SecureFileDelete (PackageName);
						}
					}
				if (!File.Exists (PackageName))
					{
					if (DoCentralFileDownloadCall != null)
						{
						
						DoCentralFileDownloadCall (TableToProcess, PackageName,
												   Basics.GetRemoteFileNameFromLocalFileName (PackageName));
						if (!File.Exists (PackageName))
							{
							DoCentralFileDownloadCall (TableToProcess, PackageName,
													   Basics.GetRemoteArchivFileNameFromLocalFileName (PackageName));
							if (File.Exists (PackageName))
								LoadedFromTheArchive = true;
							}
						}
					}
				if (File.Exists (PackageName))
					Pkg = (Paketieren.PackagingHandler) GetInstatiatedPackage
						                                      (TableToProcess, SelectedID);
				else
					Pkg = (Paketieren.PackagingHandler) GetInstatiatedPackage
						                                      (m_DataBase, TableToProcess, SelectedID);
				}
			ModificationRequired = false;
			return Pkg;
			}
Пример #4
0
		void InsertRuW_Ausnahmen ()
			{
			String StartRuWDateSQLCommand = TransportData.GetSQLFormattedDateTime(DateTime.Now.AddDays(-32));
			String [] IIS_AE1_SelectCommands = new String []
				{
					"Select * from RuW_Ausnahmen where Datum > " + StartRuWDateSQLCommand + " order by Datum"
				};
			DataSet IIS_AE1_DataSet = DataBase.GetCommonMultiDataSet (IIS_AE1_SelectCommands);
			if (IIS_AE1_DataSet.Tables.Count != 1)
				{
				WMB.Basics.ReportErrorToEventViewer("Beim lesen der iis_ae1 Daten aus der DatenBank\r\n\""
					+ DataBase.DefaultConnectionStringName + "\"\r\nmit dem SQLString\r\n\""
					+ String.Join ("\r\n", IIS_AE1_SelectCommands) + "\"\r\n kamen nicht 1 Tables zurück");
				throw new Exception ("Beim lesen der iis_ae1 Daten kamen nicht 1 Tables zurück");
				}
			WCFStandardsNS.WCFStandards AEAGDataBase = new WCFStandards ();
			AEAGDataBase.DefaultConnectionStringName = "AEAGConnectionString";
			String [] AEAG_SelectCommands = new String []
				{
					"Select * from Ressource",
					"Select * from FullBookableUnits"
				};
			DataSet AEAG_DataSet = AEAGDataBase.GetCommonMultiDataSet (AEAG_SelectCommands);
			if (AEAG_DataSet.Tables.Count != 2)
				{
				WMB.Basics.ReportErrorToEventViewer("Beim lesen der AEAG Daten aus der DatenBank\r\n\""
					+ AEAGDataBase.DefaultConnectionStringName + "\"\r\nmit dem SQLString \""
					+ String.Join("\r\n", AEAG_SelectCommands) + "\"\r\n kamen nicht 1 Tables zurück");
				throw new Exception("Beim lesen der AEAG Daten kamen nicht 2 Tables zurück");
				}
			NameValueCollection TypBloHalSauPlaConverter = LoadTypBloHalSauPlaConverter (AEAG_DataSet);

			foreach (DataRow AusnahmenRow in IIS_AE1_DataSet.Tables ["RuW_Ausnahmen"].Rows)
				{
				String TypBloHalSauPla = AusnahmenRow ["Typ"].ToString ()
										 + AusnahmenRow ["BloHal"].ToString ()
										 + AusnahmenRow ["SauPla"].ToString ();
				if ((TypBloHalSauPlaConverter [TypBloHalSauPla] == null)
					|| String.IsNullOrEmpty (TypBloHalSauPlaConverter [TypBloHalSauPla]))
					{
					WMB.Basics.ReportErrorToEventViewer ("AEAGProcessCollectedData.InsertRuW_Ausnahmen",
						"\"" + TypBloHalSauPla + "\" aus den RuW_Ausnahmen ist in Ressourcen nicht definiert");
					continue;
					}
				String RessourceID = TypBloHalSauPlaConverter [TypBloHalSauPla];
				if (String.IsNullOrEmpty (RessourceID))
					{
					WMB.Basics.ReportErrorToEventViewer("\"" + TypBloHalSauPla + "\" aus den RuW_Ausnahmen ist in Ressourcen nicht definiert");
					throw new Exception ("\"" + TypBloHalSauPla + "\" aus den RuW_Ausnahmen ist in Ressourcen nicht definiert");
					}
				String TimingTypForThisRessource = AEAG_DataSet.Tables ["FullBookableUnits"]
					.Select ("RessourceID = '" + RessourceID + "'") [0] ["TimingTyp"].ToString ();
				int NumberOfHoursForOneBooking = 0;
				if (TimingTypForThisRessource == "Stunde")
					NumberOfHoursForOneBooking = 1;
				if (TimingTypForThisRessource == "Doppel")
					NumberOfHoursForOneBooking = 2;
				int StartValue = Convert.ToInt32 (AusnahmenRow ["Start"]);
				int DauAnz = Convert.ToInt32 (AusnahmenRow ["Dauer"]);
				int GeneratingStep = 0;
				while ((GeneratingStep * NumberOfHoursForOneBooking) < DauAnz)
					{
					int BeginnValue = StartValue + GeneratingStep * NumberOfHoursForOneBooking;
					GeneratingStep++;
					if ((BeginnValue < 7)
						|| (BeginnValue > 21))
						continue;
					String StartHour = Convert.ToString (BeginnValue + 100).Substring (1);
					DataRow [] SelectedBookables = AEAG_DataSet.Tables ["FullBookableUnits"].Select ("RessourceID = '"
						+ RessourceID + "' and TimingTyp = '" + TimingTypForThisRessource + "'", "TimeTableNameID");
					if (SelectedBookables.Length < 1)
						{
						WMB.Basics.ReportErrorToEventViewer ("AEAGProcessCollectedData.InsertRuW_Ausnahmen",
								"\"" + RessourceID + "\" mit \"" + TimingTypForThisRessource
										+ "\" ist in Ressourcen nicht definiert");
						continue;
						}
					String BookableUnitID = String.Empty;
					foreach (DataRow Entry in SelectedBookables)
						{
						if (Entry ["TimeTableNameID"].ToString ().Substring (0, 2) == StartHour)
							{
							BookableUnitID = Entry ["ID"].ToString ();
							break;
							}
						}
					if (String.IsNullOrEmpty (BookableUnitID))
						continue;
					DateTime BookedFor = Convert.ToDateTime (AusnahmenRow ["Datum"]).Date;
					String OldContent = GetBooking (AEAGDataBase, BookableUnitID, BookedFor);
					String NewContent = AusnahmenRow ["Art"].ToString ();
					if (OldContent != NewContent)
						{
						DateTime BookingDateTime = DateTime.Now;
						SetBooking (AEAGDataBase, BookableUnitID, BookedFor, NewContent, BookingDateTime);
						}
					}

				}



			}
Пример #5
0
		public bool Run ()
			{
			if (WMB.Basics.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer("Starting Run ()");
			DataBase = new WCFStandards();
			DataBase.DefaultConnectionStringName = "IIS_AE1_ConnectionString";
			String DeviceToCheck = String.Empty;

			String TransportDirectoryName = String.Empty;
			if (String.Compare (WMB.Basics.GetComputerName ().ToUpper( ), "HEINZ64", true) == 0)
				{
				DeviceToCheck = WMB.Basics.GetUserConfigurationSettingsValue ("DeviceOnHeinz64");
				}
			if (String.Compare (WMB.Basics.GetComputerName ().ToUpper( ), "KPINFO01", true) == 0)
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer("Before Try Read DeviceToCheck on \"" + WMB.Basics.GetComputerName().ToUpper()
						+ "\"");
				DeviceToCheck = WMB.Basics.GetUserConfigurationSettingsValue("DeviceOnKPInfo01") + ":\\";
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer("Read DeviceToCheck on \"" + WMB.Basics.GetComputerName().ToUpper()
						+ "\" resulted in \"" + DeviceToCheck + "\"");
				DeviceToCheck = SearchForCorrectDevice(DeviceToCheck,
				                                        WMB.Basics.GetUserConfigurationSettingsValue ("TransportDirectory")); 
				if (String.IsNullOrEmpty (DeviceToCheck))
					{
					if (WMB.Basics.IsTestRun)
						WMB.Basics.ReportInformationToEventViewer("AEAGLeisureManagement.ProcessCollectedData.Run",
							"Error by SearchForCorrectDevice für \"" + WMB.Basics.GetUserConfigurationSettingsValue("DeviceOnKPInfo01")
							+ ":\\" + "\", \""
							+ WMB.Basics.GetUserConfigurationSettingsValue("TransportDirectory") + "\" ended with errors");

					//Messages.Add (WMB.Basics.GetUserConfigurationSettingsValue ("DeviceOnKPInfo01") + ":\\" + " as Parameter not set");
					return false;
					}
				}
			if (WMB.Basics.IsTestRun)
						WMB.Basics.ReportInformationToEventViewer("DeviceToCheck on \"" + WMB.Basics.GetComputerName ().ToUpper( )
							+ "\" = \"" + DeviceToCheck + "\"");
			TransportDirectoryName = Path.Combine(DeviceToCheck,
											WMB.Basics.GetUserConfigurationSettingsValue ("TransportDirectory"));
			if (WMB.Basics.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer("TransportDirectoryName = \"" + TransportDirectoryName + "\"");

			try
				{
				if (!Directory.Exists (TransportDirectoryName))
					Directory.CreateDirectory (TransportDirectoryName);
				}
			catch (Exception Excp)
				{
				Messages.Add ("Create Directory for \"" + TransportDirectoryName + "\" not funtioning properly:\r\n"
					+ Excp.ToString());

				return false;
				}
			String ToProcessFileName = TransportData.DataBaseCommandsResultsFileName (TransportDirectoryName);
			TransportData.DataBaseCommandsToProcessFileName (TransportDirectoryName);

			if (WMB.Basics.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer("AEAGLeisureManagement.ProcessCollectedData.Run",
					"ProcessDataRead (TransportDirectoryName) für \"" + TransportDirectoryName + "\"\r\nund \"ToProcessFileName\" = \""
							+ ToProcessFileName + "\" Started");
			if (!ProcessDataRead(TransportDirectoryName))
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("AEAGLeisureManagement.ProcessCollectedData.Run",
						"ProcessDataRead (TransportDirectoryName) für \"" + TransportDirectoryName + "\" ended with Nothing Read");
				//Messages.Add ("ProcessDataRead (\"" + TransportDirectoryName+ "\"\r\nund \"ToProcessFileName\" = \""
				//			+ ToProcessFileName + "\"  ended with Nothing Read");

				if (File.Exists(TransportData.DataBaseCommandsToProcessFileName(TransportDirectoryName)))
					return false;
				}
			else
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("AEAGLeisureManagement.ProcessCollectedData.Run",
						"ProcessDataRead (TransportDirectoryName) für \"" + TransportDirectoryName + "\" ended correctly");
				Messages.Add ("ProcessDataRead (\"" + TransportDirectoryName+ "\"\r\nund \"ToProcessFileName\" = \""
							+ ToProcessFileName + "\" ended correctly");
				
				}
			bool Return = false;
			try
				{
				Return = ProcessCreateCommandsFoNextRun(TransportDirectoryName);
				}
			catch (Exception Excp)
				{
				WMB.Basics.ReportErrorToEventViewer ("Fehler bei \"ProcessCreateCommandsFoNextRun(" + TransportDirectoryName + ")\":\r\n"
					+ Excp.ToString ());
				} 
			if (!Return)
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("AEAGLeisureManagement.ProcessCollectedData.Run",
						"ProcessCreateCommandsFoNextRun (TransportDirectoryName) für \"" + TransportDirectoryName + "\" ended with errors");
				Messages.Add ("ProcessCreateCommandsFoNextRun (\"" + TransportDirectoryName + "\") ended with Errors");
				return false;
				}
			return true;
			}
Пример #6
0
		String GetBooking (WCFStandards AEAGDataBase, String BookableUnitsID, DateTime BookedFor)
			{
			DataSet TodaysBooking = AEAGDataBase.GetCommonDataSet ("Select * from Booking where BookedFor = "
									 + TransportData.GetSQLFormattedDateTime(BookedFor)
									 + " and BookableUnitsID = '"
									 + BookableUnitsID + "'");
			if (TodaysBooking.Tables ["Booking"].Rows.Count == 0)
				return String.Empty;
			return TodaysBooking.Tables ["Booking"].Rows [0] ["BookingStatus"].ToString ();
			}
Пример #7
0
		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 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()) + "') ";

			}
Пример #9
0
		private static void DeleteDeleteteAbleTableEntriesFromDataBase(Informationen ActuallInformation)
			{
			WCFStandards DataAccess = new WCFStandards ();
			DataTable ExistingInformationenAddOn = DataAccess.GetCommonDataSet
				("Select * from InformationenAddOn where InformationenID = '"
				 + ActuallInformation.ID.ToString () + "'").Tables ["InformationenAddOn"];
			foreach (DataRow InfoAddOn in ExistingInformationenAddOn.Rows)
				{
				if ((String.IsNullOrEmpty (InfoAddOn ["Tabelle"].ToString ()))
					|| (InfoAddOn ["TabelleID"] == Convert.DBNull)
					|| (InfoAddOn["Tabelle"].ToString() == "Timings"))
					continue;
				DataRowCollection ExistingReferences = DataAccess.GetCommonDataSet
					("Select * from InformationenAddOn where not InformationenID = '"
					 + ActuallInformation.ID.ToString() + "' and Tabelle = '" + InfoAddOn["Tabelle"].ToString()
					 + "' and TabelleID = '" + InfoAddOn["TabelleID"].ToString () + "'").Tables["InformationenAddOn"].Rows;
				if (ExistingReferences.Count > 0)
					continue;
				String DeleteStatement = "Delete from " + InfoAddOn ["Tabelle"].ToString () + " where ID = '"
				                         + InfoAddOn ["TabelleID"].ToString () + "'";
				RunSQLBatch(DeleteStatement);
				}
			}
Пример #10
0
		public static bool DoInformationenUpdate (Informationen ActuallInformation, ITemplateElementeBackgroundFunctions EntryToProcess)
			{
			//if (EntryToProcess.InfoAddOn.Informationen != ActuallInformation)
			//    throw new Exception ("EntryToProcess.InfoAddOn.Informationen != ActuallInformation");
			WCFStandards ExistenceCheck = new WCFStandards ();
			DataTable InformationenTable = ExistenceCheck.GetCommonDataSet ("Select * from Informationen where ID = '"
								 + ActuallInformation.ID.ToString () + "'").Tables ["Informationen"];
			if (InformationenTable.Rows.Count == 0)
				{
				ExistenceCheck.RunSQLBatch ("Insert into Informationen (ID, NameID, TypID, ModifyTimeStamp) values ('"
											+ ActuallInformation.ID.ToString () + "', 'Empty ActiveInformationen', '" 
											+ ActuallInformation.TypID.ToString () + "', '"
											+ DateTime.Now.ToString (WMB.Basics.ISO_DATE_TIME_FORMAT) + "')");
				}
			try
				{
				System.Guid? ProcessedEntityID = InsertOrModifyEntity (EntryToProcess, ActuallInformation);
				if (ProcessedEntityID == null)
					return false;
				return true;
				}
			catch (Exception Excp)
				{
				Basics.ReportErrorToEventViewer ("TemplateManagement.DoInformationenUpdate",
					"Beim Add/Modify für ActuallInformation \"" + ActuallInformation.ID.ToString ()
					+ "\" kam es zu folgendem Problem:\r\n"
					+ Excp.ToString ());
				return false;
				}
			}
Пример #11
0
		public static DataTable GetStatisticInformationTable (String TableName, String BeitragID)
			{
			WCFStandards AccessHelper = new WCFStandards ();
			AccessHelper.DefaultConnectionStringName = "WPMediaConnectionString";
			DataSet StatisticDataSet = AccessHelper.GetCommonDataSet ("Select * from WPMediaLogView where "
					 + "TableName = '" + TableName + "' and BeitragID = '" + BeitragID
					 + "' and TimingTyp > 'A' and TimingTyp < 'AZ'"
					 + " order by ComputerName");
			return StatisticDataSet.Tables ["WPMediaLogView"];
			}
Пример #12
0
		public static DataSet GetAllEntriesForOneRedaktion (String InformationenID, String Redaktion)
			{
			WCFStandards Helper = new WCFStandards ();
			return Helper.GetCommonMultiDataSet (new String []
				{
				"Select * from ProcessConnector where InformationenID = '" + InformationenID
					+ "' and Redaktion = '" + Redaktion + "'",
				"Select * from InformationenAddOn where TableID in (select ID from ProcessConnector where InformationenID = '"
					+ InformationenID + "' and Redaktion = '" + Redaktion + "')"
				});
			}
Пример #13
0
		public static DataSet GetAllInformationenAddOns (String InformationenID, String [] DontPresent, String [] PresentOnly)
			{
			WCFStandards Helper = new WCFStandards ();
			String PresentClause = GetPresentDependingSelectClause (DontPresent, PresentOnly);
			DataSet InformationenAddOnsDataSet = Helper.GetCommonDataSet
				("Select * from InformationenAddOn where InformationenID = '" + InformationenID + "' " + PresentClause);
			return InformationenAddOnsDataSet;
			}
Пример #14
0
		public static DataRow GetInformationAddOnDataRow (String InfoAddOnID)
			{
			WCFStandards Helper = new WCFStandards ();
			DataTable InformationenAddOnDataTable =
				Helper.GetCommonDataSet ("Select * from InformationenAddOn where ID = '"
				+ InfoAddOnID + "'").Tables ["InformationenAddOn"];
			if (InformationenAddOnDataTable.Rows.Count != 1)
				return null;
			return InformationenAddOnDataTable.Rows [0];
			}
Пример #15
0
		public static DataTable GetAllInformationIDs ()
			{
			WCFStandards Helper = new WCFStandards ();
			DataSet InformationenIDDataSet =
				Helper.GetCommonDataSet ("Select ID, TypID from Informationen");
			return InformationenIDDataSet.Tables ["Informationen"];
			}
Пример #16
0
		public static Byte[] LoadFileContent(Materialien MaterialContainer)
			{
			WCFStandards DataAccess = new WCFStandards();
			String SelectStatement = "select BlobContent from Materialien where ID = '" + MaterialContainer.ID.ToString() + "'";
			return DataAccess.GetCommonBlob(SelectStatement);
			}
Пример #17
0
		public static String LoadFileContentAsString(Materialien MaterialContainer)
			{
			WCFStandards DataAccess = new WCFStandards();
			String SelectStatement = "select BlobContent from Materialien where ID = '" + MaterialContainer.ID.ToString() + "'";
			Byte [] Result = DataAccess.GetCommonBlob (SelectStatement);
			if ((Result != null)
				&& (Result.Length > 0))
				using (MemoryStream Helper = new MemoryStream(Result))
					{
					return Basics.ConvertMemoryStreamToString(Helper);
					}
			return String.Empty;
			}
Пример #18
0
		public static DataTable GetProcessInfoAddOnWithConnectorDataRows (String InformationenID)
			{
			WCFStandards Helper = new WCFStandards ();
			return Helper.GetCommonDataSet ("Select * from InformationenAddOn where InformationenID = '"
						  + InformationenID + "' and Tabelle = 'ProcessConnector'").Tables ["InformationenAddOn"];
			}
Пример #19
0
		public static DataSet GetEmptyAltErlaaInfoTimingsDataSet()
			{
			WCFStandards AccessHelper = new WCFStandards();
			AccessHelper.DefaultConnectionStringName = "AltErlaaInfoConnectionString";
			return AccessHelper.GetCommonMultiDataSet(new String[]
									{ "Select top (0) * from Timings",
									"Select * from TimingTypen"});
			}
		public void Associate(string catalogName)
		{
			_wcfStandard = new WCFStandards { DefaultConnectionStringName = $"{catalogName}ConnectionString" };
			}
Пример #21
0
		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 String GetMaterialLink (Materialien Material)
		//	{
		//	String[] Result = new String[(int)WMB.DataWrapper.MaterialElementIndex.TechnicalTableLength];

		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedConnectionString] = "AltErlaaInfoConnectionString";
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedMaterialTableName] = "Materialien";
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedMaterialTableID] = Material.ID.ToString();
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedTableName] = "";
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedTableID] = "";
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedNameID] = "";
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedType] = Material.Typ;
		//	Result[(int)WMB.DataWrapper.MaterialElementIndex.UsedSubEntryID] = Material.SubEntryID;

		//	return String.Join(",", Result);
		//	}


		public String GetMaterialLink(String TableName, String TableID)
			{
			WCFStandards Helper = new WCFStandards();
			DataTable MaterialTable = Helper.GetCommonDataSet("Select MaterialConnector from "
				+ TableName + " where ID = '" + TableID + "'").Tables[TableName];
			if (MaterialTable.Rows.Count != 1)
				return String.Empty;
			return MaterialTable.Rows[0]["MaterialConnector"].ToString();
			}
Пример #23
0
		void SetBooking(WCFStandards AEAGDataBase, String BookableUnitsID,
					DateTime BookedFor, String SetTo, DateTime BookingDateTime)
			{
			DataSet Bookings = AEAGDataBase.GetCommonDataSet (String.Format
						("Select * from Booking where BookableUnitsID = '{0}' and BookedFor = {1}",
						 BookableUnitsID, TransportData.GetSQLFormattedDateTime(BookedFor)));
			if (String.IsNullOrEmpty (SetTo))
				{
				if (Bookings.Tables ["Booking"].Rows.Count == 0)
					return;
				Bookings.Tables ["Booking"].Rows [0].Delete ();

				}
			else
				{
				DataRow RowToProcess;
				if (Bookings.Tables ["Booking"].Rows.Count == 0)
					{
					RowToProcess = Bookings.Tables ["Booking"].NewRow ();
					RowToProcess ["ID"] = System.Guid.NewGuid ();
					RowToProcess ["BookableUnitsID"] = BookableUnitsID;
					RowToProcess ["BookedFor"] = BookedFor;
					Bookings.Tables ["Booking"].Rows.Add (RowToProcess);
					}
				else
					{
					RowToProcess = Bookings.Tables ["Booking"].Rows [0];
					}
				RowToProcess ["BookingStatus"] = SetTo;
				RowToProcess ["BookingDateTime"] = BookingDateTime;
				}
			AEAGDataBase.SetCommonDataSet (Bookings);
			}
Пример #24
0
		public String GetMaterialLink(String TableName, Guid TableID)
			{
			if ((TableID == null)
				|| ((System.Guid)TableID == System.Guid.Empty))
				return String.Empty;
			WCFStandards Helper = new WCFStandards();
			DataTable MaterialTable = Helper.GetCommonDataSet("Select MaterialConnector from "
				+ TableName + " where ID = '" + TableID.ToString() + "'").Tables[TableName];
			if (MaterialTable.Rows.Count != 1)
				return String.Empty;
			return MaterialTable.Rows[0]["MaterialConnector"].ToString();
			}
Пример #25
0
		bool InsertLeisureBookings ()
			{
			String StartDateString = DateTime.Now.AddDays (-3).ToString ("yyyyMMdd");
			String StartDateSQLCommand = TransportData.GetSQLFormattedDateTime(DateTime.Now.AddDays(-3));
			String StartRuWDateSQLCommand = TransportData.GetSQLFormattedDateTime(DateTime.Now.AddDays(-4));
			String [] IIS_AE1_SelectCommands = new String []
				{
					"Select RecID, InsDate, InsBarKarte, Typ, BloHal, SauPla, Datum, Beginn, DauAnz, TarifID, ChipNr from Buchungen "
					+ " where Datum > '" + StartDateString + "' order by Typ, BloHal, SauPla",
					"Select * from Orte",
					"Select * from RuW_Regel order by Datum desc",
					"Select * from RuW_Ausnahmen where Datum > " + StartRuWDateSQLCommand + " order by Datum"
				};
			DataSet IIS_AE1_DataSet = DataBase.GetCommonMultiDataSet (IIS_AE1_SelectCommands);
			if (IIS_AE1_DataSet.Tables.Count != 4)
				{
				WMB.Basics.ReportErrorToEventViewer("AEAGProcessCollectedData.InsertLeisureBookings",
					"Beim lesen der IIS_AE1 Daten kamen nicht 4 Tables zurück - FormatFehler ???");
				throw new Exception("Beim lesen der iis_ae1 Daten kamen nicht 4 Tables zurück");
				}
			WCFStandardsNS.WCFStandards AEAGDataBase = new WCFStandards ();
			AEAGDataBase.DefaultConnectionStringName = "AEAGConnectionString";
			//TODO
			//if (AEAGDataBase.GetSimpleSchemaDataSet () == null)
			//	return false;
			String [] AEAG_SelectCommands = new String []
				{
					"Select * from Ressource",
					"Select * from TimeTable",
					"Select * from BookableUnits",
					"Select * from FullBookableUnits",
					"Select * from Booking where BookedFor > " + StartDateSQLCommand
				};
			DataSet AEAG_DataSet = AEAGDataBase.GetCommonMultiDataSet (AEAG_SelectCommands);
			if (AEAG_DataSet.Tables.Count != 5)
				{
				WMB.Basics.ReportErrorToEventViewer ("AEAGProcessCollectedData.InsertLeisureBookings", 
					"Beim lesen der AEAG Daten kamen nicht 5 Tables zurück - FormatFehler ???");
				return false;
				}
			NameValueCollection TypBloHalSauPlaConverter = LoadTypBloHalSauPlaConverter (AEAG_DataSet);
			if (WMB.Basics.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer("Aus der Tabelle \"Buchungen\" werden "
					+ Convert.ToString(IIS_AE1_DataSet.Tables["Buchungen"].Rows.Count) + " aus der DatenBank \""
					+ DataBase.DefaultConnectionStringName + "\" in die DatenBank \""
					+ AEAGDataBase.DefaultConnectionStringName + "\" übertragen");
			foreach (DataRow BuchungenRow in IIS_AE1_DataSet.Tables["Buchungen"].Rows)
				{
				if (BuchungenRow ["SauPla"] == Convert.DBNull)
					continue;
				String TypBloHalSauPla = BuchungenRow ["Typ"].ToString ()
										 + BuchungenRow ["BloHal"].ToString ()
										 + BuchungenRow ["SauPla"].ToString ();
				if ((TypBloHalSauPlaConverter [TypBloHalSauPla] == null)
					|| String.IsNullOrEmpty (TypBloHalSauPlaConverter [TypBloHalSauPla]))
					{
					WMB.Basics.ReportErrorToEventViewer ("AEAGProcessCollectedData.InsertLeisureBookings",
						"\"" + TypBloHalSauPla + "\" ist in Ressourcen nicht definiert");
					continue;
					}
				String RessourceID = TypBloHalSauPlaConverter [TypBloHalSauPla];
				if (String.IsNullOrEmpty (RessourceID))
					{
					WMB.Basics.ReportErrorToEventViewer("\"" + TypBloHalSauPla + "\" ist in Ressourcen nicht definiert");
					throw new Exception("\"" + TypBloHalSauPla + "\" ist in Ressourcen nicht definiert");
					}
				String TimingTypForThisRessource = AEAG_DataSet.Tables ["FullBookableUnits"]
					.Select ("RessourceID = '" + RessourceID + "'") [0] ["TimingTyp"].ToString ();
				int NumberOfHoursForOneBooking = 0;
				if (TimingTypForThisRessource == "Stunde")
					NumberOfHoursForOneBooking = 1;
				if (TimingTypForThisRessource == "Doppel")
					NumberOfHoursForOneBooking = 2;
				int BeginnValue = Convert.ToInt32 (BuchungenRow ["Beginn"]);
				int DauAnz = Convert.ToInt32 (BuchungenRow ["DauAnz"]);
				int GeneratingStep = 0;
				while ((GeneratingStep * NumberOfHoursForOneBooking) < DauAnz)
					{
					BeginnValue += GeneratingStep * NumberOfHoursForOneBooking;
					GeneratingStep++;
					String StartHour = Convert.ToString (BeginnValue + 100).Substring (1);
					DataRow [] SelectedBookables = AEAG_DataSet.Tables ["FullBookableUnits"].Select ("RessourceID = '"
						+ RessourceID + "' and TimingTyp = '" + TimingTypForThisRessource + "'", "TimeTableNameID");
					if (SelectedBookables.Length < 1)
						{
						WMB.Basics.ReportErrorToEventViewer("\"" + RessourceID + "\" mit \"" + TimingTypForThisRessource
											 + "\" ist in Ressourcen nicht definiert");
						throw new Exception("\"" + RessourceID + "\" mit \"" + TimingTypForThisRessource
						                     + "\" ist in Ressourcen nicht definiert");
						}
					String BookableUnitID = String.Empty;
					foreach (DataRow Entry in SelectedBookables)
						{
						if (Entry ["TimeTableNameID"].ToString ().Substring (0, 2) == StartHour)
							{
							BookableUnitID = Entry ["ID"].ToString ();
							break;
							}
						}
					if (String.IsNullOrEmpty (BookableUnitID))
						continue;
					String BookedForBase = Convert.ToString (BuchungenRow ["Datum"]);
					DateTime BookedFor = DateTime.Parse (BookedForBase.Substring (0, 4) + "-"
						  + BookedForBase.Substring (4, 2) + "-" + BookedForBase.Substring (6, 2));
					String OldContent = GetBooking (AEAGDataBase, BookableUnitID, BookedFor);
					String NewContent = BuchungenRow ["InsBarKarte"].ToString ();
					if (OldContent != NewContent)
						{
						DateTime BookingDateTime = Convert.ToDateTime (BuchungenRow ["InsDate"]);
						SetBooking (AEAGDataBase, BookableUnitID, BookedFor, NewContent, BookingDateTime);
						}
					}

				}
			return true;
			}
Пример #26
0
		public DataTable GetPersonenForOrganisation(String OrganisationsID, String PersonenTypID)
			{
			WCFStandards Helper = new WCFStandards();
			String SelectStatement = String.Empty;
			if (String.IsNullOrEmpty(PersonenTypID))
				SelectStatement = "Select * from PersonenEinerOrganisation where OrganisationsID = '" + OrganisationsID + "'";
			else
				SelectStatement = "Select * from PersonenEinerOrganisation where OrganisationsID = '" + OrganisationsID
					+ "' and PersonenTypID = '" + PersonenTypID + "'";
			DataSet PersonenDataSet = Helper.GetCommonDataSet(SelectStatement);
			return PersonenDataSet.Tables["PersonenEinerOrganisation"];
			}
Пример #27
0
		public WMB.IReadGraphicsHandling CheckLoadAndGetInstance(String TableNameParameter, String TemplateID)
			{
			WCFStandardsNS.WCFStandards DataBase = new WCFStandards();
			DataBase.DefaultConnectionStringName = "WPMediaAddOnDataConnectionString";
			ReadGraphicsHandler.CheckAndGetInstatiatedPackage(DataBase, TableNameParameter, TemplateID);
			return ReadGraphicsHandler;
			}
Пример #28
0
		public static void SetInformationenStatus(Guid InformationenID, String NewStatusToSet)
			{
			String UpdateStatement = "Update Informationen set Status = '" + NewStatusToSet + "' where ID = '"
									 + InformationenID.ToString() + "'";
			WCFStandards WCFAccess = new WCFStandards();
			WCFAccess.DefaultConnectionStringName = "AltErlaaInfoConnectionString";
			WCFAccess.RunSQLBatch(UpdateStatement);
			}
Пример #29
0
		public Byte[] ModifyMaterialContentViaName(Materialien Material, MemoryStream NewMemoryStreamContentToUse,
				String NameOfTheNewContentToStore = "", String TypOfTheContentToStore = "")
			{
			if ((Material == null)
				|| (Material.ID == Guid.Empty))
				return null;
			if (String.IsNullOrEmpty(NameOfTheNewContentToStore))
				NameOfTheNewContentToStore = Material.NameID;
			if (String.IsNullOrEmpty(TypOfTheContentToStore))
				TypOfTheContentToStore = Material.Typ;

			CacheStoreMaterialBlobContentDataBaseCommand(Material, NameOfTheNewContentToStore,
								 NewMemoryStreamContentToUse, TypOfTheContentToStore);

			String ModifyAfterBlobChanged = "Update Materialien set BlobLength = " + Convert.ToString(Material.BlobLength)
											+ ", NameID = '" + NameOfTheNewContentToStore + "', Typ = '" + TypOfTheContentToStore
											+ "', ModifyTimeStamp = " + Basics.GetSQLFormattedDateTime(DateTime.Now) +
											" where ID = '"
											+ Material.ID.ToString() + "'";
			WCFStandards WCFAccess = new WCFStandards();
			WCFAccess.DefaultConnectionStringName = "AltErlaaInfoConnectionString";
			WCFAccess.RunSQLBatch(ModifyAfterBlobChanged);

			return LoadFileContent(Material);
			}
Пример #30
0
		public static DataSet LoadPossibleKeyValues ()
			{
			WCFStandards DataAccess = new WCFStandards ();
			return DataAccess.GetCommonMultiDataSet(new string []
				{
				"Select * from ZielGruppen order by ZielGruppe",
				"SELECT ID, Name FROM  Organisationen WHERE (ID IN "
				   + "(SELECT DISTINCT TabelleID FROM   InformationenAddOn "
				   + " WHERE (Tabelle = 'Organisationen'))) order by Name",
				"SELECT ID, Vorname, Name FROM  Personen WHERE (ID IN "
				   + "(SELECT DISTINCT TabelleID FROM   InformationenAddOn "
				   + " WHERE (Tabelle = 'Personen'))) order by Name, Vorname", 
				"SELECT ID, NameID FROM Typ where (ID in "
					+ "(SELECT distinct TypID FROM Informationen)) order by NameID"
				});
			}