1
yxj
2021-11-26 7f5fd4b07afcf2f41371829d3f9774b2618d5916
WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
@@ -17,9 +17,9 @@
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sb_EquipRepairWorkBillMain";
            base.MvarReportTitle = "模具维修单";
            base.BillType="3793";
            base.HBillSubType = "3793";
            base.MvarReportTitle = "设备维修单";
            base.BillType="3910";
            base.HBillSubType = "3910";
        }
@@ -61,6 +61,9 @@
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HRepairContent='" + omodel.HRepairContent + "'" +
                ",HMainSourceBillType='"+ omodel.HMainSourceBillType+"'"+
                ",HMainSourceInterID="+ omodel.HMainSourceInterID.ToString()+
                ",HMainSourceEntryID="+ omodel.HMainSourceEntryID.ToString()+
                ",HCycleUnit='" + omodel.HCycleUnit + "'" +
                
                " where HInterID=" + lngBillKey.ToString());
@@ -114,21 +117,32 @@
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sb_EquipRepairWorkBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HEquipID,HRepairID,HPlanTimes,HEmpID,HManagerID,HTimes" +
                ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit" +
                ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit,HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" +
                ", " + omodel.HEquipID.ToString() + "," + omodel.HRepairID.ToString() + "," + omodel.HPlanTimes.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HTimes.ToString() +
                ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "'" +
                ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "','" +
                 omodel.HMainSourceBillType+"',"+ omodel.HMainSourceInterID.ToString()+","+ omodel.HMainSourceEntryID.ToString() +
                ") ");
                //插入子表
                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" +
@@ -243,7 +257,7 @@
                    //===================================================
                    
                    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"]);