| | |
| | | omodel.HRelationInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationInterID"]); |
| | | omodel.HRelationEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationEntryID"]); |
| | | omodel.HRelationBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRelationBillNo"]); |
| | | omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); |
| | | omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); |
| | | omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); |
| | | omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); |
| | | omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); |
| | | omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); |
| | | omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); |
| | | omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); |
| | | // |
| | | |
| | | |
| | | |
| | | |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | | } |
| | |
| | | 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) |
| | | { |
| | |
| | | public string HProcExchBillNo; //å·¥åºæµè½¬å¡å· |
| | | |
| | | public Int64 HQualityReportEntryID; //è´¨éæ±æ¥åå表ID |
| | | |
| | | public string HChecker; //å®¡æ ¸äºº |
| | | public string HCheckDate; //å®¡æ ¸æ¥æ |
| | | public string HUpDater;//ä¿®æ¹äºº |
| | | public string HUpDateDate; //ä¿®æ¹æ¥æ |
| | | public string HCloseMan; //å
³é人 |
| | | public string HCloseDate;//å
³éæ¥æ |
| | | public bool HCloseType; //å
³éç±»å |
| | | public string HDeleteMan;// ä½åºäºº |
| | | public string HDeleteDate; //ä½åºæ¥æ |
| | | // |
| | | } |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | { |
| | | string ModRightNameCheck = "Sc_ICMOReportBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_ICMOReportBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOReportBill_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOReportBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_ICMOReportBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOReportBill_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOReportBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | |
| | | { |
| | | string ModRightNameCheck = "MES_MESBeginWorkBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESBeginWorkBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESBeginWorkBill_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESBeginWorkBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESBeginWorkBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESBeginWorkBill_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESBeginWorkBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | string ModRightNameCheck = "MES_ProcExchReport_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | string StrMessage = ""; |
| | |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_ICMOBillWorkQtyStatus_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOBillWorkQtyStatus_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOBillWorkQtyStatus_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_ICMOBillWorkQtyStatus_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOBillWorkQtyStatus_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOBillWorkQtyStatus_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | public WebServer webserver = new WebServer(); |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | |
| | | { |
| | | string ModRightNameCheck = "MES_MESEndWorkBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESEndWorkBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESEndWorkBill_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESEndWorkBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESEndWorkBill_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | string ModRightNameCheck = "MES_MESStopWorkBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESStopWorkBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESStopWorkBill_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESStopWorkBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MESStopWorkBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MESStopWorkBill_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(lngBillKey,oBill.omodel.HBillNo,"h_p_Sc_MESStopWorkBill_AfterUnCheckCtrl",CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [è´¨éæ±æ¥åå®¡æ ¸ãåå®¡æ ¸] |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | /// Sc_ICMOBillQualityStatus_Tmp |
| | | [Route("Sc_ICMOBillQualityStatus_Tmp/Audit")] |
| | | [HttpGet] |
| | | public object Audit(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_QualityReportBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterIDå°äº0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | DAL.ClsSc_QualityReportBill oBill = new DAL.ClsSc_QualityReportBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_QualityReportBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_QualityReportBill_BeforeCheckCtrl"); |
| | | 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_QualityReportBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸æäº¤ |
| | | { |
| | | //åå®¡æ ¸åæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_QualityReportBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_QualityReportBill_BeforeUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | //åå®¡æ ¸åæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_QualityReportBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æçä»»å¡åè¡¨ï¼æªå®æï¼å·²å®æï¼æ£å¨è¿è¡ï¼ |
| | | /// <summary> |
| | | /// è¿åæçä»»å¡å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_WorkTaskBill/PM_WorkTaskBillMainList")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskBillMainList( string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillMyList " + user, "h_p_PM_WorkTaskBillMyList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | { |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°æ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | public bool CheckBill(Int64 lngBillKey, ref string sReturn) |
| | | public bool CheckBill(Int64 lngBillKey,string HBillNo, string procName, string sUser, ref string sReturn) |
| | | { |
| | | |
| | | try |
| | |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | DataSet ds,Ds; |
| | | string sql = ""; |
| | | |
| | | ds = oCn.RunProcReturn("select * from Sc_ICMOReportBillMain where HInterID = " + lngBillKey, "Sc_ICMOReportBillMain"); |
| | | string HBillNo = ""; |
| | | HBillNo = ""; |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | |
| | | model.Add("FBillNo", HBillNo); |
| | | |
| | | JArray Fentity = new JArray(); |
| | | string sErrMsg = ""; |
| | | string sJXCode = ""; |
| | | foreach (DataRow item in Ds.Tables[1].Rows) |
| | | { |
| | | JObject FentityModel = new JObject(); |
| | |
| | | FentityModel.Add("FBASEFINISHQTY", item["FBASEFINISHQTY"].ToString());//åºæ¬åä½å®ææ°é |
| | | FentityModel.Add("FFINISHQTY", item["FFINISHQTY"].ToString());//宿æ°é |
| | | FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["FLot"].ToString() });//æ¹å· |
| | | FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//çç» |
| | | FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// æä½å |
| | | // |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "ä¹è±") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° 空ç½ä¸ºéç¨ |
| | | { |
| | | FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//çç» |
| | | FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// æä½å |
| | | } |
| | | |
| | | FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOMçæ¬ |
| | | |
| | | //sJson_BatchNo + |
| | |
| | | FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString()); |
| | | Fentity2.Add(FentityModel2); |
| | | FentityModel.Add("FEntity_Link", Fentity2); |
| | | FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); // |
| | | FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); |
| | | Fentity.Add(FentityModel); |
| | | } |
| | | model.Add("FEntity", Fentity); //æç»ä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | sReturn = "å®¡æ ¸åæ®æåï¼"; |
| | | |
| | | |
| | | //å®¡æ ¸åæ§å¶===============================================Begin================================================================ |
| | | sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; |
| | | ds = oCn.RunProcReturn(sql, 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End================================================================ |
| | | |
| | | oCn.Commit(); |
| | | |
| | | sReturn = ""; |
| | |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | public bool AbandonCheck(Int64 lngBillKey, ref string sReturn) |
| | | public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn) |
| | | { |
| | | |
| | | string sql = ""; |
| | | DataSet ds; |
| | | try |
| | | { |
| | | string HChecker = DBUtility.ClsPub.CurUserName; |
| | |
| | | //è¿ååæ®ç¶æä¸ºæªå®¡æ ¸ç¶æ |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString()); |
| | | sReturn = "åå®¡æ ¸åæ®æåï¼"; |
| | | |
| | | //å®¡æ ¸åæ§å¶===============================================Begin================================================================ |
| | | sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; |
| | | ds = oCn.RunProcReturn(sql, 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End================================================================ |
| | | |
| | | |
| | | oCn.Commit(); |
| | | sReturn = ""; |
| | | return true; |
| | |
| | | |
| | | |
| | | //å®¡æ ¸ |
| | | public bool CheckBill(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, Int64 lngBillKey, ref string sReturn) |
| | | public bool CheckBill(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn) |
| | | { |
| | | |
| | | string sql = ""; |
| | | DataSet ds; |
| | | try |
| | | { |
| | | string HChecker = DBUtility.ClsPub.CurUserName; |
| | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); |
| | | sReturn = "å®¡æ ¸åæ®æåï¼"; |
| | | |
| | | //å®¡æ ¸åæ§å¶===============================================Begin================================================================ |
| | | sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; |
| | | ds = oCn.RunProcReturn(sql, 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End================================================================ |
| | | |
| | | oCn.Commit(); |
| | | //çæè°æ¨å |
| | | //å¾å°è°æ¨å mainid åæ®å· |
| | |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | public bool AbandonCheck(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, Int64 lngBillKey, ref string sReturn) |
| | | public bool AbandonCheck(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn) |
| | | { |
| | | |
| | | string sql = ""; |
| | | DataSet ds; |
| | | try |
| | | { |
| | | string HChecker = DBUtility.ClsPub.CurUserName; |
| | |
| | | oCn.BeginTran(); |
| | | //è¿ååæ®ç¶æä¸ºæªå®¡æ ¸ç¶æ |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString()); |
| | | sReturn = "å®¡æ ¸åæ®æåï¼"; |
| | | sReturn = "åå®¡æ ¸åæ®æåï¼"; |
| | | |
| | | //å®¡æ ¸åæ§å¶===============================================Begin================================================================ |
| | | sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; |
| | | ds = oCn.RunProcReturn(sql, 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; |
| | | } |
| | | //å®¡æ ¸åæ§å¶===============================================End================================================================ |
| | | |
| | | oCn.Commit(); |
| | | //çæè°æ¨å |
| | | //å¾å°è°æ¨å mainid åæ®å· |