| | |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_CustomsSplitPackBill.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_LadingBill.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBill.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkReportWeekBillMain.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkTaskWeekBill.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPro_DesignBlueRequestBill.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPro_ProjectCheckBill.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsPM_WorkReportWeekBillMain : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsPM_WorkReportWeekBillMain omodel = new Model.ClsPM_WorkReportWeekBillMain(); |
| | | public List<Model.ClsPM_WorkReportWeekBillSub> DetailColl = new List<Model.ClsPM_WorkReportWeekBillSub>(); |
| | | |
| | | public ClsPM_WorkReportWeekBillMain() |
| | | { |
| | | base.MvarItemKeySub = "PM_WorkReportWeekBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey= "PM_WorkReportWeekBillMain"; |
| | | base.MvarReportTitle="å·¥ä½å¨æ»ç»"; |
| | | base.BillType="4757"; |
| | | base.HBillSubType = "4757"; |
| | | |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | #region æ åæé 彿° |
| | | ~ClsPM_WorkReportWeekBillMain() |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | string mainSql = "update PM_WorkReportWeekBillMain set " + |
| | | " HBillNo = '" + omodel.HBillNo + |
| | | "', HDate = '" + omodel.HDate + |
| | | "', HYear = " + omodel.HYear + |
| | | ", HPeriod = " + omodel.HPeriod + |
| | | ", HRemark = '" + omodel.HRemark + |
| | | "', HUpDater = '" + omodel.HUpDater + |
| | | "', HUpDateDate = getdate()" + |
| | | //=============================================================== |
| | | ", HOrgID = " + omodel.HOrgID + |
| | | ", HYear = " + omodel.HYear + |
| | | ", HWeek = " + omodel.HWeek + |
| | | ", HBeginDate = '" + omodel.HBeginDate + |
| | | "', HEndDate = '" + omodel.HEndDate + |
| | | "', HPlanEmpID = " + omodel.HReportEmpID + |
| | | " where HInterID = " + omodel.HInterID; |
| | | |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | |
| | | ////æå
¥å表 |
| | | //omodel.HInterID = lngBillKey; |
| | | //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl) |
| | | //{ |
| | | // string subSql = "insert into PM_WorkTaskWeekBillSub" + |
| | | // "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | // ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " + |
| | | // " values(" + |
| | | // "" + omodel.HInterID.ToString() + |
| | | // "," + oSub.HEntryID.ToString() + |
| | | // ",'" + oSub.HCloseMan + |
| | | // "','" + oSub.HEntryCloseDate + |
| | | // "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + |
| | | // ",'" + oSub.HRemark + |
| | | // "'," + oSub.HSourceInterID + |
| | | // "," + oSub.HSourceEntryID + |
| | | // ",'" + oSub.HSourceBillNo + |
| | | // "','" + oSub.HSourceBillType + |
| | | // "'," + oSub.HRelationQty + |
| | | // "," + oSub.HRelationMoney + |
| | | // "," + oSub.HWeekDay + |
| | | // "," + oSub.HSno + |
| | | // "," + oSub.HProjectID + |
| | | // "," + oSub.HProjectStageID + |
| | | // ",'" + oSub.HTaskNote + |
| | | // "'," + oSub.HPlanTimes + |
| | | // ")"; |
| | | // oCn.RunProc(subSql); |
| | | //} |
| | | |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | //æ£æ¥ä¸»è¡¨å
ç æ¯å¦éå¤ï¼è¥éå¤åéæ°çæå¹¶ç»§ç»æ£æ¥ï¼ç´å°ä¸åéå¤ |
| | | while (true) |
| | | { |
| | | ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID = " + omodel.HInterID, "PM_WorkReportWeekBillMain"); |
| | | if(ds!=null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //æå
¥ä¸»è¡¨ |
| | | string mainSql = "insert into PM_WorkReportWeekBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + |
| | | ",HOrgID,HWeek,HBeginDate,HEndDate,HReportEmpID,HPlanTimes,HUseTimes,HRelUseTimes,HDelayTasks,HFineTasks,HFinishRate,HWorkReport,HNextPlan,HWorkGain ) " + |
| | | "values(" + |
| | | "" + omodel.HYear.ToString() + |
| | | "," + omodel.HPeriod.ToString() + |
| | | ",'" + this.BillType + |
| | | "','" + this.HBillSubType + |
| | | "'," + omodel.HInterID + |
| | | ",'" + omodel.HDate + |
| | | "','" + omodel.HBillNo + |
| | | "','" + omodel.HRemark + |
| | | "','" + omodel.HMaker + |
| | | "','" + omodel.HMakeDate + |
| | | "'," + omodel.HOrgID + |
| | | "," + omodel.HWeek + |
| | | ",'" + omodel.HBeginDate + |
| | | "','" + omodel.HEndDate + |
| | | "'," + omodel.HReportEmpID + |
| | | "," + omodel.HPlanTimes + |
| | | "," + omodel.HUseTimes + |
| | | "," + omodel.HRelUseTimes + |
| | | "," + omodel.HDelayTasks + |
| | | "," + omodel.HFineTasks + |
| | | ",'" + omodel.HFinishRate+ |
| | | "','" + omodel.HWorkReport+ |
| | | "','" + omodel.HNextPlan+ |
| | | "','" + omodel.HWorkGain+ |
| | | "')"; |
| | | |
| | | oCn.RunProc(mainSql); |
| | | |
| | | ////æå
¥å表 |
| | | //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl) |
| | | //{ |
| | | // string subSql = "insert into PM_WorkTaskWeekBillSub" + |
| | | // "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | // ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " + |
| | | // " values(" + |
| | | // "" + omodel.HInterID.ToString() + |
| | | // "," + oSub.HEntryID.ToString() + |
| | | // ",'" + oSub.HCloseMan + |
| | | // "','" + oSub.HEntryCloseDate + |
| | | // "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + |
| | | // ",'" + oSub.HRemark + |
| | | // "'," + oSub.HSourceInterID + |
| | | // "," + oSub.HSourceEntryID + |
| | | // ",'" + oSub.HSourceBillNo + |
| | | // "','" + oSub.HSourceBillType + |
| | | // "'," + oSub.HRelationQty + |
| | | // "," + oSub.HRelationMoney + |
| | | // "," + oSub.HWeekDay + |
| | | // "," + oSub.HSno + |
| | | // "," + oSub.HProjectID + |
| | | // "," + oSub.HProjectStageID + |
| | | // ",'" + oSub.HTaskNote + |
| | | // "'," + oSub.HPlanTimes + |
| | | // ")"; |
| | | // oCn.RunProc(subSql); |
| | | //} |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¾ç¤ºåæ® |
| | | //public override bool ShowBill(Int64 lngBillKey, ref string sReturn) |
| | | //{ |
| | | // try |
| | | // { |
| | | // //æ¥è¯¢ä¸»è¡¨ |
| | | // DataSet Ds ; |
| | | // Ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain Where HInterID = " + lngBillKey.ToString(), "PM_WorkReportWeekBillMain"); |
| | | // if(Ds.Tables[0].Rows.Count==0) |
| | | // { |
| | | // sReturn = "åæ®æªæ¾å°ï¼"; |
| | | // return false; |
| | | // } |
| | | |
| | | // //åºå®èµå¼=========================================== |
| | | // omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); |
| | | // omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); |
| | | // omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); |
| | | // omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); |
| | | // omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | | // omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); |
| | | // omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); |
| | | // omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); |
| | | // omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); |
| | | // omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); |
| | | // omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); |
| | | // omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim(); |
| | | // omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim(); |
| | | // omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim(); |
| | | // omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim(); |
| | | // omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim(); |
| | | // omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim(); |
| | | // omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim(); |
| | | // omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim(); |
| | | // omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim(); |
| | | // omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim(); |
| | | // omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim(); |
| | | // omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); |
| | | // omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim(); |
| | | // omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim(); |
| | | // //======================================================== |
| | | |
| | | // omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); |
| | | // omodel.HWeek = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWeek"]); |
| | | // omodel.HBeginDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBeginDate"]); |
| | | // omodel.HEndDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HEndDate"]); |
| | | // omodel.HPlanEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPlanEmpID"]); |
| | | |
| | | // // |
| | | |
| | | // //å¾ªç¯ |
| | | // DataSet DsSub ; |
| | | // DsSub = oCn.RunProcReturn("select * from PM_WorkTaskWeekBillSub where HInterID = " + lngBillKey.ToString() + "order by HEntryID", "PM_WorkTaskWeekBillSub"); |
| | | // DetailColl.Clear();//æ¸
空 |
| | | // for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) |
| | | // { |
| | | // Model.ClsPM_WorkTaskWeekBillSub oSub = new Model.ClsPM_WorkTaskWeekBillSub(); |
| | | // // åºå®èµå¼=============================================== |
| | | // oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); |
| | | // oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); |
| | | // oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); |
| | | // oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | // oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim(); |
| | | // oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim(); |
| | | // oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); |
| | | // oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); |
| | | // oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); |
| | | // oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); |
| | | // oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); |
| | | // oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); |
| | | // //=================================================== |
| | | // oSub.HWeekDay = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWeekDay"]); |
| | | // oSub.HSno = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSno"]); |
| | | // oSub.HProjectID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProjectID"]); |
| | | // oSub.HProjectStageID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProjectStageID"]); |
| | | // oSub.HTaskNote = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HTaskNote"]); |
| | | // oSub.HPlanTimes = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPlanTimes"]); |
| | | |
| | | // DetailColl.Add(oSub); |
| | | // } |
| | | // sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | // return true; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // sReturn = e.Message; |
| | | // throw (e); |
| | | // } |
| | | //} |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_LadingBillSub.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillMain.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillSub.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkReportWeekBillSub.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkReportWeekBillMain.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkTaskWeekBillSub.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkTaskWeekBillMain.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPro_DesignBlueRequestBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsPM_WorkReportWeekBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HOrgID; //int ç»ç» |
| | | public Int64 HYear; //int 年份 |
| | | public Int64 HWeek; //int å¨ |
| | | public string HBeginDate; //datetime å¼å§æ¥æ |
| | | public string HEndDate; //datetime ç»ææ¥æ |
| | | public Int64 HReportEmpID; //int æ»ç»äºº |
| | | public decimal HPlanTimes; // money --计åå·¥æ¶ |
| | | public decimal HUseTimes; // money --æ¶èå·¥æ¶ |
| | | public decimal HRelUseTimes; // money --ææå·¥æ¶ |
| | | public decimal HDelayTasks; // money --å»¶æä»»å¡ |
| | | public decimal HFineTasks; // money --è¶
åä»»å¡ |
| | | public decimal HFinishRate; // money --è¾¾æç |
| | | public string HWorkReport; //varchar(1000) --工使»ç» |
| | | public string HNextPlan; //varchar(1000) --主导项ç®çä¸ä¸æ¥è®¡å |
| | | public string HWorkGain; //varchar(1000) --å·¥ä½å¿å¾ |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsPM_WorkReportWeekBillSub : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_PORequestBill_BeforeSaveCtrl " + HInterID, "h_p_Cg_PORequestBill_BeforeSaveCtrl"); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | DataSet Ds; |
| | | Int64 NewHInterID = 1; |
| | | Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_PORequestBillMain", "Cg_PORequestBillMain"); |
| | |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_PORequestBill_AfterSaveCtrl " + HInterID, "h_p_Cg_PORequestBill_AfterSaveCtrl"); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | [Route("Cg_PORequestBill/Cg_PORequestBillSaveApi")] |
| | | [HttpPost] |
| | | public object Cg_PORequestBillSaveApi([FromBody] JObject sMainSub) |
| | |
| | | [HttpGet] |
| | | public object AuditCg_PORequestBill(string HInterID, int Type, string user) |
| | | { |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | ds = oCN.RunProcReturn("select * from Cg_PORequestBillMain where HInterID = " + int.Parse(HInterID), "Cg_PORequestBillMain"); |
| | | string HBillNo = ""; |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | } |
| | | BillOld.MvarItemKey = "Cg_PORequestBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //å®¡æ ¸åæ§å¶ |
| | | sql = "exec h_p_Cg_PORequestBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_PORequestBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Cg_PORequestBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | //åå®¡æ ¸åæ§å¶ |
| | | sql = "exec h_p_Cg_PORequestBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_PORequestBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½è¿è¡åå®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå®¡æ ¸åæ® |
| | | if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), HBillNo, "h_p_Cg_PORequestBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region éè´ç³è¯·å ä½åº/åä½åºåè½ |
| | | [Route("Cg_PORequestBill/DropCg_PORequestBill")] |
| | | [HttpGet] |
| | | public object DropCg_PORequestBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æä½åºæé |
| | | if (!DBUtility.ClsPub.Security_Log("Cg_PORequestBill_Delete", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Cg_PORequestBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 ä½åº 2 åä½åº |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»ä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //ä½åºåæ® |
| | | if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åä½åºåæ® |
| | | if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | |
| | | string msg2 = "[" + sArray[0].ToString() + "]"; |
| | | string user = sArray[1].ToString();//ç¨æ·å |
| | | string OperationType = sArray[2].ToString();//ç±»å |
| | | string msg_entry = sArray[3].ToString(); //æç»è¡ä¿¡æ¯ |
| | | |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user)) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill(); |
| | | |
| | | List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2); |
| | | string BillType = "7505"; |
| | |
| | | double HPeriod = DateTime.Now.Month; |
| | | long HSourceID = list[0].HSourceID;//çäº§èµæº |
| | | long HICMOInterID = list[0].HICMOInterID;//ä»»å¡åID |
| | | long HICMOEntryID = list[0].HICMOEntryID;//ä»»å¡ååID |
| | | string HICMOBillNo = list[0].HICMOBillNo;//ä»»å¡å |
| | | string HProcExchBillNo = list[0].HProcExchBillNo;//æå¼å¡ |
| | | long HMaterID = list[0].HMaterID;//产åID |
| | |
| | | long HProcID = list[0].HProcID;//å·¥åºID |
| | | long HPRDORGID = list[0].HPRDORGID;//ç»ç»ID |
| | | bool HLastResult = list[0].HLastResult;//è¯æ ·ç»è®º |
| | | |
| | | //è¡¨ä½æ°æ® |
| | | List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg_entry); |
| | | for (int i = 0; i < subList.ToArray().Length; i++) |
| | | { |
| | | if (subList.ToArray().Length >= 0) |
| | | { |
| | | Model.ClsQC_FirstPieceCheckBillSub oSub = new Model.ClsQC_FirstPieceCheckBillSub(); |
| | | oSub.HEntryID = i + 1; |
| | | oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark); |
| | | oSub.HSourceInterID = ClsPub.isLong(subList[i].HSourceInterID); |
| | | oSub.HSourceEntryID = ClsPub.isLong(subList[i].HSourceEntryID); |
| | | oSub.HSourceBillType = ClsPub.isStrNull(subList[i].HSourceBillType); |
| | | oSub.HSourceBillNo = ClsPub.isStrNull(subList[i].HSourceBillNo); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(subList[i].HRelationQty); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(subList[i].HRelationMoney); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(subList[i].HCloseMan); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(subList[i].HCloseType); |
| | | oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(subList[i].HQCCheckItemID); |
| | | oSub.HQCStd = DBUtility.ClsPub.isStrNull(subList[i].HQCStd); |
| | | oSub.HResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); |
| | | //oSub.HProcCheckTime = HDate; |
| | | //oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); |
| | | //oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); |
| | | oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID); |
| | | oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty); |
| | | oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty); |
| | | oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty); |
| | | oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty); |
| | | oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty); |
| | | oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus); |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID); |
| | | oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal); |
| | | oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal); |
| | | oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit); |
| | | oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit); |
| | | oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet); |
| | | oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet); |
| | | oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod); |
| | | oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); |
| | | oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); |
| | | oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult == "true" ? 1 : 0); |
| | | |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æç»è¡ä¿¡æ¯!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //忮宿´æ§å¤æ |
| | | if (HProcExchBillNo == "") |
| | |
| | | } |
| | | oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HPRDORGID,HLastResult)" + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HPRDORGID + ",'" + HLastResult + "') "); |
| | | |
| | | //æå
¥å表 |
| | | foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in BillNew.DetailColl) |
| | | { |
| | | oCN.RunProc("Insert into QC_FirstPieceCheckBillSub " + |
| | | " (HInterID,HBillNo_bak,HEntryID" + |
| | | ",HRemark,HSourceInterID" + |
| | | ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HQCCheckItemID,HQCStd,HResult" + |
| | | ",HStatus,HUnitID,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" + |
| | | ") values(" |
| | | + HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + HICMOInterID.ToString() + |
| | | "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HResult + "'" + |
| | | ",'" + oSub.HStatus + |
| | | "'," + oSub.HUnitID + "," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + |
| | | ") "); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string HBillNo = oBill.omodel.HBillNo; |
| | | string sql = "exec h_p_Sc_StationInBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | if (Cj_StationInBillCheckBill(HInterID,CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationInBillCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | public bool Cj_StationInBillCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn) |
| | | public bool Cj_StationInBillCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "æ¯") |
| | | { |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationInBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterCheckCtrl"); |
| | | 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 = sReturn + " å®¡æ ¸åè½ï¼"; |
| | | oCN.Commit(); |
| | | return true; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string HBillNo = oBill.omodel.HBillNo; |
| | | string sql = "exec h_p_Sc_StationInBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | if (Cj_StationInBillAbandonCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationInBillAbandonCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | public bool Cj_StationInBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn) |
| | | public bool Cj_StationInBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, ref string sReturn) |
| | | { |
| | | if (Cj_StationInBillisUse(lngBillKey, ref sReturn)) |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "æ¯") |
| | | { |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationInBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterUnCheckCtrl"); |
| | | 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 = sReturn + "åå®¡æ ¸åè½ï¼"; |
| | | oCN.Commit(); |
| | | return true; |
| | |
| | | } |
| | | |
| | | |
| | | var HBillNo = HInterID.Split(','); |
| | | var HInterIDs = HInterID.Split(','); |
| | | string[] HBillNo = new string[HInterIDs.Length]; |
| | | DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); |
| | | |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | if (HBillNo[i] == "0") |
| | | if (HInterIDs[i] == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | HBillNo[i] = oBill.omodel.HBillNo; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | int j = 0; |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //å®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //å®¡æ ¸ |
| | | if (Cj_StationOutBillCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationOutBillCheckBill(long.Parse(HInterIDs[i]), HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | j += 1; |
| | | } |
| | |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string CurUserName,bool HLastSubProc, ref string sReturn) |
| | | public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName,bool HLastSubProc, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "æ¯") |
| | | { |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationOutBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterCheckCtrl"); |
| | | 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 = sReturn + " å®¡æ ¸åè½ï¼"; |
| | | oCN.Commit(); |
| | | return true; |
| | |
| | | } |
| | | |
| | | |
| | | var HBillNo = HInterID.Split(','); |
| | | var HInterIDs = HInterID.Split(','); |
| | | string[] HBillNo = new string[HInterIDs.Length]; |
| | | DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); |
| | | |
| | | //è·åç³»ç»åæ° |
| | | string Ret = ""; |
| | | oSystemParameter.ShowBill(ref Ret); |
| | | |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | if (long.Parse(HBillNo[i]) == 0) |
| | | if (long.Parse(HInterIDs[i]) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (oBill.ShowBill(long.Parse(HInterIDs[i]), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | HBillNo[i] = oBill.omodel.HBillNo; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | int j = 0; |
| | | for (int i = 0; i < HBillNo.Length; i++) |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeUnCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | if (Cj_StationOutBillAbandonCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationOutBillAbandonCheckBill(long.Parse(HInterIDs[i]),HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | j += 1; |
| | | } |
| | |
| | | } |
| | | |
| | | //åå®¡æ ¸ |
| | | public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, bool HLastSubProc, ref string sReturn) |
| | | public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, bool HLastSubProc, ref string sReturn) |
| | | { |
| | | if (Cj_StationInBillisUse(lngBillKey, ref sReturn)) |
| | | { |
| | |
| | | else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "æ¯") |
| | | { |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_StationOutBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterUnCheckCtrl"); |
| | | 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 = sReturn + "åå®¡æ ¸åè½ï¼"; |
| | | oCN.Commit(); |
| | | return true; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string HBillNo = ""; |
| | | |
| | | DataSet Ds = oCN.RunProcReturn("Select * from Sc_ProcExchRecordBackBillMain Where HInterID=" + HInterID, "Sc_ProcExchRecordBackBillMain"); |
| | | if (Ds.Tables[0].Rows.Count > 0) |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //å®¡æ ¸ |
| | | if (Cj_StationInBillCheckBill(HInterID, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationInBillCheckBill(HInterID, HBillNo, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | public bool Cj_StationInBillCheckBill(Int64 HInterID, int num, string CurUserName, ref string sReturn) |
| | | public bool Cj_StationInBillCheckBill(Int64 HInterID,string HBillNo, int num, string CurUserName, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (num == 1) |
| | | { |
| | | oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='" + CurUserName + "',HBillStatus=2,HCheckDate=getdate() Where HInterID=" + HInterID.ToString()); |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl"); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | if (num == 2) |
| | | { |
| | | oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='',HBillStatus=1,HCheckDate=null Where HInterID=" + HInterID.ToString()); |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl"); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcExchSendWorkBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchSendWorkBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchSendWorkBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcExchSendWorkBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchSendWorkBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchSendWorkBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | #region å·¥åºå§å¤æ´¾å·¥åå®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("WW_EntrustWorkOrderBill/CheckSWW_EntrustWorkOrderBill")] |
| | | [HttpGet] |
| | | public object CheckSWW_EntrustWorkOrderBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é å§å¤å·¥åºæ´¾å·¥å_å®¡æ ¸ |
| | | if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "WW_EntrustWorkOrderBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已åå®¡æ ¸!ä¸éè¦ååå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºå§å¤æ´¾å·¥å å
³é/åå
³éåè½ |
| | | [Route("WW_EntrustWorkOrderBill/CloseWW_EntrustWorkOrderBill")] |
| | | [HttpGet] |
| | | public object CloseWW_EntrustWorkOrderBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é å§å¤å·¥åºæ´¾å·¥å_å
³é |
| | | if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "WW_EntrustWorkOrderBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å
³é 2 åå
³é |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å
³é |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸éè¦åå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //å
³éåæ® |
| | | if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå
³é |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已åå
³é!ä¸éè¦ååå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //åå
³éåæ® |
| | | if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºå§å¤æ´¾å·¥å ä½åº/åä½åº |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">ä½åº(0),åä½åº(1)</param> |
| | | /// <param name="CurUserName">ä½åºäºº</param> |
| | | /// <returns></returns> |
| | | [Route("WW_EntrustWorkOrderBill/DropWW_EntrustWorkOrderBill")] |
| | | [HttpGet] |
| | | public object DropWW_EntrustWorkOrderBill(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "WW_EntrustProcSendWorkBill_Drop"; //å§å¤å·¥åºæ´¾å·¥å_ä½åº |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //æ£æ¥æé |
| | | if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä½åºå¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //HInterIDæ°æ®å¤æ |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterIDå°äº0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from WW_EntrustWorkOrderBillMain", "WW_EntrustWorkOrderBillMain"); |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (ds.Tables[0].Rows.Count>0) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //ä½åºå¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åä½åºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åä½åºå¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") |
| | | { |
| | | 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) //ä½åºæäº¤ |
| | | { |
| | | //ä½åºæäº¤ |
| | | if (Cancelltion(HInterID, 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) //åå
³éæäº¤ |
| | | { |
| | | //åå
³éæäº¤ |
| | | if (AbandonCancelltion(HInterID, 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; |
| | | } |
| | | } |
| | | |
| | | //ä½åº |
| | | public bool Cancelltion(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | string HDeleteMan = ClsPub.CurUserName; |
| | | string HDeleteDate = ClsPub.GetServerDate(-1); |
| | | oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='" + HDeleteMan + "',HDeleteDate='" + HDeleteDate + "',HBillStatus=4 Where HInterID=" + lngBillKey.ToString()); |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //åä½åº |
| | | public bool AbandonCancelltion(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select * from WW_EntrustWorkOrderBillMain where HInterID=" + lngBillKey.ToString(), "WW_EntrustWorkOrderBillMain"); |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString()); |
| | | } |
| | | else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString()); |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc(" Update WW_EntrustWorkOrderBillMain set HDeleteMan='',HDeleteDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString()); |
| | | } |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | //} |
| | | //#endregion |
| | | |
| | | #region å·¥èºè·¯çº¿å®¡æ ¸/åå®¡æ ¸åè½ |
| | | #region å·¥åºè¿å·¥ç³è¯·å å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("Sc_ProcExchWorkBackBill/CheckSc_ProcExchWorkBackBill")] |
| | | [HttpGet] |
| | | public object CheckSc_ProcExchWorkBackBill(string HInterID, int Type, string user) |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcExchWorkBackBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchWorkBackBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchWorkBackBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcExchWorkBackBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchWorkBackBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcExchWorkBackBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcessExchangeBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchangeBill_BeforeCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcessExchangeBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶ |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | sql = "exec h_p_Sc_ProcessExchangeBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchangeBill_BeforeUnCheckCtrl"); |
| | | 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]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ProcessExchangeBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | string msg2 = "[" + sArray[0].ToString() + "]"; |
| | | string user = sArray[1].ToString();//ç¨æ·å |
| | | string OperationType = sArray[2].ToString();//ç±»å |
| | | string msg_entry = sArray[3].ToString(); //æç»è¡ä¿¡æ¯ |
| | | |
| | | //夿æ¯å¦æç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("QC_ProcessCheckBill_Edit", 1, false, user)) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsQC_ProcessCheckBill BillNew = new DAL.ClsQC_ProcessCheckBill(); |
| | | |
| | | List<Model.ClsQC_ProcessCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillMain>>(msg2); |
| | | string BillType = "7507"; |
| | |
| | | double HPeriod = DateTime.Now.Month; |
| | | long HSourceID = list[0].HSourceID;//çäº§èµæº |
| | | long HICMOInterID = list[0].HICMOInterID;//ä»»å¡åID |
| | | long HICMOEntryID = list[0].HICMOEntryID;//ä»»å¡ååID |
| | | string HICMOBillNo = list[0].HICMOBillNo;//ä»»å¡å |
| | | string HProcExchBillNo = list[0].HProcExchBillNo;//æå¼å¡ |
| | | long HMaterID = list[0].HMaterID;//产åID |
| | |
| | | long HProcID = list[0].HProcID;//å·¥åºID |
| | | long HPRDORGID = list[0].HPRDORGID;//ç»ç»ID |
| | | bool HLastResult = list[0].HLastResult;//è¯æ ·ç»è®º |
| | | |
| | | //è¡¨ä½æ°æ® |
| | | List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg_entry); |
| | | for (int i = 0; i < subList.ToArray().Length; i++) |
| | | { |
| | | if (subList.ToArray().Length >= 0) |
| | | { |
| | | Model.ClsQC_ProcessCheckBillSub oSub = new Model.ClsQC_ProcessCheckBillSub(); |
| | | oSub.HEntryID = i + 1; |
| | | oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark); |
| | | oSub.HSourceInterID = ClsPub.isLong(subList[i].HSourceInterID); |
| | | oSub.HSourceEntryID = ClsPub.isLong(subList[i].HSourceEntryID); |
| | | oSub.HSourceBillType = ClsPub.isStrNull(subList[i].HSourceBillType); |
| | | oSub.HSourceBillNo = ClsPub.isStrNull(subList[i].HSourceBillNo); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(subList[i].HRelationQty); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(subList[i].HRelationMoney); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(subList[i].HCloseMan); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(subList[i].HCloseType); |
| | | oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(subList[i].HQCCheckItemID); |
| | | oSub.HQCStd = DBUtility.ClsPub.isStrNull(subList[i].HQCStd); |
| | | oSub.HResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); |
| | | oSub.HQCRelValue = DBUtility.ClsPub.isStrNull(subList[i].HQCRelValue); |
| | | //oSub.HProcCheckTime = HDate; |
| | | //oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); |
| | | //oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp); |
| | | oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID); |
| | | oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty); |
| | | oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty); |
| | | oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty); |
| | | oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty); |
| | | oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty); |
| | | oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus); |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID); |
| | | oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal); |
| | | oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal); |
| | | oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit); |
| | | oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit); |
| | | oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet); |
| | | oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet); |
| | | oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod); |
| | | oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); |
| | | oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); |
| | | oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult == "true" ? 1 : 0); |
| | | |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æç»è¡ä¿¡æ¯!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //忮宿´æ§å¤æ |
| | | if (HProcExchBillNo == "") |
| | |
| | | } |
| | | oCN.RunProc("Insert Into QC_ProcessCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HPRDORGID,HLastResult)" + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HPRDORGID + ",'" + HLastResult + "') "); |
| | | |
| | | //æå
¥å表 |
| | | foreach (Model.ClsQC_ProcessCheckBillSub oSub in BillNew.DetailColl) |
| | | { |
| | | oCN.RunProc("Insert into QC_ProcessCheckBillSub " + |
| | | " (HInterID,HBillNo_bak,HEntryID" + |
| | | ",HRemark,HSourceInterID" + |
| | | ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue,HResult" + |
| | | ",HProcCheckEmp,HProcCheckTime,HStatus,HUnitID,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" + |
| | | ") values(" |
| | | + HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'," + HICMOInterID.ToString() + |
| | | "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "','" + oSub.HResult + "'" + |
| | | "," + oSub.HProcCheckEmp.ToString() + ",GETDATE()" + ",'" + oSub.HStatus + |
| | | "'," + oSub.HUnitID + "," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + |
| | | ") "); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | string HBackerDate = mainList[0].HBackerDate; |
| | | string HBackRemark = mainList[0].HBackRemark; |
| | | |
| | | |
| | | //if (OperationType == 2) |
| | | //{ |
| | | // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); |
| | | // if (ds.Tables[0].Rows.Count > 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_ErrWorkTimesRequestBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_ErrWorkTimesRequestBillMain"); |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //ä¿ååæ§å¶ |
| | | DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl"); |
| | | if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | string HBackerDate = mainList[0].HBackerDate; |
| | | string HBackRemark = mainList[0].HBackRemark; |
| | | |
| | | |
| | | //if (OperationType == 2) |
| | | //{ |
| | | // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); |
| | | // if (ds.Tables[0].Rows.Count > 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_GroupBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_GroupBalBill_BeforeSaveCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_GroupBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_GroupBalBillMain"); |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //ä¿ååæ§å¶ |
| | | DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_GroupBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_GroupBalBill_AfterSaveCtrl"); |
| | | if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | string HBackerDate = mainList[0].HBackerDate; |
| | | string HBackRemark = mainList[0].HBackRemark; |
| | | |
| | | |
| | | //if (OperationType == 2) |
| | | //{ |
| | | // ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain"); |
| | | // if (ds.Tables[0].Rows.Count > 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ProcPriceRequestBill_BeforeSaveCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_ProcPriceRequestBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_ProcPriceRequestBillMain"); |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //ä¿ååæ§å¶ |
| | | DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ProcPriceRequestBill_AfterSaveCtrl"); |
| | | if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | DateTime HMakerDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); |
| | | string HUpdater = mainList[0].HUpdater; |
| | | DateTime HUpdaterDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); |
| | | |
| | | |
| | | //if (OperationType == 2) |
| | | //{ |
| | | // ds = oCN.RunProcReturn("select * from PM_ProjectStageBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectStageBill"); |
| | | // if (ds.Tables[0].Rows.Count > 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_SingleBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_SingleBalBill_BeforeSaveCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Pay_SingleBalBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_SingleBalBillMain"); |
| | | |
| | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //ä¿ååæ§å¶ |
| | | DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_SingleBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_SingleBalBill_AfterSaveCtrl"); |
| | | if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | public DAL.ClsPM_WorkTaskWeekBill BillNew0 = new DAL.ClsPM_WorkTaskWeekBill(); //å·¥ä½å¨è®¡å对åºåæ®ç±» |
| | | public DAL.ClsPM_WorkTaskWeekBill BillOld0 = new DAL.ClsPM_WorkTaskWeekBill(); //å·¥ä½å¨è®¡å对åºåæ®ç±» |
| | | public DAL.ClsPM_WorkReportWeekBillMain BillNew = new DAL.ClsPM_WorkReportWeekBillMain(); //å·¥ä½å¨æ»ç»å¯¹åºåæ®ç±» |
| | | public DAL.ClsPM_WorkReportWeekBillMain BillOld = new DAL.ClsPM_WorkReportWeekBillMain(); //å·¥ä½å¨æ»ç»å¯¹åºåæ®ç±» |
| | | |
| | | |
| | | #region å·¥ä½å¨è®¡å å表2-å¾
æè®¡å æ°æ®è·å |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» éæ©æ»ç»äººå¸¦åºå·¥æ¶ |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillMainList(string HOrgID,string user,string HYear,string HWeek,string HBeginDate,string HEndDate) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | string sql = "exec h_p_PM_WorkReportWeekBillMain "+ HOrgID+","+ user+","+ HYear+","+ HWeek+",'"+ HBeginDate + "','"+ HEndDate + "'"; |
| | | ds = oCn.RunProcReturn(sql, "h_p_PM_WorkReportWeekBillMain"); |
| | | |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªè·åå°ç¸å
³æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥è¯¢æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å·¥ä½å¨æ»ç»ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ä¿åçäº§é¢æå |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("PM_WorkTaskWeekBill/SavePM_WorkReportWeekBillMain")] |
| | | [HttpPost] |
| | | public object SavePM_WorkReportWeekBillMain([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string refSav = sArray[1].ToString(); //æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string user = sArray[2].ToString();//ç¨æ·å |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | //ä¿åæé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Add", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DAL.ClsPM_WorkReportWeekBillMain oBill = new DAL.ClsPM_WorkReportWeekBillMain(); |
| | | List<Model.ClsPM_WorkReportWeekBillMain> lsmain = new List<Model.ClsPM_WorkReportWeekBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_PM_WorkReportWeekBillMain(msg2); |
| | | foreach (Model.ClsPM_WorkReportWeekBillMain oItem in lsmain) |
| | | { |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å
许ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (BillOld.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + "ï¼ä¸å
许修æ¹"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HBillType = "4757"; |
| | | oItem.HBillSubType = "4757"; |
| | | |
| | | //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (refSav == "Add") |
| | | { |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (refSav == "Update") |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = false; |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("PM_WorkTaskWeekBill/CheckPM_WorkReportWeekBillMain")] |
| | | [HttpGet] |
| | | public object CheckSc_ICMOReportBill(string HInterID, int IsAudit, string user) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID=" + HInterID, "PM_WorkReportWeekBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCn.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» å
³é/åå
³éåè½ |
| | | [Route("PM_WorkTaskWeekBill/ClosePM_WorkReportWeekBillMain")] |
| | | [HttpGet] |
| | | public object ClosePM_WorkReportWeekBillMain(string HInterID, int IsAudit, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | var ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID=" + HInterID, "PM_WorkReportWeekBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å
³é夿 |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½å次å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³é夿 |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå
³é!ä¸éè¦åå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCn.Commit(); |
| | | |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | #endregion èªå®ä¹æ¹æ³ |
| | | |
| | | |
| | | //ä¿ååæ§å¶ |
| | | public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_OtherBalBill_BeforeSaveCtrl"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿ååæ§å¶ |
| | | public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds = oCn.RunProcReturn("Exec h_p_Pay_OtherBalBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_OtherBalBill_AfterSaveCtrl"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | public bool CheckStockQty(long HMaterID, long HWhID, string sBatchNo) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("Select 峿¶åºå from h_v_KF_ICInventoryList Where HMaterID=" + HMaterID.ToString() + " and HWHID=" + HWhID.ToString() + " and æ¹æ¬¡='" + sBatchNo + "'", "h_v_KF_ICInventoryList"); |
| | | if (Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | return false; |
| | | } |
| | | //夿æ¯å¦è´åºåæ0åºå |
| | | if (DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0][0]) <= 0) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | |
| | | //ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //ä¿ååæ§å¶ |
| | | if(!BeforeSave(lngBillKey, omodel.HBillNo,2, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Pay_OtherBalBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | |
| | | // return false; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCn.BeginTran(); |
| | | //ä¿ååæ§å¶ |
| | | if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //主表 |
| | | oCn.RunProc("Insert Into Pay_OtherBalBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | |
| | | // } |
| | | //} |
| | | // |
| | | //ä¿ååæ§å¶ |
| | | if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | |
| | | |
| | | #endregion èªå®ä¹æ¹æ³ |
| | | |
| | | |
| | | //ä¿ååæ§å¶ |
| | | public bool BeforeSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds = oCn.RunProcReturn("Exec h_p_Pay_WorkTimesBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_WorkTimesBill_BeforeSaveCtrl"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿ååæ§å¶ |
| | | public bool AfterSave(Int64 HInterID, string HBillNo, Int64 OperationType, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds = oCn.RunProcReturn("Exec h_p_Pay_WorkTimesBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_WorkTimesBill_AfterSaveCtrl"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //ä¿ååæ§å¶ |
| | | if (!BeforeSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Pay_WorkTimesBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | |
| | | // return false; |
| | | // } |
| | | //} |
| | | //ä¿ååæ§å¶ |
| | | if (!AfterSave(lngBillKey, omodel.HBillNo, 2, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCn.BeginTran(); |
| | | //ä¿ååæ§å¶ |
| | | if (!BeforeSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //主表 |
| | | oCn.RunProc("Insert Into Pay_WorkTimesBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | |
| | | // } |
| | | //} |
| | | // |
| | | //ä¿ååæ§å¶ |
| | | if (!AfterSave(omodel.HInterID, omodel.HBillNo, 1, ref sReturn)) |
| | | { |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | List<Models.ClsGy_StockCheckItemBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_StockCheckItemBill>>(jsonString); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// å¤çæ°å¢å¨æ»ç»è¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsPM_WorkReportWeekBillMain> getObjectByJson_PM_WorkReportWeekBillMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsPM_WorkReportWeekBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_WorkReportWeekBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ä¿å
»è®°å½è¡¨ä¸»è¡¨çjson |
| | |
| | | <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>--> |
| | | <!--<add key="FileIP" value="http://localhost:8080/" />--> |
| | | <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/> --> |
| | | <!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/>--><!--é¢å°å¼æº--> |
| | | <add key="sUrl" value="http://192.168.63.53/WEBS-WMS/WebService1.asmx"/><!--é¢å°å¼æº--> |
| | | <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®--> |
| | | <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> --> |
| | | <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/> åæ¥ç§æ--> |
| | |
| | | <!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/> å®çæå¡å¨--> |
| | | <!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> --> <!--æµè¯æå¡å¨--> |
| | | <!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/> æ¬å°--> |
| | | <add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/> <!--éé¯éæ¬å°é
ç½®--> |
| | | <!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>--> <!--éé¯éæ¬å°é
ç½®--> |
| | | <!--<add key="sUrl" value="http://192.168.1.57:8082/WEBS-WMS/WebService1.asmx"/>--> <!--ä¹è±--> |
| | | <!--<add key="sUrl" value="http://192.168.60.12/WEBS-WMS/WebService1.asmx"/>--> <!--䏿§--> |
| | | <add key="webpages:Version" value="3.0.0.0" /> |
| | | <add key="webpages:Enabled" value="false" /> |
| | | <add key="ClientValidationEnabled" value="true" /> |