Beispiel #1
0
        private void btnOrderText_Click(object sender, EventArgs e)
        {
            if (dgvTransaction.RowCount == 0)
            {
                return;
            }
            var fileSelector = new FolderBrowserDialog();

            fileSelector.Description = zh?"请选择存有订单文本的文件夹:":@"Please choose the folder that stores order text:";
            var defaultPath = ExportFile.GetDefaultPath("dircPath");

            if (defaultPath != "")
            {
                fileSelector.SelectedPath = defaultPath;
            }
            if (fileSelector.ShowDialog() == DialogResult.OK)
            {
                var filename = string.Format(fileSelector.SelectedPath + @"\{0}{1}.txt",
                                             dgvTransaction.CurrentRow.Cells["OrderNo"].Value,
                                             dgvTransaction.CurrentRow.Cells["Purchaser"].Value); // Get the file name

                _frmOrderText    = new FrmOrderText();
                EvtSetOrderText += _frmOrderText.Receiver;
                EvtSetOrderText(ExportFile.ReadOrderFile(filename),
                                dgvTransaction.CurrentRow.Cells["OrderNo"].Value.ToString());
                DisplayMainFrm(false);
                OpenNewForm(_frmOrderText);
            }
        }