public void fillFields(POAElements poaElements)
 {
     dtpDateOfIssue.Value        = poaElements.dateOfIssue;
     dtpDocumentDate.Value       = poaElements.documentDate;
     dtpExpirationDate.Value     = poaElements.expirationDate;
     tbOrder.Text                = poaElements.order;
     tbDocumentNumber.Text       = poaElements.documentNumber.ToString();
     tbPersonDocumentNumber.Text = poaElements.personsDocumentNumber.ToString();
     tbRecipient.Text            = poaElements.recipient;
     tbPayer.Text                = poaElements.payer;
     tbIssuedByPerson.Text       = poaElements.issuedToPerson;
     cbDocumentType.Text         = poaElements.documentType;
     tbSeries.Text               = poaElements.series;
     tbPersonDocumentDate.Text   = poaElements.personsDocumentDate;
     tbIssuedByOrganization.Text = poaElements.personsDocumentIssuedOrganization;
     tbProvider.Text             = poaElements.provider;
 }
        private void dgvComplited_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0 || dgvComplited[columnComplitedDocumentNumber.Index, e.RowIndex].Value == null)
            {
                return;
            }
            try
            {
                DocumentForm documentForm = new DocumentForm();
                string[]     tableData    = poaFileHandler.readFileData(dgvComplited[6, e.RowIndex].Value.ToString());
                POAElements  poaElements  = new POAElements(tableData[0]);

                documentForm = poaFileHandler.poaReading(tableData, poaElements);
                documentForm.Show();
            }
            catch (Exception exception)
            {
                MessageBox.Show("Неможливо відкрити файл!\n" +
                                "Текст помилки: " + exception.Message, "Помилка", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
        private void завантажитиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialogPOA.Filter = "poa files (*.poa)|*.poa|All files (*.*)|*.*";
            openFileDialogPOA.Title  = "Вибір файла";

            if (openFileDialogPOA.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DocumentForm documentForm = new DocumentForm();
                    string[]     tableData    = poaFileHandler.readFromDialog(openFileDialogPOA);
                    POAElements  poaElements  = new POAElements(tableData[0]);
                    documentForm = poaFileHandler.poaReading(tableData, poaElements);
                    documentForm.Show();
                    poaFileHandler.writeIntoBase(documentForm.concatenateString(), openFileDialogPOA.FileName);
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Неможливо відкрити файл!\n" +
                                    "Текст помилки: " + exception.Message, "Помилка", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }