callm 6 anni fa
parent
commit
a2c9845721

+ 2 - 1
UAS-出货标签管理(吉利通)/CustomControl/BlurSearch.cs

@@ -2,12 +2,13 @@
 using System.Data;
 using System.Windows.Forms;
 using UAS_LabelMachine;
+using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine.CustomControl
 {
     public partial class BlurSearch : UserControl
     {
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
         public delegate void OnTextChange(object sender, EventArgs e);
 

+ 5 - 4
UAS-出货标签管理(吉利通)/CustomControl/Pagination.cs

@@ -2,6 +2,7 @@
 using System.Data;
 using System.IO;
 using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine.CustomControl
 {
@@ -26,7 +27,7 @@ namespace UAS_LabelMachine.CustomControl
         {
             InitializeComponent();
             //鼠标经过控件的时候显示文字
-            dh = new DataHelper();
+            dh = SystemInf.dh;
             toolTip1.SetToolTip(DownLoadTemplet, "下载模板");
             toolTip1.SetToolTip(UpLoadData, "上传数据");
             toolTip1.SetToolTip(ExportExcel, "导出数据");
@@ -170,7 +171,7 @@ namespace UAS_LabelMachine.CustomControl
         //刷新总页数
         private void RefreshTotalCount()
         {
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             //获取记录的总行数
             if (Condition.Trim() != "")
             {
@@ -216,7 +217,7 @@ namespace UAS_LabelMachine.CustomControl
             {
                 DeleteID[i] = Dgv.SelectedRows[i].Cells[Table_ID].Value.ToString();
             }
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             //取的配置的数据是从DataTable里面判断的,取的是固定字段的Dgv用第二种
             string tablename = TableName;
             if (TableName.Contains("join"))
@@ -245,7 +246,7 @@ namespace UAS_LabelMachine.CustomControl
         {
             //Data表示导出数据
             //Templet表示导出模板
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             folderBrowserDialog1.Description = "选择导出的路径";
             DialogResult result = folderBrowserDialog1.ShowDialog();
             if (result == DialogResult.OK)

+ 2 - 1
UAS-出货标签管理(吉利通)/CustomControl/SearchTextBox.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Data;
 using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
 using UAS_LabelMachine.PublicMethod;
 
 namespace UAS_LabelMachine.CustomControl
@@ -8,7 +9,7 @@ namespace UAS_LabelMachine.CustomControl
     public partial class SearchTextBox : UserControl
     {
 
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
         #region 构造函数
         public SearchTextBox()

+ 5 - 1
UAS-出货标签管理(吉利通)/Entity/SystemInf.cs

@@ -1,4 +1,6 @@
-namespace UAS_LabelMachine.Entity
+using LabelManager2;
+
+namespace UAS_LabelMachine.Entity
 {
     class SystemInf
     {
@@ -9,5 +11,7 @@
         public static SqliteDBHelper adh;
 
         public static SqliteDBHelper back_adh;
+
+        public static ApplicationClass lbl;
     }
 }

+ 2 - 1
UAS-出货标签管理(吉利通)/PublicMethod/ExcelHandler.cs

@@ -4,12 +4,13 @@ using System;
 using NPOI.HSSF.UserModel;
 using NPOI.SS.UserModel;
 using NPOI.HSSF.Util;
+using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine
 {
     class ExcelHandler
     {
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
         /// <summary>
         /// 导出Excel,返回文件在客户端的路径

+ 1 - 1
UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs

@@ -41,7 +41,7 @@ namespace UAS_Labeling.PublicMethod
         /// <returns></returns>
         private bool CheckPower(Control c)
         {
-            dh = new DataHelper();
+            dh = SystemInf.dh;
             if (User.UserAccountType != "admin")
             {
                 {

+ 13 - 13
UAS-出货标签管理(吉利通)/PublicMethod/ftpOperater.cs

@@ -27,19 +27,19 @@ namespace UAS_LabelMachine
         public void UpLoadFile(string filepath, string filename)
         {
             //上传之前判断文件是否存在
-            string[] filelist = GetFileList();
-            if (filelist != null)
-                for (int i = 0; i < filelist.Length; i++)
-                {
-                    if (filelist[i] == filename)
-                    {
-                        string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                        if (upload.ToString() != "Yes")
-                        {
-                            return;
-                        }
-                    }
-                }
+            //string[] filelist = GetFileList();
+            //if (filelist != null)
+            //    for (int i = 0; i < filelist.Length; i++)
+            //    {
+            //        if (filelist[i] == filename)
+            //        {
+            //            string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            //            if (upload.ToString() != "Yes")
+            //            {
+            //                return;
+            //            }
+            //        }
+            //    }
             FtpWebRequest reqFTP;
             reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + filename));
             reqFTP.UseBinary = true;

+ 1 - 14
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -178,6 +178,7 @@ namespace UAS_LabelMachine
             try
             {
                 lbl = new ApplicationClass();
+                SystemInf.lbl = lbl;
             }
             catch (Exception)
             {
@@ -826,20 +827,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void LabelMaintain_Click(object sender, EventArgs e)
-        {
-            客户标签维护 form = new 客户标签维护();
-            BaseUtil.SetFormCenter(form);
-            if (SingleDoc != null)
-                SingleDoc.Close();
-            if (MidDoc != null)
-                MidDoc.Close();
-            if (OutBoxDoc != null)
-                OutBoxDoc.Close();
-            form.FormClosed += LabelFormClose;
-            form.ShowDialog();
-        }
-
         private void LabelFormClose(object sender, EventArgs e)
         {
             if (GetGridOnly.Checked)

+ 1 - 2
UAS-出货标签管理(吉利通)/客户标签维护.cs

@@ -97,7 +97,7 @@ namespace UAS_LabelMachine
             LoadData();
             Width = Width + 1;
             asc.controllInitializeSize(this);
-            lbl = new ApplicationClass();
+            lbl = SystemInf.lbl;
             Width = Width + 1;
         }
 
@@ -306,7 +306,6 @@ namespace UAS_LabelMachine
             try
             {
                 lbl.Documents.CloseAll();
-                lbl.Application.Quit();
             }
             catch (Exception)
             {