bool ProcessKaufParkPraesentationen (string TableName, DataRow RowBeforeUpdate ) { String OutlookPraesentationFileName = RowBeforeUpdate ["SourceMachineFullPath"].ToString (); if (String.IsNullOrEmpty (OutlookPraesentationFileName)) return false; if (!File.Exists (OutlookPraesentationFileName)) { if (MessageBox.Show ("Sie haben Änderungen vorgenommen,\r\n" + "aber die zugeordnete PowerPoint Presentation.\r\n" + "ist nicht zugreifbar. Wollen Sie dennoch speichern?", "SicherheitsAbfrage", MessageBoxButton.YesNo) == MessageBoxResult.No) { return false; } } FileInfo PowerPointFileInfo = new FileInfo (OutlookPraesentationFileName); if (RowBeforeUpdate ["PresentationModifyTimeStamp"] != Convert.DBNull) { if (Math.Abs((PowerPointFileInfo.LastWriteTime - Convert.ToDateTime (RowBeforeUpdate ["PresentationModifyTimeStamp"])).TotalSeconds) > 3) { if (MessageBox.Show ("Die auf dem Server gespeicherte\r\n" + "Outlook Presentation ist neuer oder ungleich\r\nals Ihre lokale Version. " + "Soll Ihre lokale\r\nVersion dennoch auf den Server übertragen werden?", "SicherheitsAbfrage", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No) { return true; } } else { return true; } } Cursor = Cursors.Wait; String TargetDirectoryOnServer = GetTableEntryDirectoryNameOnServer (TableName, RowBeforeUpdate ["NameID"].ToString ()); String TargetFileNameOnServer = Path.Combine (TargetDirectoryOnServer, Path.GetFileName (OutlookPraesentationFileName)); FileInfo FInfo = new FileInfo (OutlookPraesentationFileName); ManagedFileHandling.FileHandlingModell FileHandlingModellInstance = new FileHandlingModell(); FileHandlingModellInstance.DoCentralFileUpdateCall (TableName, OutlookPraesentationFileName, TargetFileNameOnServer); //CopyInfoBlock CopyCommand = new CopyInfoBlock // (OutlookPraesentationFileName, TargetFileNameOnServer, FInfo.LastWriteTime); //CommonBasics Basics = new CommonBasics (); //Basics.SendFileBlockEventCall += new SendFileBlockEvent (Basics_SendFileBlockEventCall); //Basics.CopyToServerListFinishedCall += new CopyToServerListFinished (Basics_SendFileListFinishedCall); //Basics.CopyToServer (new List<CopyInfoBlock> {CopyCommand}, true); Cursor = Cursors.Arrow; RowBeforeUpdate ["PresentationModifyTimeStamp"] = PowerPointFileInfo.LastWriteTime; return true; }
void FileHandlingTimer_Tick (object sender, EventArgs e) { (sender as DispatcherTimer).Stop (); ManagedFileHandling.FileHandlingModell FileHandlingModellInstance = new ManagedFileHandling.FileHandlingModell (); if (FileHandlingModellInstance.TransportsPending > 0) { FileHandlingModellInstance.CheckAndStartCopyOrderProcessing(RootGrid); } DispatcherTimer StandardProcessingTimer = new DispatcherTimer (); StandardProcessingTimer.Interval = TimeSpan.FromMilliseconds (1); StandardProcessingTimer.Tick += new EventHandler (StandardProcessingTimer_Tick); StandardProcessingTimer.Start (); }
private void Window_Closing (object sender, System.ComponentModel.CancelEventArgs e) { if (m_TableProcessing != null) { m_TableProcessing.ClosedFromOutside (); } if (m_FunctionSelection != null) { m_FunctionSelection.ClosedFromOutside (); } if (m_CacheSynchronizationWorker != null) { this.IsEnabled = false; ManagedFileHandling.FileHandlingModell FileHandlingModellInstance = new ManagedFileHandling.FileHandlingModell (); if (FileHandlingModellInstance.TransportsPending > 0) { if (GraphicsSingleton.Instance.GraphicsHandler != null) if (GraphicsSingleton.Instance.GraphicsHandler != null) GraphicsSingleton.Instance.GraphicsHandler.Close (); DispatcherTimer FilehandlingAfterClosing = new DispatcherTimer (); FilehandlingAfterClosing.Interval = TimeSpan.FromMilliseconds (1); FilehandlingAfterClosing.Tag = FileHandlingModellInstance; FilehandlingAfterClosing.Tick += new EventHandler (FilehandlingAfterClosing_Tick); e.Cancel = true; FilehandlingAfterClosing.Start (); return; } FileHandlingModellInstance.CheckAndStartCopyOrderProcessing(RootGrid); this.IsEnabled = true; if (m_CacheSynchronizationWorker.IsBusy) { MessageBoxResult Result = MessageBox.Show ("Das Synchronisieren der Bilder ist noch aktiv.\r\n" + "Wenn diese Arbeit beendet ist,\r\n" + "schließt sich das Programm automatisch\r\n" + "\"Ja\" für warten, \"Nein\" für sofort beenden", "Sicherheitsabfrage", MessageBoxButton.YesNo); if (Result == MessageBoxResult.Yes) { m_CloseMeWhenSynchronizationIsFinish = true; e.Cancel = true; } } } CVM.LayoutManagerControl.DoClosingProcessing (this, LayoutDefinition); SaveUserSettings (); if ((Content != null) && (m_TableProcessing != null) && (Content.GetType () == typeof (TableProcessing))) m_TableProcessing.CloseMe (true); }
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; }