|
|
@@ -2326,50 +2326,61 @@ namespace UAS_LabelMachine
|
|
|
break;
|
|
|
case "导出数据":
|
|
|
ExportExcel ex = new ExportExcel(pi_inoutno.Text);
|
|
|
- ex.StartPosition = FormStartPosition.CenterScreen;
|
|
|
- ex.ShowDialog();
|
|
|
- //ExportFileDialog.Description = "选择导出的路径";
|
|
|
- //result = ExportFileDialog.ShowDialog();
|
|
|
- //if (result == DialogResult.OK)
|
|
|
- //{
|
|
|
- // ExcelHandler eh = new ExcelHandler();
|
|
|
- // dt = ((DataTable)LabelInf.DataSource).Copy();
|
|
|
- // for (int i = dt.Columns.Count - 1; i >= 0; i--)
|
|
|
- // {
|
|
|
- // for (int j = 0; j < LabelInf.Columns.Count; j++)
|
|
|
- // {
|
|
|
- // //去除ID列
|
|
|
- // if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
|
|
|
- // {
|
|
|
- // dt.Columns.RemoveAt(i);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // switch (dt.Columns[i].ColumnName.ToLower())
|
|
|
- // {
|
|
|
- // case "pib_lotno":
|
|
|
- // dt.Columns[i].ColumnName = "批次号";
|
|
|
- // break;
|
|
|
- // case "pib_datecode":
|
|
|
- // dt.Columns[i].ColumnName = "生产日期";
|
|
|
- // break;
|
|
|
- // case "pib_custbarcode":
|
|
|
- // dt.Columns[i].ColumnName = "最小产品包装条码";
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // if (dt.Columns[i].ColumnName.ToLower() == LabelInf.Columns[j].DataPropertyName.ToLower())
|
|
|
- // {
|
|
|
- // dt.Columns[i].ColumnName = LabelInf.Columns[j].HeaderText;
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text);
|
|
|
- // string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
- // if (close.ToString() == "Yes")
|
|
|
- // System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
|
|
|
- //}
|
|
|
+ switch (SystemInf.Master)
|
|
|
+ {
|
|
|
+ case "SZSI_TEST":
|
|
|
+ ex.StartPosition = FormStartPosition.CenterScreen;
|
|
|
+ ex.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "SZSI":
|
|
|
+ ex.StartPosition = FormStartPosition.CenterScreen;
|
|
|
+ ex.ShowDialog();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ ExportFileDialog.Description = "选择导出的路径";
|
|
|
+ result = ExportFileDialog.ShowDialog();
|
|
|
+ if (result == DialogResult.OK)
|
|
|
+ {
|
|
|
+ ExcelHandler eh = new ExcelHandler();
|
|
|
+ dt = ((DataTable)LabelInf.DataSource).Copy();
|
|
|
+ for (int i = dt.Columns.Count - 1; i >= 0; i--)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < LabelInf.Columns.Count; j++)
|
|
|
+ {
|
|
|
+ //去除ID列
|
|
|
+ if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
|
|
|
+ {
|
|
|
+ dt.Columns.RemoveAt(i);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ switch (dt.Columns[i].ColumnName.ToLower())
|
|
|
+ {
|
|
|
+ case "pib_lotno":
|
|
|
+ dt.Columns[i].ColumnName = "批次号";
|
|
|
+ break;
|
|
|
+ case "pib_datecode":
|
|
|
+ dt.Columns[i].ColumnName = "生产日期";
|
|
|
+ break;
|
|
|
+ case "pib_custbarcode":
|
|
|
+ dt.Columns[i].ColumnName = "最小产品包装条码";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (dt.Columns[i].ColumnName.ToLower() == LabelInf.Columns[j].DataPropertyName.ToLower())
|
|
|
+ {
|
|
|
+ dt.Columns[i].ColumnName = LabelInf.Columns[j].HeaderText;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text);
|
|
|
+ string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
+ if (close.ToString() == "Yes")
|
|
|
+ System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
break;
|
|
|
case "权限设置":
|
|
|
PowerSetting pw = new PowerSetting();
|