| | |
| | | string HMouldClass = mainList[0].HMouldClass; |
| | | int HNowWHID = mainList[0].HNowWHID; |
| | | int HNowSPID = mainList[0].HNowSPID; |
| | | string HMouldUseStatus = mainList[0].HMouldUseStatus; |
| | | |
| | | //保存前控制========================================= |
| | | string HBillNote = ""; |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_MouldFileMain " + |
| | |
| | | ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + |
| | | ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" + |
| | | ",HMouldClass,HNowWHID,HNowSPID,HInitLife) " + |
| | | ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + |
| | | ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" + |
| | |
| | | "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty + |
| | | "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" + |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + |
| | | ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') "); |
| | | ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "') "); |
| | | |
| | | //子表 |
| | | oCN.RunProc("Insert into Gy_MouldFileSub " + |
| | |
| | | ") "); |
| | | |
| | | objJsonResult = AddBillSub(msg5,msg6,msg7,HInterID, HBillNo); |
| | | |
| | | //保存后控制========================================= |
| | | ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_AfterSaveCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | string HMouldClass = mainList[0].HMouldClass; |
| | | int HNowWHID = mainList[0].HNowWHID; |
| | | int HNowSPID = mainList[0].HNowSPID; |
| | | |
| | | string HMouldUseStatus = mainList[0].HMouldUseStatus; |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | //主表 |
| | |
| | | ",HNowWHID=" + HNowWHID + |
| | | ",HNowSPID=" + HNowSPID + |
| | | ",HInitLife='" + HInitLife + |
| | | "',HMouldUseStatus='" + HMouldUseStatus + |
| | | "' where HInterID=" + HInterID.ToString()); |
| | | |
| | | //修改子项目代码 |