删除前后控制(产量汇报单,质量汇报单,生产汇报单,开工单,完工单,停工挂起单)
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string HBillNo = ""; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOReportBillMain where HInterID=" + lngBillKey, "Sc_ICMOReportBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; ; |
| | | } |
| | | else |
| | | { |
| | | HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | } |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_ICMOReportBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_ICMOReportBill_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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + "" + "','" + "å é¤çäº§æ±æ¥ååæ®ï¼" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-çäº§æ±æ¥å模å','" + DBUtility.ClsPub.IPAddress + "','å é¤åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, HBillNo, "h_p_Sc_ICMOReportBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | if (IsDete) |
| | | { |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_MESBeginWorkBill_BeforeDelCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + UserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESBeginWorkBill_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(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MESBeginWorkBill_AfterDelCtrl", UserName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillWorkQtyStatus_Tmp where HInterID=" + HInterID + " and HSourceInterID=" + HICMOInterID + " and HSourceEntryID=" + HICMOEntryID, "Sc_ICMOBillWorkQtyStatus_Tmp"); |
| | | string HBillNo = ""; |
| | | if (ds.Tables[0].Rows.Count == 0) { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | } |
| | | |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_ICMOBillWorkQtyStatus_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + UserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_ICMOBillWorkQtyStatus_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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | //å é¤äº§éæ±æ¥è¡¨ |
| | | string sql = string.Format(@"delete Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "'"); |
| | | oCN.RunProc(sql); |
| | | double sumqty = double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString()) + double.Parse(ds.Tables[0].Rows[0]["HBadQty"].ToString()) + double.Parse(ds.Tables[0].Rows[0]["HWasterQty"].ToString()); //æ±æ¥æ°é+ä¸è¯+æ¥åº |
| | | //ååçäº§ç¶æä¸´æ¶è¡¨Sc_ICMOBillStatus_Tmpæåæ±æ¥æ°é HSplitRelationQty |
| | | oCN.RunProc("update Sc_ICMOBillStatus_Tmp set HSplitRelationQty=HSplitRelationQty-" + sumqty + " where HICMOBillNo='" + ds.Tables[0].Rows[0]["HICMOBillNo"].ToString() + "' and HSourceID='" + ds.Tables[0].Rows[0]["HSourceID"].ToString() + "' and HICMOInterID='" + ds.Tables[0].Rows[0]["HICMOInterID"].ToString() + "' and HICMOEntryID='" + ds.Tables[0].Rows[0]["HICMOEntryID"].ToString() + "' and HInterID=" + ds.Tables[0].Rows[0]["HSourceInterID"].ToString()); |
| | | |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec h_p_Sc_ICMOBillWorkQtyStatus_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + UserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql2, "h_p_Sc_ICMOBillWorkQtyStatus_AfterDelCtrl"); |
| | | if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | 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; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤èµæºæåï¼"; |
| | | objJsonResult.Message = "å é¤äº§éæ±æ¥åæåï¼"; |
| | | objJsonResult.data = ds; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.Message.ToString(); |
| | | objJsonResult.data = null; |
| | | |
| | | oCN.RollBack(); |
| | | } |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_MESEndWorkBill_BeforeDelCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + UserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESEndWorkBill_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(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterDelCtrl", UserName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (IsDete) |
| | | { |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_MESStopWorkBill_BeforeDelCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + UserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESStopWorkBill_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(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MESStopWorkBill_AfterDelCtrl", UserName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | string HBillNo = ""; |
| | | ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where HInterID=" + HItemID, "Sc_QualityReportBillMain"); |
| | | ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where HInterID=" + HItemID, "Sc_QualityReportBillSub"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | else |
| | | { |
| | | HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | DataSet Ds; |
| | | |
| | | string sql1 = "exec h_p_Sc_QualityReportBill_BeforeDelCtrl " + HItemID + ",'" + HBillNo + "','" + user + "'"; |
| | | Ds = oCN.RunProcReturn(sql1, "h_p_Sc_QualityReportBill_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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.RunProc("delete from Sc_QualityReportBillMain where HInterID=" + HItemID); |
| | | oCN.RunProc("delete from Sc_QualityReportBillSub where HInterID=" + HItemID); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec h_p_Sc_QualityReportBill_AfterDelCtrl " + HItemID + ",'" + HBillNo + "','" + user + "'"; |
| | | Ds = oCN.RunProcReturn(sql2, "h_p_Sc_QualityReportBill_AfterDelCtrl"); |
| | | if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | 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; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | public virtual bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //æ¥è¯¢çäº§æ±æ¥å表æ°é |
| | | DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HICMOInterID,b.HICMOEntryID from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain"); |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString(); |
| | | string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString(); |
| | | // |
| | |
| | | //å é¤ä¸»è¡¨ |
| | | DeleteBillMain(lngBillKey); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | 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; |
| | |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | public override bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | //å é¤ä¸»è¡¨ |
| | | oCn.RunProc("Delete From " + MvarItemKey + " where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | 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; |
| | |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | public override bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | //å é¤ä¸»è¡¨ |
| | | oCn.RunProc("Delete From " + MvarItemKey + " where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | 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; |
| | |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) |
| | | public override bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | //å é¤ä¸»è¡¨ |
| | | oCn.RunProc("Delete From " + MvarItemKey + " where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; |
| | | 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; |