using System; 
 | 
using System.Collections.Generic; 
 | 
using System.Text; 
 | 
using System.Data; 
 | 
  
 | 
namespace WebAPI.DLL 
 | 
{ 
 | 
    public class ClsPay_GroupBalBill : DBUtility.ClsXt_BaseBill 
 | 
    { 
 | 
        public Models.ClsPay_GroupBalBillMain omodel = new Models.ClsPay_GroupBalBillMain(); 
 | 
        public List<Models.ClsPay_GroupBalBillSub> DetailColl = new List<Models.ClsPay_GroupBalBillSub>(); 
 | 
        public List<Models.ClsPay_GroupBalBillEmp> DetailEmpColl = new List<Models.ClsPay_GroupBalBillEmp>(); 
 | 
  
 | 
        public ClsPay_GroupBalBill() 
 | 
        { 
 | 
            base.MvarItemKeySub = "Pay_GroupBalBillSub"; 
 | 
            base.MvarItemKeySub2 = "Pay_GroupBalBillEmp"; 
 | 
            base.MvarItemKeySub3 = ""; 
 | 
            base.MvarItemKeySub4 = ""; 
 | 
            base.MvarItemKey = "Pay_GroupBalBillMain"; 
 | 
            base.MvarReportTitle = "工资结算单(班组)"; 
 | 
            base.BillType = "2202"; 
 | 
            base.HBillSubType = "2202"; 
 | 
  
 | 
        } 
 | 
  
 | 
        #region 固定代码 
 | 
  
 | 
        ~ClsPay_GroupBalBill() 
 | 
        { 
 | 
            DetailColl = null; 
 | 
        } 
 | 
  
 | 
        #endregion   自定义方法 
 | 
        //修改单据 
 | 
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) 
 | 
        { 
 | 
            try 
 | 
            { 
 | 
                // 
 | 
                oCn.BeginTran(); 
 | 
                //更新主表 
 | 
                oCn.RunProc("UpDate Pay_GroupBalBillMain set  " + 
 | 
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值=============== 
 | 
                ",HDate='" + omodel.HDate + "'" + 
 | 
                ",HYear='" + omodel.HYear.ToString() + "'" + 
 | 
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" + 
 | 
                ",HRemark='" + omodel.HRemark + "'" + 
 | 
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + 
 | 
                ",HUpDateDate=getdate()" + 
 | 
                //======================================== 
 | 
                ",HGroupID=" + omodel.HGroupID.ToString() + 
 | 
                ",HDeptID=" + omodel.HDeptID.ToString() + 
 | 
                ",HOtherSubsidy=" + omodel.HOtherSubsidy.ToString() + 
 | 
                ",HOtherDeduct=" + omodel.HOtherDeduct.ToString() + 
 | 
                ",HSumMoney=" + omodel.HSumMoney.ToString() + 
 | 
                ",HPayMoney=" + omodel.HPayMoney.ToString() + 
 | 
                ",HPayType=" + omodel.HPayType.ToString() + 
 | 
                ",HExplanation='" + omodel.HExplanation + "'" + 
 | 
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + 
 | 
                " where HInterID=" + lngBillKey.ToString()); 
 | 
                //删除关联 
 | 
                DeleteRelation(ref sReturn, lngBillKey); 
 | 
                //删除子表 
 | 
                DeleteBillSub(lngBillKey); 
 | 
                DeleteBillSub2(lngBillKey); 
 | 
                //插入子表 
 | 
                omodel.HInterID = lngBillKey; 
 | 
                foreach (Models.ClsPay_GroupBalBillSub oSub in DetailColl) 
 | 
                { 
 | 
                    oCn.RunProc("Insert into Pay_GroupBalBillSub " + 
 | 
                      " (HInterID,HEntryID,HRemark" + 
 | 
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + 
 | 
                      ",HMaterID,HUnitID,HProcID,HTimes,HQty,HPrice,HSourceID" + 
 | 
                      ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" + 
 | 
                      ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSqty" + 
 | 
                      ") values(" 
 | 
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" + 
 | 
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + 
 | 
                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HSourceID.ToString() + 
 | 
                      "," + oSub.HMoney.ToString() + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HProcReportInterID.ToString() + "," + oSub.HProcReportEntryID.ToString() + ",'" + oSub.HProcReportBillNo + "'" + 
 | 
                      "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'," + oSub.HSqty.ToString() + 
 | 
                      ") "); 
 | 
                } 
 | 
                // 
 | 
                //插入子表2 
 | 
                foreach (Models.ClsPay_GroupBalBillEmp oSubSec in DetailEmpColl) 
 | 
                { 
 | 
                    oCn.RunProc("Insert into Pay_GroupBalBillEmp " + 
 | 
                      " (HInterID,HEntryID,HRemark" + 
 | 
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + 
 | 
                        ",HEmpID,HEmpRate" + 
 | 
                        ",HBaseTimes,HOverTimes,HLeaveTimes,HCTPrjID" + 
 | 
                        ",HBaseDays,HOverDays,HLeaveDays,HYf" + 
 | 
                        ",HMoney,HOtherSubsidy,HOtherDeduct,HIsPay,HAvgFlag" + 
 | 
                        ")" + 
 | 
                        " values(" 
 | 
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" + 
 | 
                      "," + oSubSec.HSourceInterID.ToString() + "," + oSubSec.HSourceEntryID.ToString() + ",'" + oSubSec.HSourceBillNo + "','" + oSubSec.HSourceBillType + "'," + oSubSec.HRelationQty.ToString() + "," + oSubSec.HRelationMoney.ToString() + 
 | 
                        "," + oSubSec.HEmpID.ToString() + "," + oSubSec.HEmpRate.ToString() + 
 | 
                        "," + oSubSec.HBaseTimes.ToString() + "," + oSubSec.HOverTimes.ToString() + "," + oSubSec.HLeaveTimes.ToString() + "," + oSubSec.HCTPrjID.ToString() + 
 | 
                        "," + oSubSec.HBaseDays.ToString() + "," + oSubSec.HOverDays.ToString() + "," + oSubSec.HLeaveDays.ToString() + "," + oSubSec.HYf.ToString() + 
 | 
                        "," + oSubSec.HMoney.ToString() + "," + oSubSec.HOtherSubsidy.ToString() + "," + oSubSec.HOtherDeduct.ToString() + "," + Convert.ToString(oSubSec.HIsPay ? 1 : 0) + "," + Convert.ToString(oSubSec.HAvgFlag ? 1 : 0) + ") "); 
 | 
                } 
 | 
                //foreach (Models.ClsPay_GroupBalBillSub oSub in DetailColl) 
 | 
                //{ 
 | 
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBill_Qty " + oSub.HICMOInterID, ""); 
 | 
                //    if (Ds.Tables[0].Rows.Count == 0) 
 | 
                //        return; 
 | 
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") 
 | 
                //    { 
 | 
                //        sReturn = "汇报数量超过计划数量!不允许保存"; 
 | 
                //        return false; 
 | 
                //    } 
 | 
                //} 
 | 
                sReturn = "修改单据成功!"; 
 | 
                oCn.Commit(); 
 | 
                return true; 
 | 
            } 
 | 
            catch (Exception e) 
 | 
            { 
 | 
                sReturn = e.Message; 
 | 
                oCn.RollBack(); 
 | 
                throw (e); 
 | 
            } 
 | 
        } 
 | 
        //新增单据 
 | 
        public override bool AddBill(ref string sReturn) 
 | 
        { 
 | 
            try 
 | 
            { 
 | 
                //得到mainid 
 | 
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); 
 | 
                //若MAINDI重复则重新获取 
 | 
                oCn.BeginTran(); 
 | 
                //主表 
 | 
                oCn.RunProc("Insert Into Pay_GroupBalBillMain   " + 
 | 
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + 
 | 
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + 
 | 
                ",HGroupID,HDeptID,HPayType,HOtherSubsidy" + 
 | 
                ",HOtherDeduct,HSumMoney,HPayMoney" + 
 | 
                ",HExplanation,HInnerBillNo" + 
 | 
                ") " + 
 | 
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + 
 | 
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + 
 | 
                ", " + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HPayType.ToString() + "," + omodel.HOtherSubsidy.ToString() + 
 | 
                "," + omodel.HOtherDeduct.ToString() + "," + omodel.HSumMoney.ToString() + "," + omodel.HPayMoney.ToString() + 
 | 
                ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + 
 | 
                ") "); 
 | 
                // 
 | 
                //插入子表 
 | 
                foreach (Models.ClsPay_GroupBalBillSub oSub in DetailColl) 
 | 
                { 
 | 
                    oCn.RunProc("Insert into Pay_GroupBalBillSub " + 
 | 
                      " (HInterID,HEntryID,HRemark" + 
 | 
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + 
 | 
                      ",HMaterID,HUnitID,HProcID,HTimes,HQty,HPrice,HSourceID" + 
 | 
                      ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" + 
 | 
                      ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSqty" + 
 | 
                      ") values(" 
 | 
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" + 
 | 
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + 
 | 
                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HSourceID.ToString() + 
 | 
                      "," + oSub.HMoney.ToString() + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HProcReportInterID.ToString() + "," + oSub.HProcReportEntryID.ToString() + ",'" + oSub.HProcReportBillNo + "'" + 
 | 
                      "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'," + oSub.HSqty.ToString() + 
 | 
                      ") "); 
 | 
                } 
 | 
                // 
 | 
                //插入子表2 
 | 
                foreach (Models.ClsPay_GroupBalBillEmp oSubSec in DetailEmpColl) 
 | 
                { 
 | 
                    oCn.RunProc("Insert into Pay_GroupBalBillEmp " + 
 | 
                      " (HInterID,HEntryID,HRemark" + 
 | 
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + 
 | 
                        ",HEmpID,HEmpRate" + 
 | 
                        ",HBaseTimes,HOverTimes,HLeaveTimes,HCTPrjID" + 
 | 
                        ",HBaseDays,HOverDays,HLeaveDays,HYf" + 
 | 
                        ",HMoney,HOtherSubsidy,HOtherDeduct,HIsPay,HAvgFlag" + 
 | 
                        ")" + 
 | 
                        " values(" 
 | 
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" + 
 | 
                      "," + oSubSec.HSourceInterID.ToString() + "," + oSubSec.HSourceEntryID.ToString() + ",'" + oSubSec.HSourceBillNo + "','" + oSubSec.HSourceBillType + "'," + oSubSec.HRelationQty.ToString() + "," + oSubSec.HRelationMoney.ToString() + 
 | 
                        "," + oSubSec.HEmpID.ToString() + "," + oSubSec.HEmpRate.ToString() + 
 | 
                        "," + oSubSec.HBaseTimes.ToString() + "," + oSubSec.HOverTimes.ToString() + "," + oSubSec.HLeaveTimes.ToString() + "," + oSubSec.HCTPrjID.ToString() + 
 | 
                        "," + oSubSec.HBaseDays.ToString() + "," + oSubSec.HOverDays.ToString() + "," + oSubSec.HLeaveDays.ToString() + "," + oSubSec.HYf.ToString() + 
 | 
                        "," + oSubSec.HMoney.ToString() + "," + oSubSec.HOtherSubsidy.ToString() + "," + oSubSec.HOtherDeduct.ToString() + "," + Convert.ToString(oSubSec.HIsPay ? 1 : 0) + "," + Convert.ToString(oSubSec.HAvgFlag ? 1 : 0) + ") "); 
 | 
                } 
 | 
                // 
 | 
                //foreach (Models.ClsPay_GroupBalBillSub oSub in DetailColl) 
 | 
                //{ 
 | 
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBill_Qty " + oSub.HICMOInterID, ""); 
 | 
                //    if (Ds.Tables[0].Rows.Count == 0) 
 | 
                //        return; 
 | 
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") 
 | 
                //    { 
 | 
                //        sReturn = "汇报数量超过计划数量!不允许保存"; 
 | 
                //        return false; 
 | 
                //    } 
 | 
                //} 
 | 
                // 
 | 
                sReturn = "新增单据成功!"; 
 | 
                oCn.Commit(); 
 | 
                return true; 
 | 
            } 
 | 
            catch (Exception e) 
 | 
            { 
 | 
                sReturn = e.Message; 
 | 
                oCn.RollBack(); 
 | 
                throw (e); 
 | 
            } 
 | 
        } 
 | 
        //显示单据 
 | 
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn) 
 | 
        { 
 | 
            try 
 | 
            { 
 | 
                //查询主表 
 | 
                DataSet Ds; 
 | 
                Ds = oCn.RunProcReturn("Select * from Pay_GroupBalBillMain Where HInterID=" + lngBillKey.ToString(), "Pay_GroupBalBillMain"); 
 | 
                if (Ds.Tables[0].Rows.Count == 0) 
 | 
                { 
 | 
                    sReturn = "单据未找到!"; 
 | 
                    return false; 
 | 
                } 
 | 
                //固定赋值=========================================== 
 | 
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); 
 | 
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); 
 | 
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); 
 | 
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); 
 | 
                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); 
 | 
                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); 
 | 
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); 
 | 
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); 
 | 
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); 
 | 
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); 
 | 
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); 
 | 
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); 
 | 
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); 
 | 
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); 
 | 
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); 
 | 
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); 
 | 
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); 
 | 
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); 
 | 
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); 
 | 
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); 
 | 
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); 
 | 
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); 
 | 
                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); 
 | 
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); 
 | 
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); 
 | 
                //======================================================== 
 | 
                omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]); 
 | 
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); 
 | 
                omodel.HPayType = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPayType"]); 
 | 
                omodel.HOtherSubsidy = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HOtherSubsidy"]); 
 | 
                omodel.HOtherDeduct = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HOtherDeduct"]); 
 | 
                omodel.HSumMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSumMoney"]); 
 | 
                omodel.HPayMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HPayMoney"]); 
 | 
                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); 
 | 
                omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); 
 | 
                // 
 | 
  
 | 
                //循环 
 | 
                DataSet DsSub; 
 | 
                DsSub = oCn.RunProcReturn("Select * from Pay_GroupBalBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Pay_GroupBalBillSub"); 
 | 
                DetailColl.Clear();//清空 
 | 
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) 
 | 
                { 
 | 
                    Models.ClsPay_GroupBalBillSub oSub = new Models.ClsPay_GroupBalBillSub(); 
 | 
                    // 固定赋值=============================================== 
 | 
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); 
 | 
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); 
 | 
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); 
 | 
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); 
 | 
                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); 
 | 
                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); 
 | 
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); 
 | 
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); 
 | 
                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); 
 | 
                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); 
 | 
                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); 
 | 
                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); 
 | 
                    //=================================================== 
 | 
                    oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); 
 | 
                    oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); 
 | 
                    oSub.HProcID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcID"]); 
 | 
                    oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]); 
 | 
                    oSub.HTimes = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTimes"]); 
 | 
                    oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); 
 | 
                    oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]); 
 | 
                    oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]); 
 | 
                    oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]); 
 | 
                    oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]); 
 | 
                    oSub.HProcReportInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcReportInterID"]); 
 | 
                    oSub.HProcReportEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcReportEntryID"]); 
 | 
                    oSub.HProcReportBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcReportBillNo"]); 
 | 
                    oSub.HProcPlanInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanInterID"]); 
 | 
                    oSub.HProcPlanEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanEntryID"]); 
 | 
                    oSub.HProcPlanBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcPlanBillNo"]); 
 | 
                    oSub.HSqty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSqty"]); 
 | 
                    DetailColl.Add(oSub); 
 | 
                } 
 | 
                //循环子表2 
 | 
                DataSet DsSubSec = new DataSet(); 
 | 
                DsSubSec = oCn.RunProcReturn("Select * from Pay_GroupBalBillEmp Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Pay_GroupBalBillMain"); 
 | 
                DetailEmpColl.Clear();//清空 
 | 
                for (int i = 0; i < DsSubSec.Tables[0].Rows.Count; i++) 
 | 
                { 
 | 
                    Models.ClsPay_GroupBalBillEmp oSubSec = new Models.ClsPay_GroupBalBillEmp(); 
 | 
                    // 固定赋值=============================================== 
 | 
                    oSubSec.HInterID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HInterID"]); 
 | 
                    oSubSec.HEntryID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HEntryID"]); 
 | 
                    oSubSec.HSourceInterID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HSourceInterID"]); 
 | 
                    oSubSec.HSourceEntryID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HSourceEntryID"]); 
 | 
                    oSubSec.HSourceBillType = DsSubSec.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); 
 | 
                    oSubSec.HSourceBillNo = DsSubSec.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); 
 | 
                    oSubSec.HRelationQty = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HRelationQty"]); 
 | 
                    oSubSec.HRelationMoney = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HRelationMoney"]); 
 | 
                    oSubSec.HCloseMan = DBUtility.ClsPub.isStrNull(DsSubSec.Tables[0].Rows[i]["HCloseMan"]); 
 | 
                    oSubSec.HCloseType = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HCloseType"]); 
 | 
                    oSubSec.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSubSec.Tables[0].Rows[i]["HEntryCloseDate"]); 
 | 
                    oSubSec.HRemark = DsSubSec.Tables[0].Rows[i]["HRemark"].ToString().Trim(); 
 | 
                    //=================================================== 
 | 
                    oSubSec.HEmpID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HEmpID"]); 
 | 
                    oSubSec.HCTPrjID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HCTPrjID"]); 
 | 
                    oSubSec.HEmpRate = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HEmpRate"]); 
 | 
                    oSubSec.HBaseTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HBaseTimes"]); 
 | 
                    oSubSec.HOverTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOverTimes"]); 
 | 
                    oSubSec.HLeaveTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HLeaveTimes"]); 
 | 
                    oSubSec.HBaseDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HBaseDays"]); 
 | 
                    oSubSec.HOverDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOverDays"]); 
 | 
                    oSubSec.HLeaveDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HLeaveDays"]); 
 | 
                    oSubSec.HMoney = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HMoney"]); 
 | 
                    oSubSec.HOtherSubsidy = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOtherSubsidy"]); 
 | 
                    oSubSec.HOtherDeduct = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOtherDeduct"]); 
 | 
                    oSubSec.HYf = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HYf"]); 
 | 
                    oSubSec.HIsPay = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HIsPay"]); 
 | 
                    oSubSec.HAvgFlag = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HAvgFlag"]); 
 | 
  
 | 
                    // 
 | 
                    DetailEmpColl.Add(oSubSec); 
 | 
                } 
 | 
                sReturn = "显示单据成功!"; 
 | 
                return true; 
 | 
            } 
 | 
            catch (Exception e) 
 | 
            { 
 | 
                sReturn = e.Message; 
 | 
                throw (e); 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
    } 
 | 
  
 | 
} 
 |