private void ShowTimings_OnClick(object Sender, RoutedEventArgs E)
			{
			AVEvent EventToHandle = (Sender as MenuItem).Tag as AVEvent;
			CVM.IFullTimingsInterface TimingsWindow = new ManagedTimingsWindow() as CVM.IFullTimingsInterface;
			TimingsWindow.WindowsHeadLine = EventToHandle.Title + " - Bitte Timings für Nachrichten und Kalender eingeben";

			TimingsWindow.TimingsTemplateDataSet = EventToHandle.LoadTimings();
			if ((bool)TimingsWindow.FillStoreableTimingsDataSetViaUI(""))
				{
				EventToHandle.StoreTimings(TimingsWindow.GetStoreableTimingsDataSet(System.Guid.Empty.ToString()));
				}
			}
Example #2
0
		void BulkImport_Click (object sender, RoutedEventArgs e)
			{
			MenuItem ActivatedEntry = sender as MenuItem;
			if (ActivatedEntry == null)
				return;
			String TableNameToProcess = ActivatedEntry.Tag as String;
			OpenFileDialog OFD = new OpenFileDialog ();
			OFD.Filter = "Alle Bilder|*.jpg;*.png;*.tiff;*.bmp";
			OFD.Title = "Bitte selektieren Sie Bilder für \"" + TableNameToProcess + "\"";
			OFD.Multiselect = true;
			if (OFD.ShowDialog () != true)
				{
				return;
				}
			if (OFD.FileNames.Length == 0)
				return;
			CVM.IFullTimingsInterface FullManagedTimingsInterface = new ManagedTimingsWindow () as CVM.IFullTimingsInterface ;
			DataSet TimingsTemplateDataSet = m_DataBase.GetCommonMultiDataSet (new string [] {
			            "Select * from Timings where ConnectedID = '" +
			            System.Guid.NewGuid ().ToString () + "'",
			            "Select * from TimingTypen order by ProcessingOrder"
			                                                                            });
			FullManagedTimingsInterface.TimingsTemplateDataSet = TimingsTemplateDataSet;
			FullManagedTimingsInterface.WindowsHeadLine = "Bitte geben sie die zu generierenden Timings ein";
			FullManagedTimingsInterface.FillStoreableTimingsDataSetViaUI (TableNameToProcess);
			Cursor = Cursors.Wait;
			Window ProgressWindow = new Window ();
			ProgressWindow.Height = 50;
			ProgressWindow.Width = 700;
			ProgressBar ProgressControl = new ProgressBar ();
			ProgressWindow.Content = ProgressControl;
			ProgressControl.Minimum = 0;
			ProgressControl.Maximum = OFD.FileNames.Length;
			ProgressWindow.Title = "Upload wird vorbereitet";
			ProgressWindow.Show ();
			ManagedFileHandling.FileHandlingModell  FileHandlingModellInstance = new FileHandlingModell ();
			//CommonDataBase.CommonBasics CopyInstance = new CommonBasics ();
			//CopyInstance.SendFileBlockEventCall += new SendFileBlockEvent (CopyInstance_SendFileBlockEventCall);
			//CopyInstance.CopyToServerListFinishedCall +=new CopyToServerListFinished(CopyInstance_CopyToServerListFinishedCall);
			String InsertSqlStatement = m_DataBase.GetTableDefinitionEntry (TableNameToProcess,
					WCFStandardsNS.WCFStandardClientSchema.SQL_TABLE_PROPERTY_SQL_INSERT);
			if (String.IsNullOrEmpty (InsertSqlStatement))
				InsertSqlStatement = "Insert into " + TableNameToProcess + " (ID, NameID, Titel) values ('{0}', '{1}', '{2}')";
			int LoopCounter = 0;
			foreach (String PictureFileName in OFD.FileNames)
				{
				String NewID = System.Guid.NewGuid ().ToString ();
				String NewEntryName = Path.GetFileName (Path.GetDirectoryName (PictureFileName)) + ":" +
				                      Path.GetFileNameWithoutExtension (PictureFileName);
				if (ProgressWindow.IsLoaded == false)
					break;
				ProgressControl.Value = LoopCounter++;
				ProgressWindow.Title = "Upload von " + PictureFileName;
				WMB.Basics.DoEvents ();
				String FinalInsertSqlStatement = String.Format (InsertSqlStatement, NewID, NewEntryName, "");

				m_DataBase.RunSQLBatch (FinalInsertSqlStatement);
				DataSet StoredEntry = m_DataBase.GetCommonDataSet ("Select * from "
				         + TableNameToProcess + " where ID = '" + NewID + "'");
				StoredEntry.Tables [0].Rows [0] ["ModifyTimeStamp"] = DateTime.Now;
				StoredEntry.Tables [0].Rows [0] ["ProcessingStatus"] = CVM.CommonValues.TABLE_PROCESSING_STATUS_INTERNET_PUBLISHING_PENDING
														   + ";" + CVM.CommonValues.TABLE_PROCESSING_STATUS_TV_PUBLISHING_PENDING;
				m_DataBase.SetCommonDataSet (StoredEntry);
				DataSet StoreableTimingsDataSet = FullManagedTimingsInterface.GetStoreableTimingsDataSet (NewID);
				m_DataBase.SetCommonDataSet (StoreableTimingsDataSet);
				CVM.GraphicsHandling GraphicHandler = new GraphicsHandling (CommonDataBase.DataBase.GetLocalWPMediaRoot ());
				GraphicHandler.RemoteWPMediaRoot = CommonDataBase.DataBase.GetRemoteWPMediaRoot ();
				Object Pkg = GraphicHandler.GetInstatiatedPackage (m_DataBase, TableNameToProcess, NewID);
				String Extension = Path.GetExtension (PictureFileName);
				GraphicHandler.AddFileFromElementname ("BackGround" + Extension, PictureFileName);
				String LocalFileName = GraphicHandler.Close ();
				String RemoteFileName = CommonDataBase.DataBase.GetRemoteArchivFileNameFromLocalFileName (LocalFileName);
				FileInfo FInfo = new FileInfo (LocalFileName);
				FileHandlingModellInstance.DoCentralFileUpdateCall(TableNameToProcess, LocalFileName, RemoteFileName);
				//CopyInfoBlock CopyBlock = new CopyInfoBlock (LocalFileName, RemoteFileName, FInfo.LastWriteTime);
				//CopyInstance.CopyToServer (new List<CopyInfoBlock> {CopyBlock}, true);
				}
			ProgressWindow.Close ();
			Cursor = Cursors.Arrow;
			}