Beispiel #1
0
        public void PrintNewTask()
        {
            if (taskNo != string.Empty)
            {
                if (CheckJournal(taskNo) == 0)
                {
                    InsertJournal(taskNo);
                }

                PrintResultDialog printResultDialog = new PrintResultDialog();
                if (currentTaskNo + 1 <= lastTaskNo)
                {
                    printResultDialog.btnCreateNext.Enabled = true;
                }

                DialogResult dialog = PrintResultDialog.printResultDialog.ShowDialog();
                if (dialog == DialogResult.Yes)
                {
                    string authorDivision = AuthorDivision();
                    string authorFullName = AuthorFullName();

                    if (CheckReport(taskNo) == 0)
                    {
                        FillReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }
                    else
                    {
                        UpdateReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }

                    UpdateNo();
                    Task.task.ClearForm();
                }
                else if (dialog == DialogResult.No)
                {
                    string authorDivision = AuthorDivision();
                    string authorFullName = AuthorFullName();

                    if (CheckReport(taskNo) == 0)
                    {
                        FillReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }
                    else
                    {
                        UpdateReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }
                }
                else if (dialog == DialogResult.Ignore)
                {
                    string authorDivision = AuthorDivision();
                    string authorFullName = AuthorFullName();

                    if (CheckReport(taskNo) == 0)
                    {
                        FillReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }
                    else
                    {
                        UpdateReport(taskNo, Task.task.cbHeadAcceptService.Text.Trim() + " " + Task.task.cbHeadAcceptDivision.Text.Trim(), authorDivision, authorFullName);
                    }

                    UpdateNo();
                    Task.task.cbEventType.EditValue = null;
                }
            }
        }
Beispiel #2
0
 public PrintResultDialog()
 {
     InitializeComponent();
     printResultDialog = this;
 }