Ejemplo n.º 1
0
        public override void DeleteObject()
        {
            int id = getSelectedId();

            if (id != -1)
            {
                DialogResult result = MessageBox.Show("Ви впевнені що хочете видалити поточний графік?", "Видалення графіка", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    string logMsg = $"Видалення поточний графіку, id {id}";
                    AppFuncs.WriteLogTraceMessage(logMsg + "...");

                    bool dbResult = DBContext.DeleteSchedule(id);
                    if (dbResult)
                    {
                        base.DeleteObject();
                    }
                    AppFuncs.deleteFromDBResult(logMsg, dbResult);
                }
            }
            else
            {
                MessageBox.Show("Виберіть рядок для видалення");
            }
        }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage(" - press button 'Зберегти'");

            if (isValidInput())
            {
                if (_isNew || isUpdate())
                {
                    if (_phone == null)
                    {
                        _phone = new PhoneModel();
                    }
                    _phone.Department = Convert.ToInt32(cbxFormPhoneDepartment.SelectedValue);
                    _phone.FIO        = tbxFio.Text;
                    _phone.Positions  = tbxPosition.Text;
                    _phone.DepName    = cbxFormPhoneDepartment.Text;
                    _phone.Dect       = tbxDect.Text;
                    _phone.Phone      = tbxPhone.Text;
                    _phone.Mobile     = tbxMobile.Text;
                    _phone.Mail       = tbxFormPhoneMail.Text;

                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                _phone = null;
            }
        }
Ejemplo n.º 3
0
        public override void DeleteObject()
        {
            int id = getSelectedId();

            if (id != -1)
            {
                DataGridViewRow dgvRow  = base.getSelectedDataRow();
                string          nameTpl = dgvRow.Cells["Name"].ToString();

                DialogResult result = MessageBox.Show($"Ви впевнені що хочете видалити шаблон службової '{nameTpl}' ?", "Видалення шаблону службової", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    string logMsg = $"Видалення шаблон службової '{nameTpl}'";
                    AppFuncs.WriteLogTraceMessage(logMsg + "...");
                    bool dbResult = DBContext.DeleteEntityById(NoteTemplate._dbTableName, id);
                    if (dbResult)
                    {
                        base.DeleteObject();
                    }
                    AppFuncs.deleteFromDBResult(logMsg, dbResult);
                }
            }
            else
            {
                MessageBox.Show("Виберіть рядок для видалення");
            }
        }
Ejemplo n.º 4
0
 private static void dbBeforeCallAction(string sqlText)
 {
     if (AppFuncs.LogEnable)
     {
         AppFuncs.WriteLogTraceMessage("DBContext call: " + sqlText);
     }
 }
Ejemplo n.º 5
0
        public override void DeleteObject()
        {
            int id = getSelectedId();

            if (id != -1)
            {
                DialogResult result = MessageBox.Show("Ви впевнені що хочете видалити поточний відділ?", "Видалення відділу", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    DataGridViewRow dgvRow = base.getSelectedDataRow();
                    string          name   = dgvRow.Cells["Name"].ToString();
                    string          logMsg = $"Видалення вiддiлу {id}";
                    AppFuncs.WriteLogTraceMessage(logMsg + "...");

                    bool dbResult = DBContext.DeleteEntityById(Department._dbTableName, id);
                    if (dbResult)
                    {
                        base.DeleteObject();
                    }
                    AppFuncs.deleteFromDBResult(logMsg, dbResult);
                }
            }
            else
            {
                MessageBox.Show("Виберіть рядок для видалення");
            }
        }
Ejemplo n.º 6
0
        public override void DeleteObject()
        {
            if (base.AllowEdit == false)
            {
                base.notAllowEditAction(); return;
            }

            int id = getSelectedId();

            if (id != -1)
            {
                DialogResult result = MessageBox.Show("Ви впевнені що хочете видалити поточний телефон?", "Видалення телефона", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    string logMsg = $"Видалення з телефоного довiдника, id {id}";
                    AppFuncs.WriteLogTraceMessage(logMsg + "...");

                    bool dbResult = DBContext.DeleteEntityById(PhoneModel._dbTableName, id);
                    if (dbResult)
                    {
                        base.DeleteObject();
                    }
                    AppFuncs.deleteFromDBResult(logMsg, dbResult);
                }
            }
            else
            {
                MessageBox.Show("Виберіть рядок для видалення");
            }
        }
Ejemplo n.º 7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage(" - press button 'Зберегти'");

            if (isValidInput())
            {
                if (_isNew || isUpdate())
                {
                    if (_currentDep == null)
                    {
                        _currentDep = new Department();
                    }
                    _currentDep.Id    = int.Parse(tbxId.Text);
                    _currentDep.Name  = tbxName.Text;
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                _currentDep = null;
            }
        }
Ejemplo n.º 8
0
        private void btnWrite_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage(" - press button 'Зберегти'");

            DateTime dt = dateTimePicker.Value.Date;

            MessageBox.Show(dt.ToString());
        }
Ejemplo n.º 9
0
        public override void LoadDataToGrid()
        {
            AppFuncs.WriteLogTraceMessage($" - {this.GetType().Name}.LoadDataToGrid()");

            _dataTable = DBContext.GetNoteTemplates();  // чтение данных о шаблонах сл.зап.
            base.LoadDataToGrid();

            AppFuncs.SetDGVColumnsFromDescr(_dataGrid, AppNoteTemplates.dgvColDescr);
        }
Ejemplo n.º 10
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage("   - press button 'Зберегти'");

            if (isValidInput())
            {
                if (_isNew || isUpdate())
                {
                    if (_currentTemplate == null)
                    {
                        _currentTemplate = new NoteTemplate();
                    }

                    _currentTemplate.Name     = tbxTplName.Text;
                    _currentTemplate.Help     = tbxHelp.Text;
                    _currentTemplate.HeadDir  = tbxHeadDir.Text;
                    _currentTemplate.HeadNach = tbxTableColums.Text;
                    _currentTemplate.BodyUp   = tbxBodyUp.Text;
                    _currentTemplate.BodyDown = tbxBodyDown.Text;

                    _currentTemplate.TableColums  = tbxTableColums.Text.ToInt();
                    _currentTemplate.ColumName1   = tbxColumnName1.Text;
                    _currentTemplate.ColumName2   = tbxColumnName2.Text;
                    _currentTemplate.ColumName3   = tbxColumnName3.Text;
                    _currentTemplate.ColumName4   = tbxColumnName4.Text;
                    _currentTemplate.ColumName5   = tbxColumnName5.Text;
                    _currentTemplate.ColumName6   = tbxColumnName6.Text;
                    _currentTemplate.ColumName7   = tbxColumnName7.Text;
                    _currentTemplate.ColumName8   = tbxColumnName8.Text;
                    _currentTemplate.ColumName9   = tbxColumnName9.Text;
                    _currentTemplate.ColumName10  = tbxColumnName10.Text;
                    _currentTemplate.ApprASU      = cbxApprASU.Checked;
                    _currentTemplate.ApprBuh      = cbxApprBuh.Checked;
                    _currentTemplate.ApprComdir   = cbxApprComdir.Checked;
                    _currentTemplate.ApprDir      = cbxApprDir.Checked;
                    _currentTemplate.ApprDostavka = cbxApprDostavka.Checked;
                    _currentTemplate.ApprEnerg    = cbxApprEnerg.Checked;
                    _currentTemplate.ApprFin      = cbxApprFin.Checked;
                    _currentTemplate.ApprKasa     = cbxApprKasa.Checked;
                    _currentTemplate.ApprNach     = cbxApprNach.Checked;
                    _currentTemplate.ApprSB       = cbxApprSB.Checked;
                    _currentTemplate.ApprSBNach   = cbxApprSBNach.Checked;
                    _currentTemplate.ApprSklad    = cbxApprSklad.Checked;

                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                _currentTemplate = null;
            }
        }
Ejemplo n.º 11
0
        private void gridDelete()
        {
            if (_currentModel == null)
            {
                return;
            }

            AppFuncs.WriteLogTraceMessage($" - {_currentModel.GetType().Name}.Delete()");
            _currentModel.DeleteObject();
        }
Ejemplo n.º 12
0
        public override void LoadDataToGrid()
        {
            AppFuncs.WriteLogTraceMessage($" - {this.GetType().Name}.LoadDataToGrid()");

            _dataTable = DBContext.GetDepartments();
            base.LoadDataToGrid();

            // show Id
            _dataGrid.Columns[0].Visible    = true;
            _dataGrid.Columns[0].FillWeight = 25;
        }
Ejemplo n.º 13
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage(" - press button 'Зберегти'");

            if (isValidInput())
            {
                if (_isNew || isUpdate())
                {
                    if (_currentUser == null)
                    {
                        _currentUser = new User();
                    }
                    _currentUser.PC           = tbxPC.Text;
                    _currentUser.UserName     = tbxUserName.Text;
                    _currentUser.Department   = (int)cbxDepartment.SelectedValue;
                    _currentUser.Notes        = checkBoxNote.Checked;
                    _currentUser.Schedule     = checkBoxSchedule.Checked;
                    _currentUser.Phone        = checkBoxPhonebook.Checked;
                    _currentUser.Config       = checkBoxConfig.Checked;
                    _currentUser.ApprNach     = checkBoxApprovedN.Checked;
                    _currentUser.ApprSB       = checkBoxApprovedSB.Checked;
                    _currentUser.ApprDir      = checkBoxApprovedDir.Checked;
                    _currentUser.Mail         = tbxMail.Text;
                    _currentUser.ApprAvtor    = checkBoxApprAvtor.Checked;
                    _currentUser.ApprComdir   = checkBoxApprComdir.Checked;
                    _currentUser.ApprSBNach   = checkBoxApprSBN.Checked;
                    _currentUser.ApprKasa     = checkBoxApprKasa.Checked;
                    _currentUser.ApprFin      = checkBoxApprFin.Checked;
                    _currentUser.ApprDostavka = checkBoxApprDastavka.Checked;
                    _currentUser.ApprEnerg    = checkBoxApprEnerg.Checked;
                    _currentUser.ApprSklad    = checkBoxApprSklad.Checked;
                    _currentUser.ApprBuh      = checkBoxApprBun.Checked;
                    _currentUser.ApprASU      = checkBoxApprASU.Checked;
                    _currentUser.Name         = tbxName.Text;
                    _currentUser.HeadNach     = tbxHeadNach.Text;

                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                _currentUser = null;
            }
        }
Ejemplo n.º 14
0
        public override void LoadDataToGrid()
        {
            AppFuncs.WriteLogTraceMessage($" - {this.GetType().Name}.LoadDataToGrid()");

            _dataTable = DBContext.GetUsers();
            base.LoadDataToGrid();

            if (_dataGrid.Columns.Contains("DepartmentId"))
            {
                _dataGrid.Columns["DepartmentId"].Visible = false;
            }


            // установить отн.ширину колонок
            //_dataGrid.Columns[4].FillWeight = 50;
            //_dataGrid.Columns[5].FillWeight = 50;
            //_dataGrid.Columns[6].FillWeight = 50;
            //_dataGrid.Columns[7].FillWeight = 50;
        }
Ejemplo n.º 15
0
        public override void LoadDataToGrid()
        {
            AppFuncs.WriteLogTraceMessage($" - {this.GetType().Name}.LoadDataToGrid()");
            //_dataTable = DBContext.GetNotes();  // чтение данных о сл.зап.

            // создать таблицу для отображения данных
            Dictionary <int, string> deps      = DBContext.GetDepartmentNamesDict();
            Dictionary <int, string> templates = DBContext.GetNoteTemplateNamesDict();

            _notesDataTable.Clear();
            // и заполнить таблицу
            foreach (Note note in _viewNotes)
            {
                string[] apvs = (note.Approvers ?? "").Split(';');

                DataRow row = _notesDataTable.NewRow();
                row["Id"]             = note.Id;
                row["TemplateName"]   = (templates.ContainsKey(note.Templates) ? templates[note.Templates] : null);
                row["DepartmentName"] = (deps.ContainsKey(note.IdDepartment) ? deps[note.IdDepartment] : null);
                row["DepartmentId"]   = note.IdDepartment;
                row["Date"]           = note.Date;
                row["ApprAvtor"]      = (note.ApprAvtor ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText);
                row["ApprDir"]        = (apvs.Contains("ApprDir") ? (note.ApprDir ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprComdir"]     = (apvs.Contains("ApprComdir") ? (note.ApprComdir ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprSBNach"]     = (apvs.Contains("ApprSBNach") ? (note.ApprSBNach ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprSB"]         = (apvs.Contains("ApprSB") ? (note.ApprSB ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprKasa"]       = (apvs.Contains("ApprKasa") ? (note.ApprKasa ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprNach"]       = (apvs.Contains("ApprNach") ? (note.ApprNach ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprFin"]        = (apvs.Contains("ApprFin") ? (note.ApprFin ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : "-");
                row["ApprDostavka"]   = (apvs.Contains("ApprDostavka") ? (note.ApprDostavka ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprEnerg"]      = (apvs.Contains("ApprEnerg") ? (note.ApprEnerg ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprSklad"]      = (apvs.Contains("ApprSklad") ? (note.ApprSklad ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprBuh"]        = (apvs.Contains("ApprBuh") ? (note.ApprBuh ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprASU"]        = (apvs.Contains("ApprASU") ? (note.ApprASU ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText) : AppConst.DGVNotesApprNoneText);
                row["ApprAll"]        = (note.ApprAll ? AppConst.DGVNotesApprYesText : AppConst.DGVNotesApprNoText);

                _notesDataTable.Rows.Add(row);
            }

            base.LoadDataToGrid();

            AppFuncs.SetDGVColumnsFromDescr(_dataGrid, AppNotes.dgvColDescr);
        }
Ejemplo n.º 16
0
        // обработчик кнопки по умолчанию - Ок
        private void btnSaveToDB_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage("   - press button 'Записати'");
            if (checkInput() == false)
            {
                AppFuncs.WriteLogTraceMessage("   - check input not passed, no action");

                this.DialogResult = DialogResult.None;
                return;
            }

            // передать в вызывающий модуль значения полей в объекте Note
            if (_isNew)
            {
                _note.Templates    = (int)cbNoteTemplate.SelectedValue;
                _note.IdDepartment = (int)cbDepartment.SelectedValue;
                _note.Date         = dtpDateCreate.Value;
                _note.HeadDir      = this.tbHeadDir.Text;
                _note.HeadNach     = this.tbHeadNach.Text;
            }
            _note.NameAvtor = this.tbAvtor.Text;
            _note.BodyUp    = this.tbBodyUp.Text;
            _note.BodyDown  = this.tbBodyDown.Text;

            if ((dgvTable.Visible == true) && ((dgvTable.Rows.Count - 1) > 0))
            {
                if (_note.Include == null)
                {
                    _note.Include = new List <NoteInclude>();
                }
                else
                {
                    _note.Include.Clear();
                }

                IList <NoteInclude> inclList = (IList <NoteInclude>)dgvTable.DataSource;
                foreach (NoteInclude item in inclList)
                {
                    _note.Include.Add(item);
                }
            }
        }  // method
Ejemplo n.º 17
0
        public override void DeleteObject()
        {
            if (base.AllowEdit == false)
            {
                base.notAllowEditAction(); return;
            }

            int id = getSelectedId();

            if (id != -1)
            {
                DialogResult result = MessageBox.Show($"Ви впевнені що хочете видалити службову № {id.ToString()} ?", "Видалення службової", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    Note   note   = new Note(id);
                    string logMsg = $"Видалення службової {id}";
                    AppFuncs.WriteLogTraceMessage(logMsg + "...");
                    if (isAnyApproved(note))
                    {
                        string msg = "Видалити службову не можна, так як вона вже затверджена";
                        AppFuncs.WriteLogTraceMessage(msg);
                        MessageBox.Show(msg, "Видалення службової", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                    else
                    {
                        bool dbResult = DBContext.DeleteNotes(id);
                        if (dbResult)
                        {
                            // TODO сохранение удаленной служебки в таблице NotesDeleted
                            base.DeleteObject();
                        }
                        AppFuncs.deleteFromDBResult(logMsg, dbResult);
                    }
                }
            }
            else
            {
                MessageBox.Show("Виберіть рядок для видалення");
            }
        }
Ejemplo n.º 18
0
 private void btnHelp_Click(object sender, EventArgs e)
 {
     AppFuncs.WriteLogTraceMessage(" - press button 'Довiдка'");
     MessageBox.Show(Help, "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
Ejemplo n.º 19
0
        //Application.StartupPath,

        private void btnPrint_Click(object sender, EventArgs e)
        {
            AppFuncs.WriteLogTraceMessage(" - press button 'Друк'");

            string mydocu   = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string fileName = string.Format(@"{0}\doc_{1}.pdf", mydocu, _note.Id);
            string sText;

            Document document = new Document();

            try
            {
                //@"C:\arial.ttf"
                BaseFont             baseFont   = BaseFont.CreateFont(@"\\192.168.46.206\FlyDoc\arial.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
                iTextSharp.text.Font font14     = new iTextSharp.text.Font(baseFont, 14f, iTextSharp.text.Font.NORMAL);
                iTextSharp.text.Font font14Bold = new iTextSharp.text.Font(baseFont, 14f, iTextSharp.text.Font.BOLD);
                iTextSharp.text.Font font12     = new iTextSharp.text.Font(baseFont, 12f, iTextSharp.text.Font.NORMAL);

                using (FileStream stream = new FileStream(fileName, FileMode.Create))
                {
                    PdfWriter.GetInstance(document, stream);
                    document.Open();

                    // шапка - директор
                    sText = _note.HeadDir; // _note.HeadNach;
                    Paragraph p = new Paragraph(sText, font14Bold);
                    p.IndentationLeft = 300f;
                    document.Add(p);
                    // шапка - нач.отд.
                    sText             = _note.HeadNach;
                    p                 = new Paragraph(sText, font14Bold);
                    p.IndentationLeft = 300f;
                    p.SpacingBefore   = 6f;
                    document.Add(p);

                    // номер служебки
                    sText           = "Службова записка №: " + _note.Id;
                    p               = new Paragraph(sText, font14Bold);
                    p.SpacingBefore = 20f; p.SpacingAfter = 10f;
                    p.Alignment     = iTextSharp.text.Element.ALIGN_CENTER;
                    document.Add(p);

                    // текст 1
                    if (_note.BodyUp != null)
                    {
                        sText             = _note.BodyUp;
                        p                 = new Paragraph(sText, font14);
                        p.Alignment       = iTextSharp.text.Element.ALIGN_LEFT;
                        p.FirstLineIndent = 20f;
                        document.Add(p);
                    }

                    // TODO доделать вывод табилицы
                    // таблицу взять из DataGridView
                    if (dgvTable.Visible == true)
                    {
                        List <PropertyInfo> propInfos = typeof(NoteInclude).GetProperties().ToList();

                        int colVisCount = 0;
                        foreach (DataGridViewColumn col in dgvTable.Columns)
                        {
                            if (col.Visible)
                            {
                                colVisCount++;
                            }
                        }

                        PdfPTable table = new PdfPTable(colVisCount);

                        table.SpacingBefore       = 20f;
                        table.SpacingAfter        = 20f;
                        table.WidthPercentage     = 100;
                        table.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT;
                        //table.WidthPercentage
                        foreach (DataGridViewColumn col in dgvTable.Columns)
                        {
                            if (col.Visible)
                            {
                                table.AddCell(new Paragraph(col.HeaderText, font12));
                            }
                        }

                        foreach (DataGridViewRow row in dgvTable.Rows)
                        {
                            foreach (DataGridViewColumn col in dgvTable.Columns)
                            {
                                if (col.Visible)
                                {
                                    object oValue    = row.Cells[col.Name].Value;
                                    string cellValue = oValue.ToStringNull();

                                    table.AddCell(new Paragraph(cellValue, font12));
                                }
                            }
                        }


                        document.Add(table);

                        //PdfPCell cell = new PdfPCell(new Phrase("Simple table",
                        //  new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 16,
                        //  iTextSharp.text.Font.NORMAL, new BaseColor(Color.Orange))));
                        //cell.BackgroundColor = new BaseColor(Color.Wheat);
                        //cell.Padding = 5;
                        //cell.Colspan = 3;
                        //cell.HorizontalAlignment = Element.ALIGN_CENTER;
                        //table.AddCell(cell);

                        //table.AddCell("Col 1 Row 1");
                        //table.AddCell("Col 2 Row 1");
                        //table.AddCell("Col 3 Row 1");
                        //table.AddCell("Col 1 Row 2");
                        //table.AddCell("Col 2 Row 2");
                        //table.AddCell("Col 3 Row 2");


                        //foreach (NoteInclude incl in _note.Include)
                        //{
                        //    foreach (string fldName in _note.IncludeFields)
                        //    {
                        //        propInfo = propInfos.FirstOrDefault(prp => prp.Name == fldName);
                        //        object obj = propInfo.GetValue(this, null);
                        //    }

                        //}
                    }

                    // текст 2
                    if (_note.BodyDown != null)
                    {
                        sText             = _note.BodyDown;
                        p                 = new Paragraph(sText, font14);
                        p.Alignment       = iTextSharp.text.Element.ALIGN_LEFT;
                        p.FirstLineIndent = 20f;
                        document.Add(p);
                    }

                    document.Close();
                    AppFuncs.WriteLogTraceMessage($"file '{fileName}' created success");
                }
            }
            catch (DocumentException ex)
            {
                AppFuncs.WriteLogErrorMessage(ex.ToString());
                Console.WriteLine(ex.Message);
            }
            catch (IOException ex)
            {
                AppFuncs.WriteLogErrorMessage(ex.ToString());
                Console.WriteLine(ex.Message);
            }

            ProcessStartInfo pInfo = new ProcessStartInfo(fileName);

            pInfo.UseShellExecute = true;
            Process process = Process.Start(pInfo);
        }
Ejemplo n.º 20
0
 protected void notAllowEditAction()
 {
     AppFuncs.WriteLogTraceMessage(" - редагування заборонено !!");
     MessageBox.Show("Редагування заборонено.", "Редагування", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
 }