Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master'

章政 7 years ago
parent
commit
3d92491338

+ 3 - 1
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -270,7 +270,7 @@
             // 
             // 
             this.StepCount.LineCode = null;
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(290, 45);
             this.StepCount.Location = new System.Drawing.Point(290, 45);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;
             this.StepCount.Source = null;
@@ -474,6 +474,8 @@
             // CollectRemark
             // CollectRemark
             // 
             // 
             this.CollectRemark.AutoSize = true;
             this.CollectRemark.AutoSize = true;
+            this.CollectRemark.Checked = true;
+            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectRemark.Location = new System.Drawing.Point(565, 426);
             this.CollectRemark.Location = new System.Drawing.Point(565, 426);
             this.CollectRemark.Name = "CollectRemark";
             this.CollectRemark.Name = "CollectRemark";

+ 3 - 1
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -298,6 +298,8 @@
             // CollectRemark
             // CollectRemark
             // 
             // 
             this.CollectRemark.AutoSize = true;
             this.CollectRemark.AutoSize = true;
+            this.CollectRemark.Checked = true;
+            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectRemark.Location = new System.Drawing.Point(563, 439);
             this.CollectRemark.Location = new System.Drawing.Point(563, 439);
             this.CollectRemark.Name = "CollectRemark";
             this.CollectRemark.Name = "CollectRemark";
@@ -347,7 +349,7 @@
             // 
             // 
             this.StepCount.LineCode = null;
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(687, 115);
             this.StepCount.Location = new System.Drawing.Point(687, 115);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;
             this.StepCount.Source = null;

+ 4 - 3
UAS-MES/FunctionCode/Special/Special_BoxSplit.cs

@@ -32,11 +32,13 @@ namespace UAS_MES.Special
         {
         {
             if (dh.CheckExist("package", "pa_outboxcode='" + Pallate.Text + "' and pa_type=3"))
             if (dh.CheckExist("package", "pa_outboxcode='" + Pallate.Text + "' and pa_type=3"))
             {
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select v_barcode from mes_package_view where v_outboxcode='" + Pallate.Text + "'", "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from mes_package_view where v_outboxcode='" + Pallate.Text + "'", "select");
                 List<string> ms_sncode = new List<string>();
                 List<string> ms_sncode = new List<string>();
+                List<string> v_makecode = new List<string>();
                 for (int i = 0; i < dt.Rows.Count; i++)
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                 {
                     ms_sncode.Add(dt.Rows[i]["v_barcode"].ToString());
                     ms_sncode.Add(dt.Rows[i]["v_barcode"].ToString());
+                    v_makecode.Add(dt.Rows[i]["v_makecode"].ToString());
                 }
                 }
                 sql.Clear();
                 sql.Clear();
                 sql.Append("select distinct ms_outboxcode,ms_makecode from makeserial left join mes_package_view on v_makecode=ms_makecode and  ");
                 sql.Append("select distinct ms_outboxcode,ms_makecode from makeserial left join mes_package_view on v_makecode=ms_makecode and  ");
@@ -45,7 +47,6 @@ namespace UAS_MES.Special
                 DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt1.Rows.Count > 0)
                 if (dt1.Rows.Count > 0)
                 {
                 {
-                    string ms_makecode = dt1.Rows[0]["ms_makecode"].ToString();
                     //获取卡通箱的外层箱号
                     //获取卡通箱的外层箱号
                     sql.Clear();
                     sql.Clear();
                     sql.Append("select distinct pa_mothercode from package where pa_outboxcode in(select distinct ms_outboxcode ");
                     sql.Append("select distinct pa_mothercode from package where pa_outboxcode in(select distinct ms_outboxcode ");
@@ -95,7 +96,7 @@ namespace UAS_MES.Special
                     dh.BatchInsert("insert into PACKAGEBACKUPDETAIL select * from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
                     dh.BatchInsert("insert into PACKAGEBACKUPDETAIL select * from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
                     dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
                     dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
                     dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
                     dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
-                    dh.BatchInsert("update makeserial set ms_outboxcode='' where ms_sncode=:ms_sncode and ms_makecode='" + ms_makecode + "' ", new string[] { "ms_sncode" }, ms_sncode.ToArray());
+                    dh.BatchInsert("update makeserial set ms_outboxcode='' where ms_sncode=:ms_sncode and ms_makecode=:ms_makecode", new string[] { "ms_sncode","ms_makecode" }, ms_sncode.ToArray(),v_makecode.ToArray());
                 }
                 }
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "返工栈板解除", "解除成功", Pallate.Text, "");
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "返工栈板解除", "解除成功", Pallate.Text, "");
                 OperatResult.AppendText(">>栈板" + Pallate.Text + "拆解成功\n", Color.Green, Pallate);
                 OperatResult.AppendText(">>栈板" + Pallate.Text + "拆解成功\n", Color.Green, Pallate);

+ 1 - 1
UAS_PRINT/Form2.cs

@@ -66,7 +66,7 @@ namespace UAS_PRINT
                         Stream stream = requestContext.Request.InputStream;
                         Stream stream = requestContext.Request.InputStream;
                         var memoryStream = new MemoryStream();
                         var memoryStream = new MemoryStream();
                         //将基础流写入内存流
                         //将基础流写入内存流
-                        const int bufferLength = 10 * 1024 * 1024;
+                        const int bufferLength = 2 * 1024 * 1024;
                         byte[] buffera = new byte[bufferLength];
                         byte[] buffera = new byte[bufferLength];
                         int actual = stream.Read(buffera, 0, bufferLength);
                         int actual = stream.Read(buffera, 0, bufferLength);
                         if (actual > 0)
                         if (actual > 0)

+ 0 - 2
UAS_PRINT/PrintHandler.cs

@@ -58,7 +58,6 @@ namespace UAS_PRINT
                 {
                 {
                     return;
                     return;
                 }
                 }
-                Console.WriteLine(PrintCode);
                 PrintHelper.SendStringToPrinter(PrinterName, PrintCode);
                 PrintHelper.SendStringToPrinter(PrinterName, PrintCode);
                 PrintDocument pd = new PrintDocument();
                 PrintDocument pd = new PrintDocument();
                 pd.PrinterSettings.PrinterName = PrinterName;
                 pd.PrinterSettings.PrinterName = PrinterName;
@@ -205,7 +204,6 @@ namespace UAS_PRINT
                             if (itemstr.Contains("\\\""))
                             if (itemstr.Contains("\\\""))
                             {
                             {
                                 itemstr = itemstr.Replace("\\\"", "\"");
                                 itemstr = itemstr.Replace("\\\"", "\"");
-                                Console.WriteLine(itemstr);
                             }
                             }
                         }
                         }
                         dr[itemc.Key] = itemstr;
                         dr[itemc.Key] = itemstr;

+ 41 - 2
UAS_Web/Browser.cs

@@ -6,6 +6,9 @@ using CefSharp;
 using CefSharp.WinForms;
 using CefSharp.WinForms;
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Net;
+using System.Text;
+using System.IO;
 
 
 namespace UAS_Web
 namespace UAS_Web
 {
 {
@@ -13,12 +16,14 @@ namespace UAS_Web
     {
     {
 
 
         private ChromiumWebBrowser webBrowser;
         private ChromiumWebBrowser webBrowser;
+ 
 
 
-        public Browser()
+           public Browser()
         {
         {
             InitializeComponent();
             InitializeComponent();
             Text = "供应商条码打印";
             Text = "供应商条码打印";
-            string path = "http://192.168.253.80:8090/ERP/jsps/vendbarcode/login.jsp";
+ 
+            string path = "http://192.168.253.6/uas_dev/jsps/vendbarcode/login.jsp";
             webBrowser = new ChromiumWebBrowser(path)
             webBrowser = new ChromiumWebBrowser(path)
             {
             {
                 Dock = DockStyle.Fill
                 Dock = DockStyle.Fill
@@ -29,6 +34,40 @@ namespace UAS_Web
             webBrowser.DownloadHandler = new DownLoadFile();
             webBrowser.DownloadHandler = new DownLoadFile();
             Controls.Add(webBrowser);
             Controls.Add(webBrowser);
             webBrowser.LoadError += WebBrowser_LoadError;
             webBrowser.LoadError += WebBrowser_LoadError;
+            webBrowser.FrameLoadEnd += FrameLoadEnd;
+            webBrowser.FrameLoadStart += WebBrowser_FrameLoadStart;
+        }
+
+        private void WebBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
+        {
+          
+        }
+
+        void FrameLoadEnd(object sender, FrameLoadEndEventArgs e)
+        {
+            if (e.Url.Contains("vendbarcode/login.jsp") || e.Url.Contains("relogin.action"))
+            {
+                e.Browser.FocusedFrame.EvaluateScriptAsync("document.getElementById('username').value = '"+BaseUtil.GetCacheData("username") +"';document.getElementById('password').value = '"+ BaseUtil.GetCacheData("password") + "';document.getElementById('master').innerHTML = '"+ BaseUtil.GetCacheData("master") + "';document.getElementById('master1').value = '"+ BaseUtil.GetCacheData("master1") + "';", new TimeSpan(600000));
+            }
+                var cookiemanager = CefSharp.Cef.GetGlobalCookieManager();
+                CookieVisitor visitor = new CookieVisitor();
+                visitor.SendCookie += visitor_SendCookie;
+                cookiemanager.VisitAllCookies(visitor);
+        }
+        
+        private void visitor_SendCookie(CefSharp.Cookie obj)
+        {
+            if (obj.Path.Contains("jsps/vendbarcode"))
+            {
+                if (obj.Name == "username")
+                    BaseUtil.SetCacheData("username", obj.Value);
+                if (obj.Name == "password")
+                    BaseUtil.SetCacheData("password", obj.Value);
+                if (obj.Name == "master_name")
+                    BaseUtil.SetCacheData("master_name", obj.Value);
+                if (obj.Name == "master_fun")
+                    BaseUtil.SetCacheData("master_fun", obj.Value);
+            }
         }
         }
 
 
         private void WebBrowser_LoadError(object sender, LoadErrorEventArgs e)
         private void WebBrowser_LoadError(object sender, LoadErrorEventArgs e)

+ 16 - 0
UAS_Web/Program.cs

@@ -1,8 +1,10 @@
 using CefSharp;
 using CefSharp;
 using System;
 using System;
+using System.IO;
 using System.Security.Principal;
 using System.Security.Principal;
 using System.Text;
 using System.Text;
 using System.Windows.Forms;
 using System.Windows.Forms;
+using System.Xml;
 
 
 namespace UAS_Web
 namespace UAS_Web
 {
 {
@@ -30,6 +32,20 @@ namespace UAS_Web
                 Cef.Initialize(setting);
                 Cef.Initialize(setting);
                 Application.EnableVisualStyles();
                 Application.EnableVisualStyles();
                 Application.SetCompatibleTextRenderingDefault(false);
                 Application.SetCompatibleTextRenderingDefault(false);
+                FileStream fcaches = new FileStream(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+                fcaches.Close();
+                FileInfo info = new FileInfo(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml");
+                if (info.Length == 0)
+                {
+                    XmlDocument doc = new XmlDocument();
+                    //创建类型声明节点  
+                    XmlNode node = doc.CreateXmlDeclaration("1.0", "utf-8", "");
+                    doc.AppendChild(node);
+                    //创建根节点  
+                    XmlElement xeRoot = doc.CreateElement("cacheInfo");
+                    doc.AppendChild(xeRoot);
+                    doc.Save(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml");
+                }
                 //如果是管理员的身份
                 //如果是管理员的身份
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                 {
                 {

+ 2 - 0
UAS_Web/UAS_Web.csproj

@@ -120,7 +120,9 @@
     </Compile>
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="tool\BaseUtil.cs" />
     <Compile Include="tool\Code128.cs" />
     <Compile Include="tool\Code128.cs" />
+    <Compile Include="tool\CookieVisitor .cs" />
     <Compile Include="tool\CustomCommand.cs" />
     <Compile Include="tool\CustomCommand.cs" />
     <Compile Include="tool\DownLoadFile.cs" />
     <Compile Include="tool\DownLoadFile.cs" />
     <Compile Include="tool\FilterManager.cs" />
     <Compile Include="tool\FilterManager.cs" />

+ 113 - 0
UAS_Web/tool/BaseUtil.cs

@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace UAS_Web.tool
+{
+    class BaseUtil
+    {
+
+        public static Object GetCacheData(string ParamName)
+        {
+            try
+            {
+                Object o = null;
+                //根据地址读取xml文件
+                XmlDocument doc = new XmlDocument();
+                XmlReaderSettings settings = new XmlReaderSettings { CheckCharacters = false };
+                //忽略文档里面的注释
+                settings.IgnoreComments = true;
+                XmlReader reader = XmlReader.Create(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml", settings);
+                doc.Load(reader);
+                //先得到根节点
+                XmlNode rootNode = doc.SelectSingleNode("cacheInfo");
+                //再由根节点去找制定的节点
+                XmlNodeList nodeList = rootNode.ChildNodes;
+                foreach (XmlNode node in nodeList)
+                {
+                    //找到了这个节点名字
+                    if (node.Name == ParamName)
+                    {
+                        //返回节点的内容
+                        switch (((XmlElement)node).GetAttribute("Type"))
+                        {
+                            case "System.String":
+                                o = node.InnerText;
+                                break;
+                            case "System.Int32":
+                                o = int.Parse(node.InnerText);
+                                break;
+                            case "System.Boolean":
+                                o = node.InnerText == "True" ? true : false;
+                                break;
+                            default:
+                                break;
+                        }
+                        break;
+                    }
+                }
+                //关闭reader
+                reader.Close();
+                if (o == null)
+                    return "";
+                else
+                    return o;
+            }
+            catch (Exception e)
+            {
+        
+                return "";
+            }
+        }
+
+        public static void SetCacheData(string ParamName, object Value)
+        {
+            try
+            {
+                //根据地址读取xml文件
+                XmlDocument doc = new XmlDocument();
+                XmlReaderSettings settings = new XmlReaderSettings { CheckCharacters = false };
+                //忽略文档里面的注释
+                settings.IgnoreComments = true;
+                XmlReader reader = XmlReader.Create(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml", settings);
+                doc.Load(reader);
+                //先得到根节点
+                XmlNode rootNode = doc.SelectSingleNode("cacheInfo");
+                //再由根节点去找制定的节点
+                XmlNodeList nodeList = rootNode.ChildNodes;
+                bool flag = false;
+                foreach (XmlNode node in nodeList)
+                {
+                    //找到了这个节点名字
+                    if (node.Name == ParamName)
+                    {
+                        //就直接赋值
+                        node.InnerText = Value.ToString();
+                        flag = true;
+                    }
+                }
+                //如果没有该节点,就创建节点保存结果
+                if (!flag)
+                {
+                    //创建节点
+                    XmlElement newNode = doc.CreateElement(ParamName);
+                    XmlAttribute attr = doc.CreateAttribute("Type");
+                    attr.InnerText = Value.GetType().ToString();
+                    newNode.InnerText = Value.ToString();
+                    newNode.SetAttributeNode(attr);
+                    //讲新建的节点挂到根节点上
+                    rootNode.AppendChild(newNode);
+                }
+                //关闭Reader
+                reader.Close();
+                doc.Save(System.AppDomain.CurrentDomain.BaseDirectory + "cache.xml");
+            }
+            catch (Exception e)
+            {
+              
+            }
+        }
+    }
+}

+ 28 - 0
UAS_Web/tool/CookieVisitor .cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using CefSharp;
+
+namespace UAS_Web.tool
+{
+    public class CookieVisitor : CefSharp.ICookieVisitor
+    {
+        public event Action<CefSharp.Cookie> SendCookie;
+
+        public void Dispose()
+        {
+            //throw new NotImplementedException();
+        }
+
+        public bool Visit(CefSharp.Cookie cookie, int count, int total, ref bool deleteCookie)
+        {
+            deleteCookie = false;
+            SendCookie?.Invoke(cookie);
+
+            return true;
+
+        }
+
+    }
+}

+ 1 - 1
UAS_Web/tool/MenuHandler.cs

@@ -9,7 +9,7 @@ namespace UAS_Web.tool
             model.Clear();
             model.Clear();
             model.AddItem(CefMenuCommand.Copy, "复制");
             model.AddItem(CefMenuCommand.Copy, "复制");
             model.AddItem(CefMenuCommand.Paste, "粘贴");
             model.AddItem(CefMenuCommand.Paste, "粘贴");
-            model.AddItem(CefMenuCommand.Reload, "重新加载");
+            model.AddItem(CefMenuCommand.ReloadNoCache, "重新加载");
         }
         }
 
 
         public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
         public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)

+ 13 - 20
UAS_Web/tool/RequestHandler.cs

@@ -23,11 +23,7 @@ namespace UAS_Web.tool
 
 
         //打印图片集合
         //打印图片集合
         List<Bitmap> bitmaps = new List<Bitmap>();
         List<Bitmap> bitmaps = new List<Bitmap>();
-
-     
-
         Report BarcodeReport  = new Report();
         Report BarcodeReport  = new Report();
-        Report BoxReport = new Report();
 
 
         //图片打印中间变量
         //图片打印中间变量
         int imagecount = 0;
         int imagecount = 0;
@@ -160,6 +156,8 @@ namespace UAS_Web.tool
                     {
                     {
                         filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
                         filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
                         str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
                         str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
+                        if (str.Contains("不允许打印"))
+                            return;
                         data = ToDictionary(str);
                         data = ToDictionary(str);
                         vendorZplPrint(data);                   
                         vendorZplPrint(data);                   
                     }
                     }
@@ -189,7 +187,7 @@ namespace UAS_Web.tool
                 barcode = (List<Dictionary<string, object>>)((Dictionary<string, object>)data)["barcode"];
                 barcode = (List<Dictionary<string, object>>)((Dictionary<string, object>)data)["barcode"];
             }
             }
             catch {
             catch {
-                MessageBox.Show("打印数据解析异常,请联系管理员进行处理");
+                MessageBox.Show("打印数据异常,请联系管理员");
                 return;
                 return;
             }
             }
             try
             try
@@ -219,16 +217,10 @@ namespace UAS_Web.tool
                     i++;
                     i++;
                 }
                 }
                 if (DownLoadFile.downloading)
                 if (DownLoadFile.downloading)
-                    Console.WriteLine("标签更新有误");
+                    MessageBox.Show("标签更新有误");
                 try
                 try
                 {
                 {
-                    if (type == "box")
-                    {
-                        BoxReport.Load(System.AppDomain.CurrentDomain.BaseDirectory + LABELNAME + ".frx");
-                    }
-                    else {
-                        BarcodeReport.Load(System.AppDomain.CurrentDomain.BaseDirectory + LABELNAME + ".frx");
-                    }
+                  BarcodeReport.Load(System.AppDomain.CurrentDomain.BaseDirectory + LABELNAME + ".frx");   
                 }
                 }
                 catch
                 catch
                 {
                 {
@@ -387,11 +379,11 @@ namespace UAS_Web.tool
                     {
                     {
                         if (type == "box")
                         if (type == "box")
                         {
                         {
-                            BoxReport.RegisterData(dt, "VENDORBARCODE_BOX_VIEW");
-                            BoxReport.GetDataSource("VENDORBARCODE_BOX_VIEW").Enabled = true;
-                            BoxReport.PrintSettings.ShowDialog = false;
-                            BoxReport.PrintSettings.Printer = PrinterName;
-                            BoxReport.Print();
+                            BarcodeReport.RegisterData(dt, "VENDORBARCODE_BOX_VIEW");
+                            BarcodeReport.GetDataSource("VENDORBARCODE_BOX_VIEW").Enabled = true;
+                            BarcodeReport.PrintSettings.ShowDialog = false;
+                            BarcodeReport.PrintSettings.Printer = PrinterName;
+                            BarcodeReport.Print();
                         }
                         }
                         else
                         else
                         {
                         {
@@ -402,13 +394,14 @@ namespace UAS_Web.tool
                             BarcodeReport.Print();
                             BarcodeReport.Print();
                         }
                         }
                     }
                     }
-                    else {
+                    else
+                    {
                         BarcodeReport.RegisterData(dt, labelview);
                         BarcodeReport.RegisterData(dt, labelview);
                         BarcodeReport.GetDataSource(labelview).Enabled = true;
                         BarcodeReport.GetDataSource(labelview).Enabled = true;
                         BarcodeReport.PrintSettings.ShowDialog = false;
                         BarcodeReport.PrintSettings.ShowDialog = false;
                         BarcodeReport.PrintSettings.Printer = PrinterName;
                         BarcodeReport.PrintSettings.Printer = PrinterName;
                         BarcodeReport.Print();
                         BarcodeReport.Print();
-                    }    
+                    }
                 }
                 }
                 catch(Exception ex)
                 catch(Exception ex)
                 {
                 {