chenhaozhe
2026-03-05 f66d4e7970b06a9842a9364845ea8a83c0169712
DAL/ClsWL_YayBillMain.cs
@@ -126,6 +126,7 @@
                ",HSurer_Trans='" + omodel.HSurer_Trans.ToString() + "'" +
                ",HDate_Trans='" + omodel.HDate_Trans.ToString() + "'" +
                ",HSurer_Receive='" + omodel.HSurer_Receive.ToString() + "'" +
                ",HExRate='" + omodel.HExRate.ToString() + "'" +
                ",HDate_Receive='" + omodel.HDate_Receive.ToString() + "'" +
                ",HSurer_Accounting='" + omodel.HSurer_Accounting.ToString() + "'" +
                ",HDate_Accounting='" + omodel.HDate_Accounting.ToString() + "'" +
@@ -144,7 +145,7 @@
               "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
               ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
               ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" +
               ",HMouldFoldHeight,HVolume,HQty,HSNP,HMouldQty) values("
               ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values("
               + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int
               + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50)
               + (oSub.HEntryID) + ",'" // HEntryID int
@@ -168,6 +169,7 @@
               + (oSub.HVolume.ToString() == "" ? 0 : oSub.HVolume) + "," // HVolume dec(18,8)
               + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8)
               + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8)
               + (oSub.HScatteredVolume) + "," // HSNP dec(18,8)
               + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8)
                    oCn.RunProc(sql);
                }
@@ -229,6 +231,7 @@
                // 获取当前日期时间,用于空日期字段的默认值
                // 获取当前日期时间
                string currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                string safeDateTime = "2000-01-01";
                // 辅助方法:安全转换为字符串,处理null和空字符串
@@ -245,7 +248,7 @@
                           "HTransportTyep,HSSID,HCurID,HMoney,HDateForRequestedPick," +
                           "HDataForRequestedArrived,HCarryStatus,HDate_CarrierSure," +
                           "HDate_AllocationDriver,HCarID,HDriverID,HSurer_Arrive,HDate_Arrive," +
                           "HSurer_Pick,HDate_Pick,HSurer_Trans,HDate_Trans,HSurer_Receive," +
                           "HSurer_Pick,HDate_Pick,HSurer_Trans,HDate_Trans,HSurer_Receive,HExRate," +
                           "HDate_Receive,HSurer_Accounting,HDate_Accounting) " +
                           "values(" +
                           SafeInt(omodel.HInterID.ToString(), 0) + "," + // HInterID
@@ -301,20 +304,21 @@
                           SafeDateTime(omodel.HDateForRequestedPick?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeDateTime(omodel.HDataForRequestedArrived?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeInt(omodel.HCarryStatus?.ToString(), 1) + "," + // HCarryStatus
                           SafeDateTime(omodel.HDate_CarrierSure?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeDateTime(omodel.HDate_CarrierSure?.ToString(), "'" + safeDateTime + "'") + "," +
                           SafeDateTime(omodel.HDate_AllocationDriver?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeInt(omodel.HCarID?.ToString(), 0) + "," + // HCarID
                           SafeInt(omodel.HDriverID?.ToString(), 0) + "," + // HDriverID
                           "'" + SafeString(omodel.HSurer_Arrive) + "'," +
                           SafeDateTime(omodel.HDate_Arrive?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeDateTime(omodel.HDate_Arrive?.ToString(), "'" + safeDateTime + "'") + "," +
                           "'" + SafeString(omodel.HSurer_Pick) + "'," +
                           SafeDateTime(omodel.HDate_Pick?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeDateTime(omodel.HDate_Pick?.ToString(), "'" + safeDateTime + "'") + "," +
                           "'" + SafeString(omodel.HSurer_Trans) + "'," +
                           SafeDateTime(omodel.HDate_Trans?.ToString(), "'" + currentDateTime + "'") + "," +
                           SafeDateTime(omodel.HDate_Trans?.ToString(), "'" + safeDateTime + "'") + "," +
                           "'" + SafeString(omodel.HSurer_Receive) + "'," +
                           SafeDateTime(omodel.HDate_Receive?.ToString(), "'" + currentDateTime + "'") + "," +
                           "'" + omodel.HExRate + "'," +
                           SafeDateTime(omodel.HDate_Receive?.ToString(), "'" + safeDateTime + "'") + "," +
                           "'" + SafeString(omodel.HSurer_Accounting) + "'," +
                           SafeDateTime(omodel.HDate_Accounting?.ToString(), "'" + currentDateTime + "'") + ")";
                           SafeDateTime(omodel.HDate_Accounting?.ToString(), "'" + safeDateTime + "'") + ")";
                oCn.RunProc(sql);
                //主表              
@@ -326,7 +330,7 @@
              "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
              ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
              ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" +
              ",HMouldFoldHeight,HVolume,HQty,HSNP,HMouldQty) values("
              ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values("
              + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int
              + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50)
              + (oSub.HEntryID) + ",'" // HEntryID int
@@ -350,6 +354,7 @@
              + (oSub.HVolume.ToString() == "" ? 0 : oSub.HVolume) + "," // HVolume dec(18,8)
              + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8)
              + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8)
              + (oSub.HScatteredVolume) + "," // HSNP dec(18,8)
              + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8)
                    oCn.RunProc(sql);
                }