| | |
| | | string HProductNum = mainList[0].HProductNum;//æåç¼å· |
| | | string HVerNum = mainList[0].HVerNum;//çæ¬ |
| | | |
| | | if (OperationType == 2) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where åæ®å·='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); |
| | | |
| | | if (OperationType == 1 && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_RoutingBillMain " + |
| | |
| | | oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID+ "' and HProcNo!='9999'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID); |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID) |
| | | public json AddBillSub(string msg3, long HInterID,int OperationType) |
| | | { |
| | | List<Gy_RoutingBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_RoutingBillSub>>(msg3); |
| | | int i = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HProcNo!="9999") |
| | | if (oSub.HProcNo != "9999" || OperationType == 2) |
| | | { |
| | | oCN.RunProc("Insert into Gy_RoutingBillSub " + |
| | | "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" + |
| | |
| | | ",HRemark,HStandard,HName" + ") " + |
| | | " values('" + main.HBillTypeID.ToString() + "'," + main.HInterID.ToString() + "," + main.HDeptID.ToString() + |
| | | ",'" + main.HRemark + "'," + Convert.ToString(main.HStandard ? 1 : 0) + ",'" + main.HName.ToString() + "') "); |
| | | |
| | | int i = 0; |
| | | foreach (Xt_CheckFlowSub oSub in lsmain) |
| | | } |
| | | else |
| | | { |
| | | i++; |
| | | bool bResult = false; |
| | | |
| | | oCN.RunProc("Insert into Xt_CheckFlowSub " + |
| | | " (HInterID,HEntryID,HCheckMan" + |
| | | ",HFlowNo,HJumpFlag,HMakerSelf,HCheckItemID" + |
| | | " )values(" |
| | | + main.HInterID.ToString() + "," + i + ",'" + oSub.HCheckMan + "'" + |
| | | "," + oSub.HFlowNo + "," + Convert.ToString(oSub.HJumpFlag ? 1 : 0) + "," + Convert.ToString(oSub.HMakerSelf ? 1 : 0) + "," + oSub.HCheckItemID + ") "); |
| | | |
| | | bResult = true; |
| | | |
| | | |
| | | if (!bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCN.RunProc("UpDate Xt_CheckFlowMain set " + |
| | | "HRemark='" + main.HRemark + "'" + |
| | | ",HName='" + main.HName + "'" + |
| | | ",HDeptID=" + main.HDeptID.ToString() + |
| | | ",HBillTypeID='" + main.HBillTypeID + "'" + |
| | | ",HStandard='" + Convert.ToString(main.HStandard ? 1 : 0) + "'" + |
| | | " where HInterID=" + main.HInterID.ToString()); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Xt_CheckFlowSub where HInterID=" + main.HInterID.ToString()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | AddBillSub(lsmain, main.HInterID); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(List<Xt_CheckFlowSub> DetailColl, long HInterID) |
| | | { |
| | | int i = 1; |
| | | foreach (Xt_CheckFlowSub oSub in DetailColl) |
| | | { |
| | | |
| | | oCN.RunProc("Insert into Xt_CheckFlowSub " + |
| | | " (HInterID,HEntryID,HCheckMan" + |
| | | ",HFlowNo,HJumpFlag,HMakerSelf,HCheckItemID" + |
| | | " )values(" |
| | | + HInterID + "," + i + ",'" + oSub.HCheckMan + "'" + |
| | | "," + oSub.HFlowNo + "," + Convert.ToString(oSub.HJumpFlag ? 1 : 0) + "," + Convert.ToString(oSub.HMakerSelf ? 1 : 0) + "," + oSub.HCheckItemID + ") "); |
| | | i++; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸æµç¨å å é¤ |