| | |
| | | tb2.Rows[i]["HWorkShopID"] = ds.Tables[0].Rows[0]["HDeptID"].ToString(); |
| | | tb2.Rows[i]["ICMOBillHInterID"] = ds.Tables[0].Rows[0]["hmainid"].ToString();//ç产订å主id |
| | | tb2.Rows[i]["ICMOBillHEntryID"] = ds.Tables[0].Rows[0]["HEntryID"].ToString();//ç产订ååid |
| | | tb2.Rows[i]["çäº§è®¢åæ°é"] = ds.Tables[0].Rows[0]["ç产任å¡åæ°é"].ToString();//çäº§è®¢åæ°é |
| | | string sErr = ""; |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "å®å·¥") |
| | | { |
| | | tb2.Rows[i]["çäº§è®¢åæ°é"] = ds.Tables[0].Rows[0]["ç产任å¡åæ°é"].ToString();//çäº§è®¢åæ°é |
| | | } |
| | | } |
| | | //tb2.Rows[i]["çäº§è®¢åæ°é"] = ds.Tables[0].Rows[0]["ç产任å¡åæ°é"].ToString();//çäº§è®¢åæ°é |
| | | tb2.Rows[i]["HSeOrderBillNo"] = ds.Tables[0].Rows[0]["éå®è®¢åå·"].ToString();//éå®è®¢åå· |
| | | } |
| | | |
| | |
| | | var HProdORGID = list[i]["HProdORGID"].ToString(); |
| | | var HWorkShopID = list[i]["HWorkShopID"].ToString(); |
| | | var HSourceID = list[i]["HSourceID"].ToString(); |
| | | var HWorkQty = DBUtility.ClsPub.isDoule(list[i]["产è½"]); |
| | | var HYX = list[i]["ä¼å
级"].ToString(); |
| | | var HEmpID = list[i]["HEmpID"].ToString(); |
| | | var HMaterID = list[i]["HMaterID"].ToString(); |
| | |
| | | var HSeOrderBillNo = list[i]["HSeOrderBillNo"].ToString(); |
| | | |
| | | string sql = $"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}"; |
| | | $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'') = ''"; |
| | | LogService.Write("sql:" + sql); |
| | | ds = oCN.RunProcReturn(sql, "Sc_WorkBillSortBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | |
| | | //主表 |
| | | oCN.RunProc("insert into Sc_WorkBillSortBillMain(HInterID,HBillNo,HYear,HPeriod,HBillType," + |
| | | "HBillSubType,HDate,HBillStatus,HMaker,HMakeDate,HICMOBillNo,HOrderType," + |
| | | "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HEmpID," + |
| | | "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX,HWorkQty, HEmpID," + |
| | | " HMaterID, HMaterName, HMaterModel, HUnitID, HBatchNo," + |
| | | " HSeOrderBillQty, HPlanQty, HCompleteQty,HPreparatDate," + |
| | | "HMainSourceInterID,HMainSourceEntryID,HICMOInterID,HICMOEntryID,HProdORGID,HICMOInterID_Sec,HICMOEntryID_Sec" + |
| | | ",HSeOrderBillNo)values" + |
| | | $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," + |
| | | $"'{BillType}',GETDATE(),1,'{user}','{HDate}','{HICMOBillNo}','{HOrderType}'," + |
| | | $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HEmpID == "" ? 0.ToString() : HEmpID)}," + |
| | | $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)},{(HWorkQty)}, {(HEmpID == "" ? 0.ToString() : HEmpID)}," + |
| | | $" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, '{HBatchNo}'," + |
| | | $" {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}, {(HPlanQty == "" ? 0.ToString() : HPlanQty)}, {(HCompleteQty == "" ? 0.ToString() : HCompleteQty)},getdate()," + |
| | | $" {HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HProdORGID}, {HMainSourceInterID},{HMainSourceEntryID}" + |