| | |
| | | //得到mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //若MAINDI重复则重新获取 |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | |
| | | oCn.RunProc("Insert Into Sc_MESBeginWorkBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark" + |
| | |
| | | ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HBeginWorkTime,HSourceID" + |
| | | ",HSourceInterID_Main,HSourceEntryID_Main,HSourceBillNo_Main,HSourceBillType_Main" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" + |
| | | ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" + |
| | | ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate,HRunStatus,HSourceBeginQty" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + omodel.HMaker+ "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" + |
| | |
| | | ",'" + omodel.HProcExchBillNo + "'," + omodel.HMaterID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HICMOQty.ToString() + "," + omodel.HPlanQty.ToString() + ",getdate()," + omodel.HSourceID.ToString() + |
| | | ",'" + omodel.HMainSourceInterID.ToString() + "'," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo.ToString() + "','" + omodel.HMainSourceBillType.ToString() + "'" + |
| | | ",'" + omodel.HMainSourceInterID.ToString() + "'," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo.ToString() + "','" + omodel.HMainSourceBillType.ToString() + "'" + |
| | | "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HBarCodeMaker + "',getdate()" + |
| | | "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HBarCodeMaker + "',getdate(),'"+ omodel.HRunStatus + "','"+ omodel.HSourceBeginQty.ToString() + "'" + |
| | | ") "); |
| | | |
| | | //再次验证 保存是否 合理 |
| | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | sReturn = "无验证数据!"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | sReturn = omodel.HInterID.ToString(); |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |