Browse Source

添加根据客户的自定义导出方案

章政 5 years ago
parent
commit
c796f796cd

+ 174 - 0
UAS-出货标签管理(贸易版)/ExportColumns.Designer.cs

@@ -0,0 +1,174 @@
+namespace UAS_LabelMachine
+{
+    partial class ExportColumns
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.FirstPage = new System.Windows.Forms.DataGridView();
+            this.DataPage = new System.Windows.Forms.DataGridView();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.SaveColumns = new System.Windows.Forms.Button();
+            this.ResetColumns = new System.Windows.Forms.Button();
+            this.DeleteColumns = new System.Windows.Forms.Button();
+            this.DeleteDataColumns = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.FirstPage)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.DataPage)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // FirstPage
+            // 
+            this.FirstPage.AllowUserToAddRows = false;
+            this.FirstPage.AllowUserToOrderColumns = true;
+            this.FirstPage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.FirstPage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.FirstPage.Location = new System.Drawing.Point(12, 50);
+            this.FirstPage.Name = "FirstPage";
+            this.FirstPage.RowTemplate.Height = 23;
+            this.FirstPage.Size = new System.Drawing.Size(1197, 270);
+            this.FirstPage.TabIndex = 0;
+            // 
+            // DataPage
+            // 
+            this.DataPage.AllowUserToAddRows = false;
+            this.DataPage.AllowUserToOrderColumns = true;
+            this.DataPage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.DataPage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.DataPage.Location = new System.Drawing.Point(12, 365);
+            this.DataPage.Name = "DataPage";
+            this.DataPage.RowTemplate.Height = 23;
+            this.DataPage.Size = new System.Drawing.Size(1197, 270);
+            this.DataPage.TabIndex = 1;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("宋体", 10F);
+            this.label1.Location = new System.Drawing.Point(11, 24);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(77, 14);
+            this.label1.TabIndex = 13;
+            this.label1.Text = "首页列配置";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("宋体", 10F);
+            this.label2.Location = new System.Drawing.Point(9, 337);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(77, 14);
+            this.label2.TabIndex = 14;
+            this.label2.Text = "数据列配置";
+            // 
+            // SaveColumns
+            // 
+            this.SaveColumns.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.SaveColumns.Location = new System.Drawing.Point(696, 648);
+            this.SaveColumns.Margin = new System.Windows.Forms.Padding(2);
+            this.SaveColumns.Name = "SaveColumns";
+            this.SaveColumns.Size = new System.Drawing.Size(80, 24);
+            this.SaveColumns.TabIndex = 15;
+            this.SaveColumns.Text = "保存";
+            this.SaveColumns.UseVisualStyleBackColor = true;
+            this.SaveColumns.Click += new System.EventHandler(this.SaveColumns_Click);
+            // 
+            // ResetColumns
+            // 
+            this.ResetColumns.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.ResetColumns.Location = new System.Drawing.Point(613, 648);
+            this.ResetColumns.Margin = new System.Windows.Forms.Padding(2);
+            this.ResetColumns.Name = "ResetColumns";
+            this.ResetColumns.Size = new System.Drawing.Size(80, 24);
+            this.ResetColumns.TabIndex = 16;
+            this.ResetColumns.Text = "重置列";
+            this.ResetColumns.UseVisualStyleBackColor = true;
+            this.ResetColumns.Click += new System.EventHandler(this.ResetColumns_Click);
+            // 
+            // DeleteColumns
+            // 
+            this.DeleteColumns.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.DeleteColumns.Location = new System.Drawing.Point(449, 648);
+            this.DeleteColumns.Margin = new System.Windows.Forms.Padding(2);
+            this.DeleteColumns.Name = "DeleteColumns";
+            this.DeleteColumns.Size = new System.Drawing.Size(80, 24);
+            this.DeleteColumns.TabIndex = 17;
+            this.DeleteColumns.Text = "移除首页列";
+            this.DeleteColumns.UseVisualStyleBackColor = true;
+            this.DeleteColumns.Click += new System.EventHandler(this.DeleteColumns_Click);
+            // 
+            // DeleteDataColumns
+            // 
+            this.DeleteDataColumns.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.DeleteDataColumns.Location = new System.Drawing.Point(529, 648);
+            this.DeleteDataColumns.Margin = new System.Windows.Forms.Padding(2);
+            this.DeleteDataColumns.Name = "DeleteDataColumns";
+            this.DeleteDataColumns.Size = new System.Drawing.Size(80, 24);
+            this.DeleteDataColumns.TabIndex = 18;
+            this.DeleteDataColumns.Text = "移除数据列";
+            this.DeleteDataColumns.UseVisualStyleBackColor = true;
+            this.DeleteDataColumns.Click += new System.EventHandler(this.DeleteDataColumns_Click);
+            // 
+            // ExportColumns
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1221, 681);
+            this.Controls.Add(this.DeleteDataColumns);
+            this.Controls.Add(this.DeleteColumns);
+            this.Controls.Add(this.ResetColumns);
+            this.Controls.Add(this.SaveColumns);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.DataPage);
+            this.Controls.Add(this.FirstPage);
+            this.Name = "ExportColumns";
+            this.Text = "导出列配置";
+            this.Load += new System.EventHandler(this.ExportColumns_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.FirstPage)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.DataPage)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.DataGridView FirstPage;
+        private System.Windows.Forms.DataGridView DataPage;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Button SaveColumns;
+        private System.Windows.Forms.Button ResetColumns;
+        private System.Windows.Forms.Button DeleteColumns;
+        private System.Windows.Forms.Button DeleteDataColumns;
+    }
+}

+ 242 - 0
UAS-出货标签管理(贸易版)/ExportColumns.cs

@@ -0,0 +1,242 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
+
+namespace UAS_LabelMachine
+{
+    public partial class ExportColumns : Form
+    {
+        DataHelper dh = SystemInf.dh;
+
+        string inoutno = "";
+        string custcode = "";
+
+        public ExportColumns()
+        {
+            InitializeComponent();
+        }
+
+        public ExportColumns(string IInoutno)
+        {
+            InitializeComponent();
+            inoutno = IInoutno;
+        }
+
+        private void ExportColumns_Load(object sender, EventArgs e)
+        {
+            LoadData();
+        }
+
+        private void SaveColumns_Click(object sender, EventArgs e)
+        {
+            dh.ExecuteSql("delete from CS_EXPORTSETTING where es_custcode='" + custcode + "'", "delete");
+            StringBuilder sql = new StringBuilder();
+            List<string> es_filed = new List<string>();
+            List<string> es_caption = new List<string>();
+            List<string> es_enable = new List<string>();
+            List<string> es_prefix = new List<string>();
+            List<string> es_suffix = new List<string>();
+            List<string> es_detno = new List<string>();
+            List<string> es_filed1 = new List<string>();
+            List<string> es_istitle = new List<string>();
+            es_filed.Add("pi_title"); es_caption.Add("客户"); es_enable.Add("-1"); es_prefix.Add("'客户:'"); es_suffix.Add("''"); es_detno.Add("0.1"); es_filed1.Add("pi_title"); es_istitle.Add("-1");
+            es_filed.Add("pi_inoutno"); es_caption.Add("出货单号"); es_enable.Add("-1"); es_prefix.Add("'出货单号:'"); es_suffix.Add("''"); es_detno.Add("0.2"); es_filed1.Add("pi_inoutno"); es_istitle.Add("-1");
+            es_filed.Add("pr_spec"); es_caption.Add("型号"); es_enable.Add("-1"); es_prefix.Add("'型号:'"); es_suffix.Add("''"); es_detno.Add("0.3"); es_filed1.Add("pr_spec"); es_istitle.Add("-1");
+            es_filed.Add("pi_date"); es_caption.Add("销售日期"); es_enable.Add("-1"); es_prefix.Add("'销售日期:'"); es_suffix.Add("'销售部门:市场部'"); es_detno.Add("0.4"); es_filed1.Add("pi_date"); es_istitle.Add("-1");
+            es_filed.Add("pd_ordercode"); es_caption.Add("订单编号"); es_enable.Add("-1"); es_prefix.Add("''"); es_suffix.Add("''"); es_detno.Add("0.5"); es_filed1.Add("pd_ordercode"); es_istitle.Add("-1");
+            for (int i = 0; i < FirstPage.Columns.Count; i++)
+            {
+                for (int j = 0; j < FirstPage.Columns.Count; j++)
+                {
+                    if (i == FirstPage.Columns[j].DisplayIndex)
+                    {
+                        //pr_spec1 冲突BUG暂时无解,先特殊处理
+                        es_filed.Add(FirstPage.Columns[j].Tag.ToString() == "pr_spec1" ? "pr_spec" : FirstPage.Columns[j].Tag.ToString());
+                        es_caption.Add(FirstPage.Columns[j].DataPropertyName);
+                        es_enable.Add("-1");
+                        es_prefix.Add("''");
+                        es_suffix.Add("''");
+                        es_detno.Add((FirstPage.Columns[j].DisplayIndex+1).ToString());
+                        es_filed1.Add(FirstPage.Columns[j].Tag.ToString());
+                        es_istitle.Add("");
+                    }
+                }
+            }
+            sql.Clear();
+            sql.Append("insert into CS_EXPORTSETTING(es_type,es_filed,es_caption,es_enable,es_prefix,es_suffix,es_detno,es_filed1,es_custcode,es_istitle)");
+            sql.Append("values('First',:es_filed,:es_caption,:es_enable,:es_prefix,:es_suffix,:es_detno,:es_filed1,'" + custcode + "',:es_istitle)");
+            dh.BatchInsert(sql.ToString(), new string[] { "es_filed", "es_caption", "es_enable", "es_prefix", "es_suffix", "es_detno", "es_filed1", "es_istitle" }, es_filed.ToArray(), es_caption.ToArray(), es_enable.ToArray(), es_prefix.ToArray(), es_suffix.ToArray(), es_detno.ToArray(), es_filed1.ToArray(), es_istitle.ToArray());
+            //清除首页赋的值
+            es_filed.Clear(); es_caption.Clear();es_enable.Clear();es_prefix.Clear();es_suffix.Clear();es_detno.Clear();es_filed.Clear();es_filed1.Clear();es_istitle.Clear();
+            //新生成Data的抬头
+            es_filed.Add("pi_title"); es_caption.Add("客户"); es_enable.Add("-1"); es_prefix.Add("'客户:'"); es_suffix.Add("''"); es_detno.Add("0.1"); es_filed1.Add("pi_title"); es_istitle.Add("-1");
+            es_filed.Add("pi_inoutno"); es_caption.Add("出货单号"); es_enable.Add("-1"); es_prefix.Add("'出货单号:'"); es_suffix.Add("''"); es_detno.Add("0.2"); es_filed1.Add("pi_inoutno"); es_istitle.Add("-1");
+            es_filed.Add("pr_spec"); es_caption.Add("型号"); es_enable.Add("-1"); es_prefix.Add("'型号:'"); es_suffix.Add("'销售部门:市场部'"); es_detno.Add("0.3"); es_filed1.Add("pr_spec"); es_istitle.Add("-1");
+            es_filed.Add("pi_date"); es_caption.Add("销售日期"); es_enable.Add("-1"); es_prefix.Add("'销售日期:'"); es_suffix.Add("''"); es_detno.Add("0.4"); es_filed1.Add("pi_date"); es_istitle.Add("-1");
+            for (int i = 0; i < DataPage.Columns.Count; i++)
+            {
+                for (int j = 0; j < DataPage.Columns.Count; j++)
+                {
+                    if (i == DataPage.Columns[j].DisplayIndex)
+                    {
+                        //pr_spec1 冲突BUG暂时无解,先特殊处理
+                        es_filed.Add(DataPage.Columns[j].Tag.ToString()=="pr_spec1"?"pr_spec": DataPage.Columns[j].Tag.ToString());
+                        es_caption.Add(DataPage.Columns[j].DataPropertyName);
+                        es_enable.Add("-1");
+                        es_prefix.Add("''");
+                        es_suffix.Add("''");
+                        es_detno.Add((DataPage.Columns[j].DisplayIndex + 1).ToString());
+                        es_filed1.Add(DataPage.Columns[j].Tag.ToString());
+                        es_istitle.Add("");
+                    }
+                }
+            }
+            sql.Clear();
+            sql.Append("insert into CS_EXPORTSETTING(es_type,es_filed,es_caption,es_enable,es_prefix,es_suffix,es_detno,es_filed1,es_custcode,es_istitle)");
+            sql.Append("values('DataPage',:es_filed,:es_caption,:es_enable,:es_prefix,:es_suffix,:es_detno,:es_filed1,'" + custcode + "',:es_istitle)");
+            dh.BatchInsert(sql.ToString(), new string[] { "es_filed", "es_caption", "es_enable", "es_prefix", "es_suffix", "es_detno", "es_filed1", "es_istitle" }, es_filed.ToArray(), es_caption.ToArray(), es_enable.ToArray(), es_prefix.ToArray(), es_suffix.ToArray(), es_detno.ToArray(), es_filed1.ToArray(), es_istitle.ToArray());
+        }
+
+        private void ResetColumns_Click(object sender, EventArgs e)
+        {
+            string close = MessageBox.Show(this.ParentForm, "是否重置列", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (close == "Yes")
+            {
+                dh.ExecuteSql("delete from CS_EXPORTSETTING where es_custcode='" + custcode + "'", "delete");
+                LoadData();
+            }
+        }
+
+        private void DeleteColumns_Click(object sender, EventArgs e)
+        {
+            DataGridViewSelectedCellCollection cl = FirstPage.SelectedCells;
+            List<int> deleteIndex = new List<int>();
+            for (int i = 0; i < cl.Count; i++)
+            {
+                if (!deleteIndex.Contains(cl[i].ColumnIndex))
+                {
+                    deleteIndex.Add(cl[i].ColumnIndex);
+                }
+            }
+            for (int i = FirstPage.Columns.Count - 1; i >= 0; i--)
+            {
+                for (int j = 0; j < deleteIndex.ToArray().Length; j++)
+                {
+                    if (deleteIndex.ToArray()[j] == i)
+                        FirstPage.Columns.RemoveAt(i);
+                }
+            }
+        }
+
+        private void DeleteDataColumns_Click(object sender, EventArgs e)
+        {
+            DataGridViewSelectedCellCollection cl = DataPage.SelectedCells;
+            List<int> deleteIndex = new List<int>();
+            for (int i = 0; i < cl.Count; i++)
+            {
+                if (!deleteIndex.Contains(cl[i].ColumnIndex))
+                {
+                    deleteIndex.Add(cl[i].ColumnIndex);
+                }
+            }
+            for (int i = DataPage.Columns.Count - 1; i >= 0; i--)
+            {
+                for (int j = 0; j < deleteIndex.ToArray().Length; j++)
+                {
+                    if (deleteIndex.ToArray()[j] == i)
+                        DataPage.Columns.RemoveAt(i);
+                }
+            }
+        }
+
+        private void LoadData()
+        {
+            StringBuilder sql = new StringBuilder();
+            custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
+            DataTable SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode='" + custcode + "' and nvl(es_istitle,0)<>-1 order by es_detno", "select");
+            //没有置顶客户的取空的
+            if (SQL1_.Rows.Count == 0)
+            {
+                SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode is null  and nvl(es_istitle,0)<>-1 order by es_detno", "select");
+            }
+            string es_field1 = "";
+            for (int i = 0; i < SQL1_.Rows.Count; i++)
+            {
+                es_field1 += SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString() + ",";
+            }
+            //分页信息的DataTable
+            sql.Clear();
+            sql.Append("select " + es_field1.Substring(0, es_field1.Length - 1) + " from  prodinout left join prodiodetail on pi_id=pd_piid left join ");
+            sql.Append("chip_in_out on pd_id=io_pdid left join chip on ch_code=io_chipcode left join CHIP_WAFERTEST_VIEW on ch_code=chw_chipcode ");
+            sql.Append("left join CHIP_EDCDATA_VIEW on che_chipcode=ch_code left join product on pr_code=pd_prodcode left join prodiobarcode on ");
+            sql.Append("pib_piid=pi_id and pib_custbarcode=ch_code where pi_inoutno='" + inoutno + "' order by ch_code");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+
+            for (int i = 0; i < dt.Columns.Count; i++)
+            {
+                if (dt.Columns[i].ColumnName == (SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString()).ToUpper())
+                {
+                    dt.Columns[i].Caption = SQL1_.Rows[i]["es_filed1"].ToString();
+                    dt.Columns[i].ColumnName = SQL1_.Rows[i]["es_caption"].ToString();
+                }
+            }
+            //获取首页需要展示的字段
+            DataTable SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode='" + custcode + "' and nvl(es_istitle,0)<>-1 order by es_detno", "select");
+            if (SQL_.Rows.Count == 0)
+            {
+                SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode is null and  nvl(es_istitle,0)<>-1 order by es_detno", "select");
+            }
+            string es_field = "";
+            for (int i = 0; i < SQL_.Rows.Count; i++)
+            {
+                es_field += SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString() + ",";
+            }
+            //首页信息的DataTable
+            sql.Clear();
+            sql.Append("select " + es_field.Substring(0, es_field.Length - 1) + "  from FIRSTPAGE_BATCH_VIEW where pi_inoutno='" + inoutno + "'");
+            DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            for (int i = 0; i < dt1.Columns.Count; i++)
+            {
+                if (dt1.Columns[i].ColumnName == (SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString()).ToUpper())
+                {
+                    dt1.Columns[i].Caption = SQL_.Rows[i]["es_filed1"].ToString();
+                    dt1.Columns[i].ColumnName = SQL_.Rows[i]["es_caption"].ToString();
+                }
+            }
+            if (FirstPage.DataSource != null)
+                FirstPage.DataSource = null;
+            if (DataPage.DataSource != null)
+                DataPage.DataSource = null;
+            FirstPage.DataSource = dt1;
+            DataPage.DataSource = dt;
+            //将字段赋值到Tag字段,后续保存的时候取值
+            for (int i = 0; i < FirstPage.Columns.Count; i++)
+            {
+                for (int j = 0; j < dt1.Columns.Count; j++)
+                {
+                    if (FirstPage.Columns[i].Name == dt1.Columns[j].ColumnName)
+                    {
+                        FirstPage.Columns[i].Tag = dt1.Columns[j].Caption;
+                    }
+                }
+            }
+
+            for (int i = 0; i < DataPage.Columns.Count; i++)
+            {
+                for (int j = 0; j < dt.Columns.Count; j++)
+                {
+                    if (DataPage.Columns[i].Name == dt.Columns[j].ColumnName)
+                    {
+                        DataPage.Columns[i].Tag = dt.Columns[j].Caption;
+                    }
+                }
+            }
+        }
+    }
+}

+ 120 - 0
UAS-出货标签管理(贸易版)/ExportColumns.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 22 - 8
UAS-出货标签管理(贸易版)/ExportExcel.Designer.cs

@@ -53,11 +53,12 @@
             this.FirstPage_YIELD = new System.Windows.Forms.CheckBox();
             this.FirstPage_REMARK = new System.Windows.Forms.CheckBox();
             this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
+            this.ExportSetting = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // Export
             // 
-            this.Export.Location = new System.Drawing.Point(240, 288);
+            this.Export.Location = new System.Drawing.Point(292, 290);
             this.Export.Margin = new System.Windows.Forms.Padding(2);
             this.Export.Name = "Export";
             this.Export.Size = new System.Drawing.Size(94, 24);
@@ -166,7 +167,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("宋体", 10F);
-            this.label3.Location = new System.Drawing.Point(11, 130);
+            this.label3.Location = new System.Drawing.Point(11, 135);
             this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(112, 14);
@@ -177,7 +178,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("宋体", 10F);
-            this.label4.Location = new System.Drawing.Point(11, 176);
+            this.label4.Location = new System.Drawing.Point(11, 175);
             this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(112, 14);
@@ -188,7 +189,7 @@
             // 
             this.BVCEO.AutoSize = true;
             this.BVCEO.Font = new System.Drawing.Font("宋体", 10F);
-            this.BVCEO.Location = new System.Drawing.Point(244, 174);
+            this.BVCEO.Location = new System.Drawing.Point(244, 173);
             this.BVCEO.Margin = new System.Windows.Forms.Padding(2);
             this.BVCEO.Name = "BVCEO";
             this.BVCEO.Size = new System.Drawing.Size(61, 18);
@@ -200,7 +201,7 @@
             // 
             this.TS.AutoSize = true;
             this.TS.Font = new System.Drawing.Font("宋体", 10F);
-            this.TS.Location = new System.Drawing.Point(130, 174);
+            this.TS.Location = new System.Drawing.Point(130, 173);
             this.TS.Margin = new System.Windows.Forms.Padding(2);
             this.TS.Name = "TS";
             this.TS.Size = new System.Drawing.Size(40, 18);
@@ -212,7 +213,7 @@
             // 
             this.percent.AutoSize = true;
             this.percent.Font = new System.Drawing.Font("宋体", 10F);
-            this.percent.Location = new System.Drawing.Point(130, 128);
+            this.percent.Location = new System.Drawing.Point(130, 133);
             this.percent.Margin = new System.Windows.Forms.Padding(2);
             this.percent.Name = "percent";
             this.percent.Size = new System.Drawing.Size(47, 18);
@@ -329,7 +330,7 @@
             // 
             // RowNum
             // 
-            this.RowNum.Location = new System.Drawing.Point(480, 216);
+            this.RowNum.Location = new System.Drawing.Point(480, 214);
             this.RowNum.Margin = new System.Windows.Forms.Padding(2);
             this.RowNum.Name = "RowNum";
             this.RowNum.Negative = false;
@@ -337,11 +338,23 @@
             this.RowNum.TabIndex = 30;
             this.RowNum.Text = "10";
             // 
+            // ExportSetting
+            // 
+            this.ExportSetting.Location = new System.Drawing.Point(201, 290);
+            this.ExportSetting.Margin = new System.Windows.Forms.Padding(2);
+            this.ExportSetting.Name = "ExportSetting";
+            this.ExportSetting.Size = new System.Drawing.Size(80, 24);
+            this.ExportSetting.TabIndex = 33;
+            this.ExportSetting.Text = "导出列配置";
+            this.ExportSetting.UseVisualStyleBackColor = true;
+            this.ExportSetting.Click += new System.EventHandler(this.ExportSetting_Click);
+            // 
             // ExportExcel
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(572, 338);
+            this.ClientSize = new System.Drawing.Size(572, 336);
+            this.Controls.Add(this.ExportSetting);
             this.Controls.Add(this.FirstPage_REMARK);
             this.Controls.Add(this.FirstPage_YIELD);
             this.Controls.Add(this.RowNum);
@@ -402,5 +415,6 @@
         private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
         private System.Windows.Forms.CheckBox FirstPage_YIELD;
         private System.Windows.Forms.CheckBox FirstPage_REMARK;
+        private System.Windows.Forms.Button ExportSetting;
     }
 }

+ 1 - 90
UAS-出货标签管理(贸易版)/ExportExcel.cs

@@ -133,96 +133,7 @@ namespace UAS_LabelMachine
 
         private void ExportSetting_Click(object sender, EventArgs e)
         {
-            StringBuilder sql = new StringBuilder();
-            List<CheckBox> conditionbox = new List<CheckBox>();
-            string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
-            if (!CH_PBCODE.Checked && BoxCode.Checked)
-            {
-                MessageBox.Show("勾选盒号分页,打印内容请勾选盒号");
-                return;
-            }
-            if (!CH_SPLITBATCH.Checked && BatchCode.Checked)
-            {
-                MessageBox.Show("勾选扩撒批分页,打印内容请勾选扩撒批号");
-                return;
-            }
-            conditionbox.Add(CH_BLUEFILM);
-            conditionbox.Add(CH_PBCODE);
-            conditionbox.Add(CH_REMARK);
-            conditionbox.Add(CH_SPLITBATCH);
-            conditionbox.Add(CH_WATERID);
-            conditionbox.Add(ch_code);
-            conditionbox.Add(percent);
-            conditionbox.Add(TS);
-            conditionbox.Add(BVCEO);
-            conditionbox.Add(FirstPage_WID);
-            conditionbox.Add(FirstPage_YIELD);
-            conditionbox.Add(FirstPage_REMARK);
-            string SplitType = "";
-            if (FixRow.Checked)
-            {
-                SplitType = FixRow.Name;
-            }
-            else if (BatchCode.Checked)
-            {
-                SplitType = BatchCode.Name;
-            }
-            else if (BoxCode.Checked)
-            {
-                SplitType = BoxCode.Name;
-            }
-            DataTable SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode='" + custcode + "' and nvl(es_istitle,0)<>-1 order by es_detno", "select");
-            //没有置顶客户的取空的
-            if (SQL1_.Rows.Count == 0)
-            {
-                SQL1_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='DataPage' and es_enable=-1 and es_custcode is null  and nvl(es_istitle,0)<>-1 order by es_detno", "select");
-            }
-            string es_field1 = "";
-            for (int i = 0; i < SQL1_.Rows.Count; i++)
-            {
-                es_field1 += SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString() + ",";
-            }
-            //分页信息的DataTable
-            sql.Clear();
-            sql.Append("select " + es_field1.Substring(0, es_field1.Length - 1) + " from  prodinout left join prodiodetail on pi_id=pd_piid left join ");
-            sql.Append("chip_in_out on pd_id=io_pdid left join chip on ch_code=io_chipcode left join CHIP_WAFERTEST_VIEW on ch_code=chw_chipcode ");
-            sql.Append("left join CHIP_EDCDATA_VIEW on che_chipcode=ch_code left join product on pr_code=pd_prodcode left join prodiobarcode on ");
-            sql.Append("pib_piid=pi_id and pib_custbarcode=ch_code where pi_inoutno='" + inoutno + "' order by ch_code");
-            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-
-            for (int i = 0; i < dt.Columns.Count; i++)
-            {
-                if (dt.Columns[i].ColumnName == (SQL1_.Rows[i]["es_prefix"].ToString() + "||" + SQL1_.Rows[i]["es_filed"].ToString() + "||" + SQL1_.Rows[i]["es_suffix"].ToString()).ToUpper())
-                {
-                    dt.Columns[i].Caption = SQL1_.Rows[i]["es_filed1"].ToString();
-                    dt.Columns[i].ColumnName = SQL1_.Rows[i]["es_caption"].ToString();
-                }
-            }
-
-            //获取首页需要展示的字段
-            DataTable SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode='" + custcode + "' and nvl(es_istitle,0)<>-1 order by es_detno", "select");
-            if (SQL_.Rows.Count == 0)
-            {
-                SQL_ = (DataTable)dh.ExecuteSql("select es_filed,es_caption,es_prefix,es_suffix,es_filed1 from CS_EXPORTSETTING where es_type='First' and es_enable=-1 and es_custcode is null and  nvl(es_istitle,0)<>-1 order by es_detno", "select");
-            }
-            string es_field = "";
-            for (int i = 0; i < SQL_.Rows.Count; i++)
-            {
-                es_field += SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString() + ",";
-            }
-            //首页信息的DataTable
-            sql.Clear();
-            sql.Append("select " + es_field.Substring(0, es_field.Length - 1) + "  from FIRSTPAGE_BATCH_VIEW where pi_inoutno='" + inoutno + "'");
-            DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            for (int i = 0; i < dt1.Columns.Count; i++)
-            {
-                if (dt1.Columns[i].ColumnName == (SQL_.Rows[i]["es_prefix"].ToString() + "||" + SQL_.Rows[i]["es_filed"].ToString() + "||" + SQL_.Rows[i]["es_suffix"].ToString()).ToUpper())
-                {
-                    dt1.Columns[i].Caption = SQL_.Rows[i]["es_filed1"].ToString();
-                    dt1.Columns[i].ColumnName = SQL_.Rows[i]["es_caption"].ToString();
-                }
-            }
-            ExportColumns ex = new ExportColumns(dt, dt1);
+            ExportColumns ex = new ExportColumns(inoutno);
             ex.WindowState = FormWindowState.Maximized;
             ex.ShowDialog();
         }

+ 20 - 2
UAS-出货标签管理(贸易版)/PublicMethod/BaseUtil.cs

@@ -902,7 +902,7 @@ namespace UAS_LabelMachine
             objCompilerParameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
             objCompilerParameters.GenerateExecutable = false;
             objCompilerParameters.GenerateInMemory = true;
-
+            Console.WriteLine(oContent);
             // 4.CompilerResults
             CompilerResults cr = objCSharpCodePrivoder.CompileAssemblyFromSource(objCompilerParameters, oContent);
             if (cr.Errors.HasErrors)
@@ -920,7 +920,7 @@ namespace UAS_LabelMachine
                 MethodInfo objMI = objHelloWorld.GetType().GetMethod("CustInit");
                 try
                 {
-                    objMI.Invoke(objHelloWorld, null);
+                    Console.WriteLine(objMI.Invoke(objHelloWorld, null));     
                 }
                 catch (Exception ex)
                 {
@@ -930,4 +930,22 @@ namespace UAS_LabelMachine
             }
         }
     }
+
+
+    namespace CustInitSpace
+    {
+        using System;
+        using System.Windows.Forms;
+        public class CustInitClass
+        {
+            public void CustInit()
+            {
+                Form f = Form.ActiveForm;
+                (f.Controls["LabelInf"] as DataGridView).Columns["pib_year"].Visible = false;
+                (f.Controls["LabelInf"] as DataGridView).Columns["pib_month"].Visible = false;
+                (f.Controls["LabelInf"] as DataGridView).Columns["pib_day"].Visible = false;
+                (f.Controls["LabelInf"] as DataGridView).Columns["pib_custoutboxcode"].HeaderText = "芯片号";
+            }
+        }
+    }
 }

+ 9 - 0
UAS-出货标签管理(贸易版)/UAS-出货标签管理(贸易版).csproj

@@ -241,6 +241,12 @@
     </Compile>
     <Compile Include="Entity\SystemInf.cs" />
     <Compile Include="Entity\User.cs" />
+    <Compile Include="ExportColumns.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="ExportColumns.Designer.cs">
+      <DependentUpon>ExportColumns.cs</DependentUpon>
+    </Compile>
     <Compile Include="ExportExcel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -367,6 +373,9 @@
     <EmbeddedResource Include="DbFind.resx">
       <DependentUpon>DbFind.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="ExportColumns.resx">
+      <DependentUpon>ExportColumns.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="ExportExcel.resx">
       <DependentUpon>ExportExcel.cs</DependentUpon>
     </EmbeddedResource>

+ 1 - 1
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -105,7 +105,7 @@ namespace UAS_LabelMachine
         /// </summary>
         LabelFormatDocument MidFormat;
         /// <summary>
-        /// BarTender外箱
+        /// BarTender外箱 
         /// </summary>
         LabelFormatDocument OutFormat;