|  |  | 
 |  |  |                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 //若MAINDI重复则重新获取 | 
 |  |  |                 oCn.BeginTran(); | 
 |  |  |                 | 
 |  |  |                 //主表 | 
 |  |  |                 oCn.RunProc("Insert Into Sb_EquipRepairWorkBillMain   " + | 
 |  |  |                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + | 
 |  |  | 
 |  |  |                 //插入子表 | 
 |  |  |                 foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) | 
 |  |  |                 { | 
 |  |  |                     string sql1 = string.Format(@"Insert into Sb_EquipRepairWorkBillSub " + | 
 |  |  |                        " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + | 
 |  |  |                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + | 
 |  |  |                        ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + | 
 |  |  |                        ") values(" | 
 |  |  |                        + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + | 
 |  |  |                        "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + | 
 |  |  |                       "," + oSub.HRepairID1.ToString() + ",'" + oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + | 
 |  |  |                        ")"); | 
 |  |  |                     oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " + | 
 |  |  |                        " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + | 
 |  |  |                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + | 
 |  |  | 
 |  |  |                     //=================================================== | 
 |  |  |                      | 
 |  |  |                     oSub.HRepairExplanation = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRepairExplanation"]); | 
 |  |  |                     oSub.HRepairID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairID"]); | 
 |  |  |                     oSub.HRepairID1 = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairID"]); | 
 |  |  |                     oSub.HEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEmpID"]); | 
 |  |  |  | 
 |  |  |  |