Exemplo n.º 1
0
        /// <summary>
        /// 导出
        /// </summary>
        private void btnexport_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txt_path.Text))
            {
                MessageBox.Show("请选择导出文件路径!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (String.IsNullOrEmpty(txt_delimiter.Text) && rbtn_txt.Checked)
            {
                MessageBox.Show("请选择或输出文件分隔符!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                table = ExportFileView.getAllData(ExportForm.currentapplyid);
                if (table.Rows.Count > 100000)
                {
                    progressbar.Visible = false;
                    lb_progress.Text    = "数据量大,请稍等!";
                }
                if (rbtn_txt.Checked)
                {
                    ExportToTxt(table);
                }
                else
                {
                    ExportToExcel(table);
                }

                group_delimiter.Enabled = false;
                group_filetype.Enabled  = false;
                btn_browser.Enabled     = false;
                btn_export.Enabled      = false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 查看数据
        /// </summary>
        private void btnpreview_Click(object sender, EventArgs e)
        {
            if (applyinfo_grid.SelectedRows.Count > 0)
            {
                string applyid      = applyinfo_grid.SelectedRows[0].Cells["apply_id"].Value.ToString();
                string encryptednum = applyinfo_grid.SelectedRows[0].Cells["encrypted_num"].Value.ToString();
                string encryptedtxt = applyinfo_grid.SelectedRows[0].Cells["encrypted_txt"].Value.ToString();

                if (ExportFileView.IsTableExist(applyid))
                {
                    DataTable table = ExportFileView.getPreviewData(applyid);
                    if (table != null)
                    {
                        preview_grid.DataSource = table;
                    }
                    dataGridPreviewSetting(encryptednum, encryptedtxt);
                    lbapproval_status.Text = "加载成功。";
                }
                else
                {
                    lbapproval_status.Text = "查看失败,数据表" + applyid + "已被删除。";
                    MessageBox.Show("数据表" + applyid + "已被删除。请联系管理员", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Exemplo n.º 3
0
 private void OpenDepartmentView(OpenWindowMessage msg)
 {
     var view = new ExportFileView() { DataContext = msg.DataContext };
     view.BorderThickness = new Thickness(1);
     view.GlowBrush = null;
     view.SetResourceReference(MetroWindow.BorderBrushProperty, "AccentColorBrush");
     view.ShowDialog();
 }
Exemplo n.º 4
0
        /// <summary>
        /// bind 预览列表
        /// </summary>
        private void bindPreview()
        {
            DataTable table = ExportFileView.getPreviewData(ExportForm.currentapplyid);

            if (table != null)
            {
                preview_grid.DataSource = table;
            }
            dataGridPreviewSetting();
        }
Exemplo n.º 5
0
 /// <summary>
 /// 导出
 /// </summary>
 private void btnexport_Click(object sender, EventArgs e)
 {
     if (applyinfo_grid.SelectedRows.Count > 0)
     {
         encryptednum = applyinfo_grid.SelectedRows[0].Cells["encrypted_num"].Value.ToString();
         encryptedtxt = applyinfo_grid.SelectedRows[0].Cells["encrypted_txt"].Value.ToString();
         if (ExportFileView.IsTableExist(currentapplyid))  //数据库中表是否存在
         {
             new ExportDetail().ShowDialog();
         }
         else
         {
             MessageBox.Show("数据表" + currentapplyid + "已被删除。请联系管理员", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("请先选择申请单", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }