浏览代码

取到数据时赋值界面字段

章政 8 年之前
父节点
当前提交
4aaefc0f0e
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

+ 5 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -122,7 +122,7 @@ namespace UAS_MES.Make
                 sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + barcode.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "insert");
                 dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                dh.UpdateByCondition("makeserial", "ms_outboxcode='"+pa_outboxcode.Text+"'", "ms_sncode='"+barcode.Text+"'");
+                dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_sncode='" + barcode.Text + "'");
                 if (LogicHandler.UpdateMakeMessage(barcode.Text, ma_code.Text, "包装采集", User.UserSourceCode, User.UserCode, "装箱成功", out ErrorMessage))
                 {
                     OperateResult.AppendText(">>序列号" + barcode.Text + "采集成功!\n", Color.Green);
@@ -305,7 +305,10 @@ namespace UAS_MES.Make
                 sql.Clear();
                 sql.Append("select ma_prodcode,pr_detail,pr_id,ma_code from product left join make on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                BaseUtil.SetFormValue(this.Controls, dt);
+                if (dt.Rows.Count > 0)
+                {
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                }
             }
         }