Beispiel #1
0
        private void btAddDoc_Click(object sender, EventArgs e)
        {
            if (rbPC.Checked)
            {
                if (DialogResult.OK == openFileDialog1.ShowDialog())
                {
                    fileName = Path.GetFileName(openFileDialog1.FileName);
                    string fileNameWithOutExtension = Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
                    fileBytes       = File.ReadAllBytes(openFileDialog1.FileName);
                    tbFileName.Text = fileNameWithOutExtension;
                }
            }
            else if (rbDataBase.Checked)
            {
                frmSelectDocuments frmSelDoc = new frmSelectDocuments()
                {
                    Text = "Выбрать документ"
                };
                if (DialogResult.OK == frmSelDoc.ShowDialog())
                {
                    docInfo dInfo = frmSelDoc.setDocInfo();

                    fileName        = dInfo.fileName;
                    tbFileName.Text = dInfo.nameDoc;
                    fileBytes       = dInfo.fileBytes;
                }
            }
        }
        public frmSelectDocuments()
        {
            InitializeComponent();

            ToolTip tp = new ToolTip();

            tp.SetToolTip(btClose, "Выход");
            tp.SetToolTip(btSave, "Сохранить");

            docInfo = new docInfo();
            dgvData.AutoGenerateColumns = false;
        }