工序流转卡 删除方法,增加 调用 删除 前控制 h_p_Sc_ProcessExchangeBill_BeforeDelCtrl 和删除 后控制 h_p_Sc_ProcessExchangeBill_AfterDelCtrl 的 存储过程。 工序返工申请单 删除 方法,增加 调用 删除 前控制 h_p_Sc_ProcExchWorkBackBill_BeforeDelCtrl 和 删除 后控制 h_p_Sc_ProcExchWorkBackBill_AfterDelCtrl 的 存储过程。 工序返工记录单 删除 方法,增加 调用 删除 前控制 h_p_Sc_ProcExchRecordBackBill_BeforeDelCtrl 和 删除 后控制 h_p_Sc_ProcExchRecordBackBill_AfterDelCtrl 的 存储过程。
| | |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | public virtual bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å 餿ç»è¡¨ |
| | | DeleteBillSub(lngBillKey); |
| | | DeleteBillSub2(lngBillKey); |
| | | DeleteBillSub3(lngBillKey); |
| | | DeleteBillSub4(lngBillKey); |
| | | //å é¤ä¸»è¡¨ |
| | | DeleteBillMain(lngBillKey); |
| | | |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | DataSet ds = oCn.RunProcReturn(sql2, procName); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | sReturn = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | sReturn = "å é¤åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ¯å¦è¢«å
³è |
| | | public bool isUse(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql1 = "exec h_p_Sc_ProcExchRecordBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_ProcExchRecordBackBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, HBillNo, "h_p_Sc_ProcExchRecordBackBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (IsDete) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql1 = "exec h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, HBillNo, "h_p_Sc_ProcExchSendWorkBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql1 = "exec h_p_WW_EntrustWorkOrderBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_WW_EntrustWorkOrderBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql1 = "exec h_p_Sc_ProcExchWorkBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_ProcExchWorkBackBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey,HBillNo, "h_p_Sc_ProcExchWorkBackBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | |
| | | |
| | | DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill(); |
| | | |
| | | string[] HBillNo = HInterID.Split(','); |
| | | string[] HInterIDs = HInterID.Split(','); |
| | | string[] HBillNos = new string[HInterIDs.Length]; |
| | | |
| | | string HBillNo_S = ""; |
| | | |
| | | foreach (var item in HBillNo) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(item); |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterIDs[i]); |
| | | |
| | | DBUtility.ClsPub.HOrgID = HPRDORGID; |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·:"+ oBill .omodel.HBillNo+ "åæ®ID为空ï¼"; |
| | | objJsonResult.Message = "åæ®å·:" + oBill.omodel.HBillNo + "åæ®ID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | HBillNo_S += oBill.omodel.HBillNo + ","; |
| | | HBillNos[i] = oBill.omodel.HBillNo; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | HBillNo_S = HBillNo_S.Substring(0, HBillNo_S.Length - 1); |
| | | LogService.Write("ç¨æ·:" + user + ",æ¥æ:" + DateTime.Now + ",å é¤å·¥åºæµè½¬å¡åæ®:" + HBillNo_S); |
| | | |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "å é¤å·¥åºæµè½¬å¡åæ®ï¼" + HBillNo_S + "','LMES-å·¥åºæµè½¬å¡æ¨¡å','" + DBUtility.ClsPub.IPAddress + "','å é¤åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | foreach (var item in HBillNo) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | oCN.BeginTran(); |
| | | if (HSouceBillType == "SUB") { |
| | | ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HInterID=" + item, "Sc_ProcessExchangeBillMain"); |
| | | if (HSouceBillType == "SUB") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HInterID=" + HInterIDs[i], "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) { |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=0 where HInterID=" + ds.Tables[0].Rows[0]["HMainSourceInterID"].ToString() + " and HEntryID=" + ds.Tables[0].Rows[0]["HMainSourceEntryID"].ToString()); |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_ProcessExchangeBill_BeforeDelCtrl " + HInterIDs[i] + ",'" + HBillNos[i] + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_ProcessExchangeBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(long.Parse(HInterIDs[i]), HBillNos[i], "h_p_Sc_ProcessExchangeBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (!IsDete) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | |