章政 пре 8 година
родитељ
комит
aa045bbe9d
1 измењених фајлова са 10 додато и 27 уклоњено
  1. 10 27
      UAS-出货标签管理/UAS_出货标签管理.cs

+ 10 - 27
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -195,28 +195,6 @@ namespace UAS_LabelMachine
                 dgv.SortMode = DataGridViewColumnSortMode.NotSortable;
             }
             int ScreenWidth = Screen.GetWorkingArea(pt).Width;
-            //如果分辨率大的设置的字体对应的变大 
-            //if (ScreenWidth > 1366)
-            //{
-            //    foreach (Control ctl in Controls)
-            //    {
-            //        if (ctl is CheckBox || ctl is Label || ctl is RadioButton)
-            //        {
-            //            ctl.Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
-            //        }
-            //        if (ctl is GroupBoxWithBorder)
-            //        {
-            //            GroupBoxWithBorder gb = ctl as GroupBoxWithBorder;
-            //            for (int i = 0; i < gb.Controls.Count; i++)
-            //            {
-            //                if (gb.Controls[i] is CheckBox || gb.Controls[i] is Label || gb.Controls[i] is RadioButton)
-            //                {
-            //                    gb.Controls[i].Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
-            //                }
-            //            }
-            //        }
-            //    }
-            //}
             //设置获取当前屏幕大小自动全屏但是保留任务栏
             Rectangle ScreenArea = Screen.GetWorkingArea(this);
             Top = 0;
@@ -1341,7 +1319,7 @@ namespace UAS_LabelMachine
                         string sql = dt.Rows[k]["lp_sql"].ToString();
                         sql = sql.Substring(0, sql.IndexOf("{"));
                         sql = sql.Substring(0, sql.LastIndexOf("="));
-                        DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in " + pib_id_string.ToString() + " ORDER by pib_id");
+                        DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in (select pib_id from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "') ORDER by pib_id");
                         temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
                         AllSingleBoxCacheData.Add(temp);
                     }
@@ -1428,17 +1406,17 @@ namespace UAS_LabelMachine
                         MidBoxCacheData.Columns.Add(dc);
                         MidBoxArgument.Add(MidDoc.Variables.FreeVariables.Item(j + 1).Name);
                         string sql = dt.Rows[k]["lp_sql"].ToString();
+                        //如果打印的含有数量
                         if (sql.ToLower().Contains("pib_qty"))
                         {
                             sql = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                            sql = sql.Substring(0, sql.LastIndexOf("=")) + " in " + pib_qtycondition_string.ToString() + sql.Substring(sql.LastIndexOf("}") + 1);
-                            sql = "select * from (" + sql + ") order by instr ('" + pib_qtycondition_string.ToString() + "',pib_outboxcode1)";
+                            sql = sql.Substring(0, sql.LastIndexOf("=")) + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + sql.Substring(sql.LastIndexOf("}") + 1);
                         }
                         else
                         {
                             sql = sql.Substring(0, sql.IndexOf("{"));
                             sql = sql.Substring(0, sql.LastIndexOf("="));
-                            sql = sql + " in " + pib_condition_string.ToString() + " order by instr('" + pib_condition_string.ToString() + "',pib_id)";
+                            sql = sql + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + " and pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode1)";
                         }
                         DataTable temp = dh.getFieldsDatasByCondition(sql);
                         temp.Columns[0].ColumnName = MidDoc.Variables.FreeVariables.Item(j + 1).Name;
@@ -1664,7 +1642,12 @@ namespace UAS_LabelMachine
                                         MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[rowindex].Cells["pib_datecode"].Value.ToString();
                                 }
                                 else if (arg.Contains(MidDoc.Variables.FreeVariables.Item(j + 1).Name))
-                                    MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][MidDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
+                                {
+                                    if (dr.Length > 0)
+                                    {
+                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][MidDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
+                                    }
+                                }
                                 LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
                             }
                         }