Browse Source

账套问题修改

callm 4 years ago
parent
commit
edc7989319

+ 62 - 97
UAS-出货标签管理(贸易版)/DateCodeSetAndPrint.Designer.cs

@@ -28,51 +28,22 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.SetValueAndPrint = new System.Windows.Forms.Button();
-            this.loadingCircle1 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
             this.SetValue = new System.Windows.Forms.Button();
             this.lotno_label = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
             this.lotno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.datecode = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.Nums = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.Begin = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.loadingCircle2 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
+            this.End = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.label2 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
-            // SetValueAndPrint
-            // 
-            this.SetValueAndPrint.Location = new System.Drawing.Point(191, 168);
-            this.SetValueAndPrint.Margin = new System.Windows.Forms.Padding(2);
-            this.SetValueAndPrint.Name = "SetValueAndPrint";
-            this.SetValueAndPrint.Size = new System.Drawing.Size(77, 20);
-            this.SetValueAndPrint.TabIndex = 0;
-            this.SetValueAndPrint.Text = "设置并打印";
-            this.SetValueAndPrint.UseVisualStyleBackColor = true;
-            // 
-            // loadingCircle1
-            // 
-            this.loadingCircle1.Active = false;
-            this.loadingCircle1.Color = System.Drawing.Color.DarkGray;
-            this.loadingCircle1.InnerCircleRadius = 5;
-            this.loadingCircle1.Location = new System.Drawing.Point(205, 80);
-            this.loadingCircle1.Margin = new System.Windows.Forms.Padding(2);
-            this.loadingCircle1.Name = "loadingCircle1";
-            this.loadingCircle1.NumberSpoke = 12;
-            this.loadingCircle1.OuterCircleRadius = 11;
-            this.loadingCircle1.RotationSpeed = 100;
-            this.loadingCircle1.Size = new System.Drawing.Size(0, 0);
-            this.loadingCircle1.SpokeThickness = 2;
-            this.loadingCircle1.StylePreset = UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle.StylePresets.MacOSX;
-            this.loadingCircle1.TabIndex = 2;
-            this.loadingCircle1.Text = "loadingCircle1";
-            // 
             // SetValue
             // 
-            this.SetValue.Location = new System.Drawing.Point(106, 168);
-            this.SetValue.Margin = new System.Windows.Forms.Padding(2);
+            this.SetValue.Location = new System.Drawing.Point(295, 299);
+            this.SetValue.Margin = new System.Windows.Forms.Padding(4);
             this.SetValue.Name = "SetValue";
-            this.SetValue.Size = new System.Drawing.Size(71, 20);
+            this.SetValue.Size = new System.Drawing.Size(142, 40);
             this.SetValue.TabIndex = 3;
             this.SetValue.Text = "设置值";
             this.SetValue.UseVisualStyleBackColor = true;
@@ -80,76 +51,54 @@
             // lotno_label
             // 
             this.lotno_label.AutoSize = true;
-            this.lotno_label.Location = new System.Drawing.Point(68, 46);
-            this.lotno_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lotno_label.Location = new System.Drawing.Point(136, 214);
+            this.lotno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lotno_label.Name = "lotno_label";
-            this.lotno_label.Size = new System.Drawing.Size(35, 12);
+            this.lotno_label.Size = new System.Drawing.Size(58, 24);
             this.lotno_label.TabIndex = 4;
-            this.lotno_label.Text = "LotNo";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(68, 88);
-            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(53, 12);
-            this.label2.TabIndex = 5;
-            this.label2.Text = "DateCode";
+            this.lotno_label.Text = "批号";
             // 
             // lotno
             // 
             this.lotno.ID = null;
-            this.lotno.Location = new System.Drawing.Point(134, 44);
-            this.lotno.Margin = new System.Windows.Forms.Padding(2);
+            this.lotno.Location = new System.Drawing.Point(268, 206);
+            this.lotno.Margin = new System.Windows.Forms.Padding(4);
             this.lotno.Name = "lotno";
-            this.lotno.Size = new System.Drawing.Size(152, 21);
+            this.lotno.Size = new System.Drawing.Size(228, 35);
             this.lotno.Str = null;
             this.lotno.Str1 = null;
             this.lotno.Str2 = null;
             this.lotno.TabIndex = 6;
             // 
-            // datecode
-            // 
-            this.datecode.ID = null;
-            this.datecode.Location = new System.Drawing.Point(134, 83);
-            this.datecode.Margin = new System.Windows.Forms.Padding(2);
-            this.datecode.Name = "datecode";
-            this.datecode.Size = new System.Drawing.Size(152, 21);
-            this.datecode.Str = null;
-            this.datecode.Str1 = null;
-            this.datecode.Str2 = null;
-            this.datecode.TabIndex = 7;
-            // 
-            // Nums
-            // 
-            this.Nums.ID = null;
-            this.Nums.Location = new System.Drawing.Point(134, 123);
-            this.Nums.Margin = new System.Windows.Forms.Padding(2);
-            this.Nums.Name = "Nums";
-            this.Nums.Size = new System.Drawing.Size(152, 21);
-            this.Nums.Str = null;
-            this.Nums.Str1 = null;
-            this.Nums.Str2 = null;
-            this.Nums.TabIndex = 10;
+            // Begin
+            // 
+            this.Begin.ID = null;
+            this.Begin.Location = new System.Drawing.Point(268, 143);
+            this.Begin.Margin = new System.Windows.Forms.Padding(4);
+            this.Begin.Name = "Begin";
+            this.Begin.Size = new System.Drawing.Size(86, 35);
+            this.Begin.Str = null;
+            this.Begin.Str1 = null;
+            this.Begin.Str2 = null;
+            this.Begin.TabIndex = 10;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(68, 128);
-            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Location = new System.Drawing.Point(136, 149);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(29, 12);
+            this.label1.Size = new System.Drawing.Size(58, 24);
             this.label1.TabIndex = 9;
-            this.label1.Text = "数量";
+            this.label1.Text = "序号";
             // 
             // loadingCircle2
             // 
             this.loadingCircle2.Active = false;
             this.loadingCircle2.Color = System.Drawing.Color.DarkGray;
             this.loadingCircle2.InnerCircleRadius = 5;
-            this.loadingCircle2.Location = new System.Drawing.Point(205, 120);
-            this.loadingCircle2.Margin = new System.Windows.Forms.Padding(2);
+            this.loadingCircle2.Location = new System.Drawing.Point(410, 137);
+            this.loadingCircle2.Margin = new System.Windows.Forms.Padding(4);
             this.loadingCircle2.Name = "loadingCircle2";
             this.loadingCircle2.NumberSpoke = 12;
             this.loadingCircle2.OuterCircleRadius = 11;
@@ -160,42 +109,58 @@
             this.loadingCircle2.TabIndex = 8;
             this.loadingCircle2.Text = "loadingCircle2";
             // 
+            // End
+            // 
+            this.End.ID = null;
+            this.End.Location = new System.Drawing.Point(410, 143);
+            this.End.Margin = new System.Windows.Forms.Padding(4);
+            this.End.Name = "End";
+            this.End.Size = new System.Drawing.Size(86, 35);
+            this.End.Str = null;
+            this.End.Str1 = null;
+            this.End.Str2 = null;
+            this.End.TabIndex = 11;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(371, 148);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(22, 24);
+            this.label2.TabIndex = 12;
+            this.label2.Text = "-";
+            // 
             // DateCodeSetAndPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(365, 212);
-            this.Controls.Add(this.Nums);
+            this.ClientSize = new System.Drawing.Size(730, 397);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.End);
+            this.Controls.Add(this.Begin);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.loadingCircle2);
-            this.Controls.Add(this.datecode);
             this.Controls.Add(this.lotno);
-            this.Controls.Add(this.label2);
             this.Controls.Add(this.lotno_label);
             this.Controls.Add(this.SetValue);
-            this.Controls.Add(this.loadingCircle1);
-            this.Controls.Add(this.SetValueAndPrint);
-            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "DateCodeSetAndPrint";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "DateCodeSetAndPrint";
-            this.Load += new System.EventHandler(this.DateCodeSetAndPrint_Load);
+            this.Text = "更新批号";
             this.ResumeLayout(false);
             this.PerformLayout();
 
         }
 
         #endregion
-
-        private System.Windows.Forms.Button SetValueAndPrint;
-        private CustomControl.SetLoading.LoadingCircle loadingCircle1;
         private System.Windows.Forms.Button SetValue;
         private System.Windows.Forms.Label lotno_label;
-        private System.Windows.Forms.Label label2;
         private CustomControl.EnterTextBox lotno;
-        private CustomControl.EnterTextBox datecode;
-        private CustomControl.EnterTextBox Nums;
+        private CustomControl.EnterTextBox Begin;
         private System.Windows.Forms.Label label1;
         private CustomControl.SetLoading.LoadingCircle loadingCircle2;
+        private CustomControl.EnterTextBox End;
+        private System.Windows.Forms.Label label2;
     }
 }

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

@@ -15,10 +15,5 @@ namespace UAS_LabelMachine
         {
             InitializeComponent();
         }
-
-        private void DateCodeSetAndPrint_Load(object sender, EventArgs e)
-        {
-
-        }
     }
 }

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

@@ -3572,7 +3572,6 @@ namespace UAS_LabelMachine
                             BoxCode = BoxCode + 1;
                             for (int j = 0; j < ShowColumnCount; j++)
                             {
-
                                 row1.CreateCell(j);
                                 if (j == 0)
                                 {
@@ -3820,7 +3819,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowPieceIndex)
                                 {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum);
+                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum+1);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == ShowCountIndex)
@@ -3845,7 +3844,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (j == ShowPieceIndex)
                                 {
-                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum);
+                                    row1.Cells[ShowPieceIndex].SetCellValue(PageNum+1);
                                     row1.Cells[j].CellStyle = styleborder;
                                 }
                                 else if (j == ShowCountIndex)

+ 11 - 4
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -111,7 +111,8 @@ namespace UAS_LabelMachine.PublicMethod
 
         public static void ImportExcel(string iMaster, string iFileName, string iPiID, string iInOutNo, string iCustCode)
         {
-            switch (iMaster)
+            string config = dh.GetConfig("Master", "PrintMaster").ToString();
+            switch (config)
             {
                 //海创
                 case "N_HC":
@@ -396,8 +397,13 @@ namespace UAS_LabelMachine.PublicMethod
                             pdprodcode.Add(pd_prodcode);
                         }
                     }
-                    outqty -= outsumqty[pr_spec][pd_pdno];
+                    if (outqty - outsumqty[pr_spec][pd_pdno] > 0)
+                        outqty -= outsumqty[pr_spec][pd_pdno];
                     outsumqty[pr_spec][pd_pdno] -= pd_outqty;
+                    if (outsumqty[pr_spec][pd_pdno] >= pd_outqty)
+                    {
+                        break;
+                    }
                 }
             }
             string Lastoutbox = "";
@@ -482,7 +488,8 @@ namespace UAS_LabelMachine.PublicMethod
             return str;
         }
 
-        public static void GetDataSQL(string iInoutno,string iText,string iNumOrRate,out string oSQL) {
+        public static void GetDataSQL(string iInoutno, string iText, string iNumOrRate, out string oSQL)
+        {
             oSQL = "";
             string[] param = new string[] { iInoutno, iText, iNumOrRate, oSQL };
             dh.CallProcedure("SP_GETDATASQL1", ref param);
@@ -491,7 +498,7 @@ namespace UAS_LabelMachine.PublicMethod
 
         public static void GenHFEData(string iInoutno)
         {
-            string[] param = new string[] { iInoutno};
+            string[] param = new string[] { iInoutno };
             dh.CallProcedure("sp_InsertHFE", ref param);
         }
     }

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

@@ -0,0 +1,201 @@
+namespace UAS_LabelMachine
+{
+    partial class SetLotNo
+    {
+        /// <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.SetValueAndPrint = new System.Windows.Forms.Button();
+            this.loadingCircle1 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
+            this.SetValue = new System.Windows.Forms.Button();
+            this.lotno_label = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.lotno = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.datecode = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.Nums = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.loadingCircle2 = new UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle();
+            this.SuspendLayout();
+            // 
+            // SetValueAndPrint
+            // 
+            this.SetValueAndPrint.Location = new System.Drawing.Point(191, 168);
+            this.SetValueAndPrint.Margin = new System.Windows.Forms.Padding(2);
+            this.SetValueAndPrint.Name = "SetValueAndPrint";
+            this.SetValueAndPrint.Size = new System.Drawing.Size(77, 20);
+            this.SetValueAndPrint.TabIndex = 0;
+            this.SetValueAndPrint.Text = "设置并打印";
+            this.SetValueAndPrint.UseVisualStyleBackColor = true;
+            // 
+            // loadingCircle1
+            // 
+            this.loadingCircle1.Active = false;
+            this.loadingCircle1.Color = System.Drawing.Color.DarkGray;
+            this.loadingCircle1.InnerCircleRadius = 5;
+            this.loadingCircle1.Location = new System.Drawing.Point(205, 80);
+            this.loadingCircle1.Margin = new System.Windows.Forms.Padding(2);
+            this.loadingCircle1.Name = "loadingCircle1";
+            this.loadingCircle1.NumberSpoke = 12;
+            this.loadingCircle1.OuterCircleRadius = 11;
+            this.loadingCircle1.RotationSpeed = 100;
+            this.loadingCircle1.Size = new System.Drawing.Size(0, 0);
+            this.loadingCircle1.SpokeThickness = 2;
+            this.loadingCircle1.StylePreset = UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle.StylePresets.MacOSX;
+            this.loadingCircle1.TabIndex = 2;
+            this.loadingCircle1.Text = "loadingCircle1";
+            // 
+            // SetValue
+            // 
+            this.SetValue.Location = new System.Drawing.Point(106, 168);
+            this.SetValue.Margin = new System.Windows.Forms.Padding(2);
+            this.SetValue.Name = "SetValue";
+            this.SetValue.Size = new System.Drawing.Size(71, 20);
+            this.SetValue.TabIndex = 3;
+            this.SetValue.Text = "设置值";
+            this.SetValue.UseVisualStyleBackColor = true;
+            // 
+            // lotno_label
+            // 
+            this.lotno_label.AutoSize = true;
+            this.lotno_label.Location = new System.Drawing.Point(68, 46);
+            this.lotno_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lotno_label.Name = "lotno_label";
+            this.lotno_label.Size = new System.Drawing.Size(35, 12);
+            this.lotno_label.TabIndex = 4;
+            this.lotno_label.Text = "LotNo";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(68, 88);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(53, 12);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "DateCode";
+            // 
+            // lotno
+            // 
+            this.lotno.ID = null;
+            this.lotno.Location = new System.Drawing.Point(134, 44);
+            this.lotno.Margin = new System.Windows.Forms.Padding(2);
+            this.lotno.Name = "lotno";
+            this.lotno.Size = new System.Drawing.Size(152, 21);
+            this.lotno.Str = null;
+            this.lotno.Str1 = null;
+            this.lotno.Str2 = null;
+            this.lotno.TabIndex = 6;
+            // 
+            // datecode
+            // 
+            this.datecode.ID = null;
+            this.datecode.Location = new System.Drawing.Point(134, 83);
+            this.datecode.Margin = new System.Windows.Forms.Padding(2);
+            this.datecode.Name = "datecode";
+            this.datecode.Size = new System.Drawing.Size(152, 21);
+            this.datecode.Str = null;
+            this.datecode.Str1 = null;
+            this.datecode.Str2 = null;
+            this.datecode.TabIndex = 7;
+            // 
+            // Nums
+            // 
+            this.Nums.ID = null;
+            this.Nums.Location = new System.Drawing.Point(134, 123);
+            this.Nums.Margin = new System.Windows.Forms.Padding(2);
+            this.Nums.Name = "Nums";
+            this.Nums.Size = new System.Drawing.Size(152, 21);
+            this.Nums.Str = null;
+            this.Nums.Str1 = null;
+            this.Nums.Str2 = null;
+            this.Nums.TabIndex = 10;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(68, 128);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(29, 12);
+            this.label1.TabIndex = 9;
+            this.label1.Text = "数量";
+            // 
+            // loadingCircle2
+            // 
+            this.loadingCircle2.Active = false;
+            this.loadingCircle2.Color = System.Drawing.Color.DarkGray;
+            this.loadingCircle2.InnerCircleRadius = 5;
+            this.loadingCircle2.Location = new System.Drawing.Point(205, 120);
+            this.loadingCircle2.Margin = new System.Windows.Forms.Padding(2);
+            this.loadingCircle2.Name = "loadingCircle2";
+            this.loadingCircle2.NumberSpoke = 12;
+            this.loadingCircle2.OuterCircleRadius = 11;
+            this.loadingCircle2.RotationSpeed = 100;
+            this.loadingCircle2.Size = new System.Drawing.Size(0, 0);
+            this.loadingCircle2.SpokeThickness = 2;
+            this.loadingCircle2.StylePreset = UAS_LabelMachine.CustomControl.SetLoading.LoadingCircle.StylePresets.MacOSX;
+            this.loadingCircle2.TabIndex = 8;
+            this.loadingCircle2.Text = "loadingCircle2";
+            // 
+            // DateCodeSetAndPrint
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(365, 212);
+            this.Controls.Add(this.Nums);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.loadingCircle2);
+            this.Controls.Add(this.datecode);
+            this.Controls.Add(this.lotno);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.lotno_label);
+            this.Controls.Add(this.SetValue);
+            this.Controls.Add(this.loadingCircle1);
+            this.Controls.Add(this.SetValueAndPrint);
+            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Name = "DateCodeSetAndPrint";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "DateCodeSetAndPrint";
+            this.Load += new System.EventHandler(this.DateCodeSetAndPrint_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button SetValueAndPrint;
+        private CustomControl.SetLoading.LoadingCircle loadingCircle1;
+        private System.Windows.Forms.Button SetValue;
+        private System.Windows.Forms.Label lotno_label;
+        private System.Windows.Forms.Label label2;
+        private CustomControl.EnterTextBox lotno;
+        private CustomControl.EnterTextBox datecode;
+        private CustomControl.EnterTextBox Nums;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.SetLoading.LoadingCircle loadingCircle2;
+    }
+}

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

@@ -0,0 +1,24 @@
+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 SetLotNo : Form
+    {
+        public SetLotNo()
+        {
+            InitializeComponent();
+        }
+
+        private void DateCodeSetAndPrint_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

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

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

@@ -232,6 +232,12 @@
     <Compile Include="CustomerRule.Designer.cs">
       <DependentUpon>CustomerRule.cs</DependentUpon>
     </Compile>
+    <Compile Include="SetLotNo.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="SetLotNo.Designer.cs">
+      <DependentUpon>SetLotNo.cs</DependentUpon>
+    </Compile>
     <Compile Include="DateCodeSetAndPrint.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -378,6 +384,9 @@
     <EmbeddedResource Include="CustomerRule.resx">
       <DependentUpon>CustomerRule.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="SetLotNo.resx">
+      <DependentUpon>SetLotNo.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="DateCodeSetAndPrint.resx">
       <DependentUpon>DateCodeSetAndPrint.cs</DependentUpon>
     </EmbeddedResource>

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

@@ -1406,7 +1406,7 @@ namespace UAS_LabelMachine
                 MidBoxArgument.Clear();
                 List<int> MidOutBoxCode = new List<int>();
                 List<int> MidOutBoxCodeIndex = new List<int>();
-                for (int i = (begin == 0 ? 0 : begin); i <= (end ); i++)
+                for (int i = (begin == 0 ? 0 : begin); i <= (end); i++)
                 {
                     string outboxcode1 = LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString();
                     if (outboxcode1 != "")
@@ -1732,7 +1732,9 @@ namespace UAS_LabelMachine
             {
                 //检验查询的字段和本地数据库字段是否匹配
                 sdh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
-                sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
+                sdh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
+                sdh.SaveDataTable(LabelInfDataTable, "prodiobarcode");
+                //sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
             }
             sql.Clear();
             sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by cast(pib_outboxcode1 as int)");
@@ -2641,7 +2643,7 @@ namespace UAS_LabelMachine
                 rowindex = e.RowIndex;
                 DateCodeSetAndPrint date = new DateCodeSetAndPrint();
                 date.Controls["SetValue"].Click += SetValue_ButtonClick;
-                date.Controls["SetValueAndPrint"].Click += SetValueAndPrint_ButtonClick;
+                //date.Controls["SetValueAndPrint"].Click += SetValueAndPrint_ButtonClick;
                 date.ShowDialog();
             }
         }
@@ -2651,32 +2653,55 @@ namespace UAS_LabelMachine
             Button setvalue = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
             string pr_brand = LabelInf.Rows[rowindex].Cells["pib_brand"].Value.ToString();
-            string datecode = setvalue.FindForm().Controls["datecode"].Text;
+            //string datecode = setvalue.FindForm().Controls["datecode"].Text;
+
             string lotno = setvalue.FindForm().Controls["lotno"].Text;
-            string nums = setvalue.FindForm().Controls["Nums"].Text;
-            string year = "0";
-            string month = "0";
-            string day = "0";
-            string date = "";
-            string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
-            if (datecode != "")
-            {
-                LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
-                sql += "  and (pib_datecode='' or pib_datecode is null) ";
-            }
-            if (lotno != "")
-            {
-                sql += " and (pib_lotno='' or pib_lotno is null) ";
-            }
-            if (nums == "")
-            {
-                sql += ")";
-            }
-            else
+            string BeginRow = setvalue.FindForm().Controls["Begin"].Text;
+            string EndRow = setvalue.FindForm().Controls["End"].Text;
+            //string year = "0";
+            //string month = "0";
+            //string day = "0";
+            //string date = "";
+            //string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "'";
+            //if (datecode != "")
+            //{
+            //    //LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
+            //    sql += "  and (pib_datecode='' or pib_datecode is null) ";
+            //}
+            //if (lotno != "")
+            //{
+            //    sql += " and (pib_lotno='' or pib_lotno is null) ";
+            //}
+            List<string> pib_id = new List<string>();
+            if (BeginRow != "" || EndRow != "")
             {
-                sql += " limit 0," + nums + ")";
+                try
+                {
+                    int begin = int.Parse(BeginRow == "" ? "1" : BeginRow);
+                    int end = int.Parse(EndRow == "" ? LabelInf.Rows.Count.ToString() : EndRow);
+                    if (begin > 0 && end <= LabelInf.Rows.Count && begin <= end)
+                    {
+                        for (int i = begin - 1; i < end; i++)
+                        {
+                            pib_id.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
+                        }
+                    }
+                    else
+                    {
+                        MessageBox.Show("范围设置错误");
+                        return;
+                    }
+                    LabelInf.Invalidate();
+                }
+                catch (Exception)
+                {
+                    MessageBox.Show("范围设置错误");
+                    return;
+                }
             }
-            sdh.ExecuteSql(sql, "update");
+            dh.BatchInsert("update prodiobarcode set pib_lotno='" + lotno + "' where pib_id=:pib_id", new string[] { "pib_id" }, pib_id.ToArray());
+            //同步数据到本地
+            sdh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
             LoadGridData(false);
             setvalue.FindForm().Close();
         }
@@ -2693,11 +2718,11 @@ namespace UAS_LabelMachine
             string month = "0";
             string day = "0";
             string date = "";
-            string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
+            string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "'";
             string PrintSQL = "select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
             if (datecode != "")
             {
-                LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
+                //LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
                 sql += " and (pib_datecode='' or pib_datecode is null) ";
                 PrintSQL += " and (pib_datecode='' or pib_datecode is null) ";
             }