Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | { |
| | | try |
| | | { |
| | | // |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeUseBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeUseBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldLifeUseBillMain set " + |
| | |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HBillStatus=" + omodel.HBillStatus.ToString() + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HUpDater='" + omodel.HMaker + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HMangerID=" + omodel.HMangerID.ToString() + |
| | |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HDesignLife,HLeaveLife,HUseLife,HNewLeaveLife" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID + "," + oSub.HUnitID + "," + oSub.HDesignLife + "," + oSub.HLeaveLife + "," + oSub.HUseLife + "," + oSub.HNewLeaveLife + ") "); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeUseBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeUseBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeUseBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeUseBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | |
| | | } |
| | | // |
| | | oCn.BeginTran(); |
| | | //HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | // ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | // ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HSupID,HEquipID,HFirstCheckEmp,HCheckerResult |
| | | //主表 |
| | | oCn.RunProc("Insert Into Sc_MouldLifeUseBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HMangerID,HDeptID" + |
| | | ",HYear,HPeriod,HRemark,HMangerID,HDeptID" + |
| | | ",HBillStatus,HBackRemark,HMaker,HMakeDate,HMainSourceBillType" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HPrintQty" + |
| | | ",HCheckItemNowID,HCheckItemNextID,HCheckFlowID,HBacker,HChecker,HUpDater" + |
| | | ",HCloseMan,HCloseType,HDeleteMan,HReason,HExplanation,HInnerBillNo" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | ", " + omodel.HMangerID.ToString() + "," + omodel.HDeptID.ToString() + "," + 1 + ",'" + omodel.HBackRemark + |
| | | ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + |
| | | "', " + omodel.HMangerID.ToString() + "," + omodel.HDeptID.ToString() + "," + 1 + ",'" + omodel.HBackRemark + |
| | | "','" + omodel.HMaker + "','" + omodel.HMakeDate + "','" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID + |
| | | "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HPrintQty + ",0,0,0" + ",'" + omodel.HBacker + |
| | | "','" + omodel.HChecker + "','" + omodel.HUpDater + "','" + omodel.HCloseMan + "'," + 0 + ",'" + omodel.HDeleteMan + |
| | |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HDesignLife,HLeaveLife,HUseLife,HNewLeaveLife" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID + "," + oSub.HUnitID + "," + oSub.HDesignLife + "," + oSub.HLeaveLife + "," + oSub.HUseLife + "," + oSub.HNewLeaveLife + ") "); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeUseBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeUseBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | { |
| | | try |
| | | { |
| | | // |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldMaintainPlanBillMain set " + |
| | |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | //",HStockType='" + omodel.HStockType + "'" + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HUpDater='" + omodel.HMaker + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | //",HDeptID=" + omodel.HDeptID.ToString() + |
| | |
| | | // return false; |
| | | // } |
| | | //} |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | |
| | | ",HInnerBillNo,HExplanation,HMouldMaintainRuleID,HMaintainLevID,HMainSourceInterID,HMainSourceBillNo,HMouldID" + |
| | | ",HUSEORGID,HCREATEORGID,HDeptID,HErrWarQtys" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+ |
| | | ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "'" + |
| | | ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "','" + omodel.HMouldMaintainRuleID + "'," + omodel.HMaintainLevID + |
| | |
| | | // } |
| | | //} |
| | | // |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using SyntacticSugar.constant; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·å¯¿å½èç¨åå页å表 |
| | | [Route("Sc_MouldLifeUseBill/page")] |
| | | [HttpGet] |
| | | public object Sc_MouldLifeUseBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeUseBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldLifeUseBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldLifeUseBillList_Query"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldLifeUseBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldLifeUseBillList_Query"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Sc_MouldLifeUseBill/cx")] |
| | | [HttpGet] |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBillList where HMainID =" + HInterID, "h_v_Sc_MouldLifeUseBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBill_Edit where HMainID =" + HInterID, "h_v_Sc_MouldLifeUseBill_Edit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | ListModels oListModels = new ListModels(); |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsSc_MouldLifeUseBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLifeUseBillMain>>(msg2); |
| | | { |
| | | DAL.ClsSc_MouldLifeUseBill oBill = new DAL.ClsSc_MouldLifeUseBill(); |
| | | List<Model.ClsSc_MouldLifeUseBillMain> lsmain = new List<Model.ClsSc_MouldLifeUseBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_MouldLifeUseBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldLifeUseBillMain oItem in lsmain) |
| | | { |
| | | oItem.HBillType = "3845"; |
| | | oItem.HBillSubType = "3845"; |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | oItem.HMaker = user; |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HBillStatus = 1;//åæ®ç¶æ |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HMangerID = mainList[0].HMangerID;//è´è´£äºº |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | string HReason = mainList[0].HReason;//åæ´åå |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HMaker = user;//å¶å人 |
| | | //è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsSc_MouldLifeUseBillSub> ls = new List<Model.ClsSc_MouldLifeUseBillSub>(); |
| | | ls = oListModels.getObjectByJson_Gy_MouldLifeUseBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSc_MouldLifeUseBillSub oItemSub in ls) |
| | | { |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | bool bResult = false; |
| | | |
| | | if ((OperationType == 1 || OperationType == 2))//æ°å¢ && ds.Tables[0].Rows.Count == 0 |
| | | { |
| | | //DataSet Ds; |
| | | //Int64 NewHInterID = 1; |
| | | //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0) |
| | | //{ |
| | | // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | // NewHInterID += 1; |
| | | //} |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Sc_MouldLifeUseBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HMangerID,HDeptID,HReason,HExplanation,HInnerBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3845 + "','" + |
| | | mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark + |
| | | "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID + |
| | | "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HMangerID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")"); |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0 |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Sc_MouldLifeUseBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason + |
| | | "',HExplanation='" + HExplanation + "',HMangerID=" + HMangerID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Sc_MouldLifeUseBillSub where HInterID='" + HInterID + "'"); |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | #region [模å
·å¯¿å½èç¨åå é¤åè½] |
| | | /// <summary> |
| | | /// 模å
·å¤çèç¨åå é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldLifeUseBill/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HInterID, string user) |
| | | public object DeltetMouldLifeUseBill(string HInterID, string user) |
| | | { |
| | | try |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeUseBill_Delete", 1, false, user)) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Sc_MouldLifeUseBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Sc_MouldLifeUseBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | if (lngBillKey == 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.Message = "åæ®ID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_MouldLifeUseBill oBill = new DAL.ClsSc_MouldLifeUseBill(); |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HChecker != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_MouldLifeUseBill_BeforeDelCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldLifeUseBill_BeforeDelCtrl"); |
| | | 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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeUseBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | 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("Sc_MouldLifeUseBill/CloseSc_MouldLifeUseBill")] |
| | | [HttpGet] |
| | | public object CloseSc_MouldLifeUseBill(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_MouldLifeUseBill_Close"; |
| | | 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; |
| | | } |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsSc_MouldLifeUseBill oBill = new DAL.ClsSc_MouldLifeUseBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½å次å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå
³é!ä¸éè¦åå
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¿è¡éè¦è¿è¡çå
³é/åå
³éæä½ |
| | | if (IsAudit == 0) //å
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //å
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldLifeUseBill_BeforeCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldLifeUseBill_BeforeCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :å
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //å
³éæäº¤ |
| | | if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeUseBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //åå
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldLifeUseBill_BeforeUnCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldLifeUseBill_BeforeUnCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :åå
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå
³éæäº¤ |
| | | if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeUseBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败æè
åå
³é失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å¨å
·å¯¿å½è¶å¿åææ¥è¡¨ æ¥è¯¢ |
| | | /// <summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 模å
·ä¿å
»è®¡åå页å表 |
| | | [Route("Sc_MouldMaintainPlanBill/page")] |
| | | [HttpGet] |
| | | public object Sc_MouldMaintainPlanBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 模å
·æ
éç»è®°è¡¨å表 |
| | |
| | | if (string.IsNullOrEmpty(HID)) |
| | | return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainPlanBillList where hmainid= " + HID + " ", "h_v_Sc_MouldMaintainPlanBillList"); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainPlanBill_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldMaintainPlanBill_Edit"); |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨ä¿å
»è®¡åå" }; |
| | | return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_MouldMaintainPlanBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainPlanBill_BeforeDelCtrl"); |
| | | 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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, BillOld.omodel.HBillNo, "h_p_Sc_MouldMaintainPlanBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldLifeChangeBillList where hmainid= " + HID + " ", "h_v_Sc_MouldLifeChangeBillList"); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldLifeChangeBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldLifeChangeBillList_Edit"); |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨éåºåå·" }; |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_MouldLifeChangeBill_BeforeDelCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldLifeChangeBill_BeforeDelCtrl"); |
| | | 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; |
| | | } |
| | | //================================================================================== |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeChangeBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·å¯¿å½è°æ´ å
³é/åå
³é |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å
³é(0),åå
³é(1)</param> |
| | | /// <param name="CurUserName">å
³é人</param> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldLifeChangeBill/CloseSc_MouldLifeChangeBill")] |
| | | [HttpGet] |
| | | public object CloseSc_MouldLifeChangeBill(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_MouldLifeChangeBill_Close"; |
| | | 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; |
| | | } |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsSc_MouldLifeChangeBill oBill = new DAL.ClsSc_MouldLifeChangeBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½å次å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå
³é!ä¸éè¦åå
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¿è¡éè¦è¿è¡çå
³é/åå
³éæä½ |
| | | if (IsAudit == 0) //å
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //å
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldLifeChangeBill_BeforeCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCn.RunProcReturn(sql, "h_p_Sc_MouldLifeChangeBill_BeforeCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :å
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //å
³éæäº¤ |
| | | if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeChangeBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //åå
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldLifeChangeBill_BeforeUnCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCn.RunProcReturn(sql, "h_p_Sc_MouldLifeChangeBill_BeforeUnCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :åå
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå
³éæäº¤ |
| | | if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldLifeChangeBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败æè
åå
³é失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region å¨å
·ä¿å
»è®¡ååå®¡æ ¸/åå®¡æ ¸åè½ |
| | |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | DAL.ClsSc_MouldMaintainPlanBill oBill = new DAL.ClsSc_MouldMaintainPlanBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(Convert.ToInt32(HInterID), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (Type == 1) //å®¡æ ¸å¤æ |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (Type == 2) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_MouldMaintainPlanBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainPlanBill_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; |
| | | oCN.RollBack(); |
| | | 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; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | if (!BillOld.CheckBill(int.Parse(HInterID), oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainPlanBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //èªå¨çæç¹æ£è®¡åå |
| | | oCN.RunProc("exec h_p_Sc_MouldMaintainPlan_Auto " + HInterID); |
| | | } |
| | | else |
| | | { |
| | | if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Sc_MouldMaintainPlanBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainPlanBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åå®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | else |
| | | 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), oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainPlanBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·ä¿å
»è®¡å å
³é/åå
³é |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å
³é(0),åå
³é(1)</param> |
| | | /// <param name="CurUserName">å
³é人</param> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldMaintainPlanBill/CloseSc_MouldMaintainPlanBill")] |
| | | [HttpGet] |
| | | public object CloseSc_MouldMaintainPlanBill(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_MouldMaintainPlanBill_Close"; |
| | | 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; |
| | | } |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsSc_MouldMaintainPlanBill oBill = new DAL.ClsSc_MouldMaintainPlanBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸è½è¿è¡å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //å
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½å次å
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³é夿 |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå
³é!ä¸éè¦åå
³éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¿è¡éè¦è¿è¡çå
³é/åå
³éæä½ |
| | | if (IsAudit == 0) //å
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //å
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldMaintainPlanBill_BeforeCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainPlanBill_BeforeCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :å
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //å
³éæäº¤ |
| | | if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainPlanBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå
³éæäº¤ |
| | | { |
| | | string sql = ""; |
| | | //åå
³éåæ§å¶===============================================Begin=================================================================== |
| | | sql = "exec h_p_Sc_MouldMaintainPlanBill_BeforeUnCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainPlanBill_BeforeUnCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :åå
³éååå¤æå¤±è´¥ï¼æ è¿åä¿¡æ¯ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå
³éåæ§å¶===============================================End=================================================================== |
| | | |
| | | //åå
³éæäº¤ |
| | | if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainPlanBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³éæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
³é失败æè
åå
³é失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region[å¨å
·ä¿å
»è®¡å表ç¼è¾æ¶è·åè¡¨ä½æ°æ®--ä¿å
»è®¡å] |
| | | [Route("Sc_MouldMaintainPlanBill/GetPlanList")] |
| | | [HttpGet] |
| | |
| | | { |
| | | try |
| | | { |
| | | // |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_MouldLifeChangeBillMain set " + |
| | |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | |
| | | // } |
| | | //} |
| | | // |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·å¯¿å½èç¨åå表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSc_MouldLifeUseBillMain> getObjectByJson_Gy_MouldLifeUseBillMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_MouldLifeUseBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldLifeUseBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·å¯¿å½èç¨åå表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsSc_MouldLifeUseBillSub> getObjectByJson_Gy_MouldLifeUseBillSub(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_MouldLifeUseBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldLifeUseBillSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢çäº§æ±æ¥åå主表çjson |