|  |  | 
 |  |  | { | 
 |  |  |     public class ClsKf_MateOutBackBill:DBUtility.ClsXt_BaseBill | 
 |  |  |     { | 
 |  |  |         public Model.ClsKf_ICStockBillMain omodel = new Model.ClsKf_ICStockBillMain(); | 
 |  |  |         public List<Model.ClsKf_ICStockBillSub> DetailColl = new List<Model.ClsKf_ICStockBillSub>(); | 
 |  |  |         public List<Model.ClsKf_ICStockBillScheme> DetailSubColl = new List<Model.ClsKf_ICStockBillScheme>(); | 
 |  |  |         public Models.ClsKf_ICStockBillMain omodel = new Models.ClsKf_ICStockBillMain(); | 
 |  |  |         public List<Models.ClsKf_ICStockBillSub> DetailColl = new List<Models.ClsKf_ICStockBillSub>(); | 
 |  |  |         public List<Models.ClsKf_ICStockBillScheme> DetailSubColl = new List<Models.ClsKf_ICStockBillScheme>(); | 
 |  |  |  | 
 |  |  |         public ClsKf_MateOutBackBill() | 
 |  |  |         { | 
 |  |  | 
 |  |  |                 DeleteBillSub(lngBillKey); | 
 |  |  |                 //插入子表 | 
 |  |  |                 omodel.HInterID = lngBillKey; | 
 |  |  |                 foreach (Model.ClsKf_ICStockBillSub oSub in DetailColl) | 
 |  |  |                 foreach (Models.ClsKf_ICStockBillSub oSub in DetailColl) | 
 |  |  |                 { | 
 |  |  |                     oCn.RunProc("Insert into Kf_ICStockBillSub " + | 
 |  |  |                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + | 
 |  |  | 
 |  |  |                 ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + | 
 |  |  |                 ") "); | 
 |  |  |                 //插入子表 | 
 |  |  |                 foreach (Model.ClsKf_ICStockBillSub oSub in DetailColl) | 
 |  |  |                 foreach (Models.ClsKf_ICStockBillSub oSub in DetailColl) | 
 |  |  |                 { | 
 |  |  |                     oCn.RunProc("Insert into Kf_ICStockBillSub " + | 
 |  |  |                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + | 
 |  |  | 
 |  |  |                 DetailColl.Clear();//清空 | 
 |  |  |                 for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) | 
 |  |  |                 { | 
 |  |  |                     Model.ClsKf_ICStockBillSub oSub = new Model.ClsKf_ICStockBillSub(); | 
 |  |  |                     Models.ClsKf_ICStockBillSub oSub = new Models.ClsKf_ICStockBillSub(); | 
 |  |  |                     // 固定赋值=============================================== | 
 |  |  |                     oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); | 
 |  |  |                     oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); | 
 |  |  | 
 |  |  |                 DetailSubColl.Clear();//清空 | 
 |  |  |                 for (int i = 0; i < DsSubSec.Tables[0].Rows.Count; i++) | 
 |  |  |                 { | 
 |  |  |                     Model.ClsKf_ICStockBillScheme oSubSec = new Model.ClsKf_ICStockBillScheme(); | 
 |  |  |                     Models.ClsKf_ICStockBillScheme oSubSec = new Models.ClsKf_ICStockBillScheme(); | 
 |  |  |                     oSubSec.HInterID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HInterID"].ToString()); | 
 |  |  |                     oSubSec.HEntryID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HEntryID"].ToString()); | 
 |  |  |                     oSubSec.HItemID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HItemID"].ToString()); |