Pārlūkot izejas kodu

去除多余代码

章政 7 gadi atpakaļ
vecāks
revīzija
7b98dfa10b

+ 1 - 1
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -53,7 +53,7 @@ namespace UAS_LabelMachine
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "ZT_TEST";
+        public static readonly string Masters = "ZT_TEST,ZT";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         static OracleConnection connection = null;

+ 3 - 25
UAS-出货标签管理(泽天)/客户标签维护.cs

@@ -24,9 +24,6 @@ namespace UAS_LabelMachine
         //用于拼接条件查询
         StringBuilder condition = new StringBuilder();
         StringBuilder sql = new StringBuilder();
-        /*CodeSoft新建打印机引擎*/
-        ApplicationClass lbl;
-        Document doc;
         /*BarTender新建打印机引擎*/
         //private Engine engine = null;
         //private LabelFormatDocument format ;
@@ -78,7 +75,7 @@ namespace UAS_LabelMachine
 
             la_code.FormName = Name;
             la_code.SetValueField = new string[] { "la_code" };
-            la_code.TableName = "label";
+            la_code.TableName = "(select * from label order by la_id)";
             la_code.SelectField = "la_code # 模板编号,la_name # 模板名称";
             NetURL.Text = Settings.Default.ShareUrl;
         }
@@ -97,7 +94,6 @@ namespace UAS_LabelMachine
             LoadData();
             Width = Width + 1;
             asc.controllInitializeSize(this);
-            lbl = new ApplicationClass();
             Width = Width + 1;
         }
 
@@ -105,10 +101,6 @@ namespace UAS_LabelMachine
         {
             if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "预览")
             {
-                if (lbl.Documents.Count > 0)
-                {
-                    lbl.ActiveDocument.Close();
-                }
                 //获取路径和标签名称
                 LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelurl"].Value.ToString();
                 LabelCode = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelcode"].Value.ToString();
@@ -123,18 +115,6 @@ namespace UAS_LabelMachine
                 {
                     time = System.DateTime.Now;
                 }
-                if (CodeSoft.Checked)
-                {
-                    string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
-                    doc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelPath, LabelName,time));
-                    Bitmap bit = new Bitmap(doc.CopyImageToFile());
-                    pictureBox1.Image = bit;
-                    //如果文件已不存在则进行提示
-                    if (doc == null)
-                    {
-                        return;
-                    }
-                }
             }
             if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "编辑")
             {
@@ -296,8 +276,7 @@ namespace UAS_LabelMachine
         {
             if (LabelCode != "")
             {
-                doc.Printer.SwitchTo(PrinterList.Text);
-                doc.PrintDocument();
+       
             }
         }
 
@@ -305,8 +284,7 @@ namespace UAS_LabelMachine
         {
             try
             {
-                lbl.Documents.CloseAll();
-                lbl.Application.Quit();
+           
             }
             catch (Exception)
             {