Administrator 5 年 前
コミット
faf1dcb5bb

+ 1 - 1
DK.Client/Client.Controls/SearchBox/ScbSAPCode.cs

@@ -182,7 +182,7 @@ namespace Dongke.IBOSS.PRD.Client.Controls.SearchBox
 				string display = this.DisplayMember.ToUpper();
 				if (display.EndsWith("CODE"))
 				{
-					this.SearchForm.SetConditions(this.txtCondition1.Text, base.CheckedData.Copy());
+					this.SearchForm.SetConditions(this.txtCondition1.Text, base.CheckedData?.Copy());
 				}
 				else
 				{

+ 13 - 4
DK.Client/PMModule/F_PM_2302.cs

@@ -186,6 +186,12 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                 {
                     this.SetOrganizationData();
                 }
+                else
+                {
+                    DataTable dt = new DataTable("OrderDetail");
+                    dt.Columns.Add("materialcode");
+                    dgvOrderDetail.DataSource = dt;
+                }
                 this.txtOrderNo.Focus();
             }
             catch (Exception ex)
@@ -324,10 +330,13 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
             order.ValueFlag = 1;
 
             DataTable dt = dgvOrderDetail.DataSource as DataTable;
-            dt.AcceptChanges();
-
-            DataView dv = new DataView(dt);
-            order.OrderDetail = dv.ToTable(true, new string[] { "materialcode" });
+            if (dt!= null)
+            {
+                dt.AcceptChanges();
+                DataView dv = new DataView(dt);
+                order.OrderDetail = dv.ToTable(true, new string[] { "materialcode" });
+            }
+            
             return order;
         }