Browse Source

修改下载链接

章政 5 years ago
parent
commit
545f7d4313

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

@@ -0,0 +1,63 @@
+namespace UAS_LabelMachine
+{
+    partial class PreViewWindow
+    {
+        /// <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.LabelPreView = new System.Windows.Forms.PictureBox();
+            ((System.ComponentModel.ISupportInitialize)(this.LabelPreView)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // LabelPreView
+            // 
+            this.LabelPreView.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+            this.LabelPreView.Location = new System.Drawing.Point(12, 12);
+            this.LabelPreView.Name = "LabelPreView";
+            this.LabelPreView.Size = new System.Drawing.Size(446, 394);
+            this.LabelPreView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.LabelPreView.TabIndex = 0;
+            this.LabelPreView.TabStop = false;
+            // 
+            // PreViewWindow
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(470, 418);
+            this.Controls.Add(this.LabelPreView);
+            this.Name = "PreViewWindow";
+            this.Text = "预览标签";
+            this.Load += new System.EventHandler(this.PreViewWindow_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.LabelPreView)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.PictureBox LabelPreView;
+    }
+}

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

@@ -0,0 +1,28 @@
+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;
+
+namespace UAS_LabelMachine
+{
+    public partial class PreViewWindow : Form
+    {
+
+        string FileName;
+
+        public PreViewWindow(string filename)
+        {
+            InitializeComponent();
+            FileName = filename;
+        }
+
+        private void PreViewWindow_Load(object sender, EventArgs e)
+        {
+            LabelPreView.Image = Image.FromFile(@"C:\打印标签\"+FileName+".jpg");
+        }
+    }
+}

+ 120 - 0
UAS-出货标签管理(贸易版)/PreViewWindow.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>

+ 12 - 9
UAS-出货标签管理(贸易版)/PublicMethod/ExcelHandler.cs

@@ -268,7 +268,7 @@ namespace UAS_LabelMachine
         /// </summary>
         /// <param name="DataTable"></param>
         /// <returns></returns>
-        public MemoryStream DataTableToExcel1(DataTable FirstDT, DataTable DataTable, string Type,string Inoutno, int PageSize, List<CheckBox> conditionbox)
+        public MemoryStream DataTableToExcel1(DataTable FirstDT, DataTable DataTable, string Type, string Inoutno, int PageSize, List<CheckBox> conditionbox)
         {
             //转换为序列
             CheckBox[] box = conditionbox.ToArray();
@@ -364,7 +364,7 @@ namespace UAS_LabelMachine
             IRow row = sheet.CreateRow(0);
             //冻结第一行
             sheet.CreateFreezePane(0, 1, 0, 1);
-   
+
             row.HeightInPoints = RowHeight;
             //固定第一行
             //row.RowStyle.IsLocked=true;
@@ -439,7 +439,7 @@ namespace UAS_LabelMachine
                                 {
                                     row1.Cells[j].SetCellValue("小计");
                                 }
-                                else if (DataTable.Columns[j].ColumnName=="io_qty")
+                                else if (DataTable.Columns[j].ColumnName == "io_qty")
                                 {
                                     row1.Cells[NumIndex - 4].SetCellValue(sumCount);
                                 }
@@ -447,7 +447,7 @@ namespace UAS_LabelMachine
                             }
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
-                            sheet.SetRowBreak(PaintIndex-1);
+                            sheet.SetRowBreak(PaintIndex - 1);
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -487,7 +487,7 @@ namespace UAS_LabelMachine
                                     if (j == 0)
                                     {
                                         row1.CreateCell(j);
-                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString()+ DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
+                                        row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
                                     }
                                     else if (columnNum > 5 && j == columnNum - 5)
                                     {
@@ -529,7 +529,7 @@ namespace UAS_LabelMachine
                                         NumIndex = j;
                                     }
                                     //如果chw_itemname1的值为空,则值为100和0,其中一列不显示,不显示
-                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc")||(!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
+                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
                                     {
                                         sheet.SetColumnHidden(j - 4, true);
                                     }
@@ -579,7 +579,7 @@ namespace UAS_LabelMachine
                                 {
                                     row1.Cells[j].SetCellValue("小计");
                                 }
-                                else if (DataTable.Columns[j].ColumnName=="io_qty")
+                                else if (DataTable.Columns[j].ColumnName == "io_qty")
                                 {
                                     row1.Cells[j - 4].SetCellValue(sumCount);
                                 }
@@ -967,7 +967,7 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = styleborder;
                             }
                             row1 = sheet.CreateRow(PaintIndex);
-                   
+
                             for (int j = 0; j < columnNum - 3; j++)
                             {
                                 if (j == 0)
@@ -1019,7 +1019,10 @@ namespace UAS_LabelMachine
                 default:
                     break;
             }
-            dh.BatchInsert("update prodiobarcode set pib_outboxcode1=:pib_outboxcode1 where pib_inoutno='"+ Inoutno + "' and pib_custbarcode=:pib_custbarcode",new string[] { "pib_outboxcode1", "pib_custbarcode" },pib_outboxcode1.ToArray(), ch_code.ToArray());
+            dh.BatchInsert("update prodiobarcode set pib_outboxcode1=:pib_outboxcode1 where pib_inoutno='" + Inoutno + "' and pib_custbarcode=:pib_custbarcode", new string[] { "pib_outboxcode1", "pib_custbarcode" }, pib_outboxcode1.ToArray(), ch_code.ToArray());
+            //删除下载链接再重新插入
+            dh.ExecuteSql("delete from ProdDownLink where pl_inoutno='" + Inoutno + "'", "delete");
+            dh.ExecuteSql("insert into ProdDownLink(pl_inoutno,pl_outboxcode) select distinct '" + Inoutno + "',pib_outboxcode1 from prodiobarcode where pib_inoutno='" + Inoutno + "'", "insert");
             //填充首页
             sumCount = 0;
             totalCount = 0;

+ 12 - 0
UAS-出货标签管理(贸易版)/PublicMethod/HttpHandler.cs

@@ -82,5 +82,17 @@ namespace UAS_LabelMachine.PublicMethod
             }
             return true;
         }
+
+        public static bool GenDownLoadLinK(string Inoutno, out string oMsg)
+        {
+            oMsg = "";
+            string url = DataHelper.ERPAddesss + "common/form/reqDemo.action?pi_inoutno="+ Inoutno;//html调用的地址              
+            HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
+            if (webrequest == null)
+            {
+                return false;
+            }
+            return true;
+        }
     }
 }

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

@@ -2789,4 +2789,4 @@ namespace UAS_LabelMachine
             pre.ShowDialog();
         }
     }
-}
+}