Exemplo n.º 1
0
        private void DiscardContentsButton_Click(object sender, RoutedEventArgs e)
        {
            if (ScanContents == null)
            {
                MessageBox.Show("Není žádný dokument ve zpracování.", DiscardContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            this.Cursor = Cursors.Wait;

            try
            {
                ActivityDialog dlg = new ActivityDialog(this, ScanContents.ScanFileID, OcrContents, OcrActivity.Discard);
                if (dlg.ShowDialog() == true)
                {
                    ClearData();
                    MessageBox.Show("Dokument byl ÚSPĚŠNĚ vyřazen ze zpracování.", DiscardContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Dokument se NEPODAŘILO vyřadit ze zpracování.", DiscardContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                SetMenuButtonsEnabled();
                SetBookInfoPanel();
                this.Cursor = null;
            }
        }
Exemplo n.º 2
0
        private void UndoContentsButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (ScanContents == null)
                {
                    //zkontroluje rozdelane tituly (napr. po padu aplikace)
                    ScanContents = DozpController.GetCheckOutContents();
                }

                if (ScanContents != null)
                {
                    ActivityDialog dlg = new ActivityDialog(this, ScanContents.ScanFileID, OcrContents, OcrActivity.Undo);
                    if (dlg.ShowDialog() == true)
                    {
                        ClearData();
                        MessageBox.Show("Dokument byl ÚSPĚŠNĚ vrácen zpět na server.", UndoContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Není žádný dokument pro vrácení zpět na server.", UndoContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Dokument se NEPODAŘILO vrátit zpět na server.", UndoContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                SetMenuButtonsEnabled();
                SetBookInfoPanel();
                this.Cursor = null;
            }
        }
Exemplo n.º 3
0
        private void CheckInContentsButton_Click(object sender, RoutedEventArgs e)
        {
            if (ScanContents == null)
            {
                MessageBox.Show("Není žádný dokument ve zpracování.", CheckInContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            if (!File.Exists(OcrContents.OcrFilePath))
            {
                MessageBox.Show(String.Format("Neexistuje PDF soubor '{0}'.", OcrContents.OcrFilePath), CheckInContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            if (!File.Exists(OcrContents.TxtFilePath))
            {
                MessageBox.Show(String.Format("Neexistuje textový soubor '{0}'.", OcrContents.TxtFilePath), CheckInContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            this.Cursor = Cursors.Wait;

            try
            {
                OcrContents.OcrText = this.OcrText;
                OcrContents.BackupText();

                ActivityDialog dlg = new ActivityDialog(this, ScanContents.ScanFileID, OcrContents, OcrActivity.CheckIn);
                if (dlg.ShowDialog() == true)
                {
                    ClearData();
                    MessageBox.Show("Dokument byl ÚSPĚŠNĚ odeslán na server.", CheckInContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Dokument se NEPODAŘILO odeslat na server.", CheckInContentsButton.Label, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                SetMenuButtonsEnabled();
                this.Cursor = null;
            }
        }