Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsPM_WorkPlanMonthBillMain : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsPM_WorkPlanMonthBillMain omodel = new Model.ClsPM_WorkPlanMonthBillMain(); |
| | | public List<Model.ClsPM_WorkPlanMonthBillSub> DetailColl = new List<Model.ClsPM_WorkPlanMonthBillSub>(); |
| | | |
| | | public ClsPM_WorkPlanMonthBillMain() |
| | | { |
| | | base.MvarItemKeySub = "PM_WorkPlanMonthBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey= "PM_WorkPlanMonthBillMain"; |
| | | base.MvarReportTitle="æåº¦é¶æ®µè®¡å"; |
| | | base.BillType="4758"; |
| | | base.HBillSubType = "4758"; |
| | | |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | #region æ åæé 彿° |
| | | ~ClsPM_WorkPlanMonthBillMain() |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | //#region ä¿®æ¹åæ® |
| | | //public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | //{ |
| | | // try |
| | | // { |
| | | // oCn.BeginTran(); |
| | | // //æ´æ°ä¸»è¡¨ |
| | | // string mainSql = "update PM_WorkPlanMonthBillMain 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_WorkPlanMonthBillMain where HInterID = " + omodel.HInterID, "PM_WorkPlanMonthBillMain"); |
| | | 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_WorkPlanMonthBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + |
| | | ",HOrgID,HMonth,HBeginDate,HEndDate,HPlanEmpID) " + |
| | | "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.HMonth + |
| | | ",'" + omodel.HBeginDate + |
| | | "','" + omodel.HEndDate + |
| | | "','" + omodel.HPlanEmpID + |
| | | "')"; |
| | | |
| | | oCn.RunProc(mainSql); |
| | | |
| | | //æå
¥å表 |
| | | foreach (Model.ClsPM_WorkPlanMonthBillSub oSub in DetailColl) |
| | | { |
| | | string subSql = "insert into PM_WorkPlanMonthBillSub" + |
| | | "" + |
| | | "" + |
| | | "" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HProNumber,HProjectStageID,HRate,HAvgMoney,HCountMoney) " + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | | "," + oSub.HSourceInterID + |
| | | "," + oSub.HSourceEntryID + |
| | | ",'" + oSub.HSourceBillNo + |
| | | "','" + oSub.HSourceBillType + |
| | | "','" + oSub.HProNumber + |
| | | "'," + oSub.HProjectStageID + |
| | | "," + oSub.HRate + |
| | | ",'" + oSub.HAvgMoney+ |
| | | "','" + oSub.HCountMoney + |
| | | "')"; |
| | | 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="ClsPay_EarlyLateErrBill.cs" /> |
| | | <Compile Include="ClsPay_RewardPunishBill.cs" /> |
| | | <Compile Include="ClsPay_WorkErrTimesBill.cs" /> |
| | | <Compile Include="ClsPM_WorkPlanMonthBillMain.cs" /> |
| | | <Compile Include="MES\ClsSc_SourceLineRepairBill.cs" /> |
| | | <Compile Include="MES\ClsSc_MESMaterToSourceBill .cs" /> |
| | | <Compile Include="人äºç®¡ç\ClsHR_EmpFosterBill.cs" /> |
| | |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_LadingBillSub.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillMain.cs" /> |
| | | <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillSub.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkPlanMonthBillMain.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkReportWeekBillSub.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkReportWeekBillMain.cs" /> |
| | | <Compile Include="项ç®ç®¡ç\ClsPM_WorkPlanMonthBillSub.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_WorkPlanMonthBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HOrgID; //int ç»ç» |
| | | //public Int64 HYear; //int 年份 |
| | | public Int64 HMonth; //int æ |
| | | public string HBeginDate; //datetime å¼å§æ¥æ |
| | | public string HEndDate; //datetime ç»ææ¥æ |
| | | public Int64 HPlanEmpID; //int 计å人 |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsPM_WorkPlanMonthBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public Int64 HProjectID; |
| | | public string HProNumber; |
| | | public Int64 HProjectStageID; |
| | | public decimal HRate; |
| | | public decimal HAvgMoney; |
| | | public decimal HCountMoney; |
| | | } |
| | | } |
| | |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_POInStockBill_BeforeSaveCtrl " + HInterID, "h_p_Cg_POInStockBill_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; |
| | | } |
| | | //========================================================= |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Cg_POInStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate |
| | |
| | | {HSUPPLYLOT},{HREQTRACENO},{HBOMID},{HSTOCKUNITID},{HBASEUNITID},{HSTOCKSTATUSID},'{HKEEPERTYPEID}',{HPROJECTNO},{HCHECKINCOMING},{oSub.HTaxPrice},{HDISCOUNTRATE},{HPRICECOEFFICIENT},{HPRICEUNITID},{HPRICELISTENTRY},{HSAMPLEDAMAGEQTY},{HSAMPLEDAMAGEBASEQTY},{HPAYORGID},{HSETTLEORGID},{HSETTLECURRID},{HSETTLEMODEID},{HEXCHANGETYPEID},{HPAYCONDITONID},{oSub.HEXCHANGERATE},{HLOCALCURRID},{HISINCLUDEDTAX},{HISPRICEEXCLUDETAX},{HTAXRATEID},{HCOSTPERCENT},{HCOSTAMOUNT},{HVAT},{HSELLERWITHHOLDING},{HBUYERWITHHOLDING},{oSub.HSecUnitID})"); |
| | | |
| | | } |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_POInStockBill_AfterSaveCtrl " + HInterID, "h_p_Cg_POInStockBill_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; |
| | |
| | | [HttpGet] |
| | | public object AuditCg_POInStockBill(string HInterID, int Type, string user) |
| | | { |
| | | string sql = ""; |
| | | //ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Cg_POInStockBillMain"; |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from Cg_POInStockBillMain where HInterID = " + int.Parse(HInterID), "Cg_POInStockBillMain"); |
| | | string HBillNo = ""; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //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_POInStockBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_POInStockBill_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_POInStockBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_POInStockBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_POInStockBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_POInStockBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBill_BeforeSaveCtrl " + HInterID, "h_p_Cg_POOrderBill_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_POOrderBillMain", "Cg_POOrderBillMain"); |
| | |
| | | {HAuxPropID},{HMTONo},{HERPInterID},{HERPEntryID},{HSEQ},{HRECEIVEDEPTID},'{HSUPPLIERLOT}',{HBOMID},{HSTOCKUNITID},{HBASEUNITID},'{HBFLOWID}',{HGIVEAWAY},{HROWTYPE},{HBASEUNITQTY},{HSTOCKBASEQTY},'{HREQTRACENO}',{HTAXNETPRICE},{HPRICECOEFFICIENT},{HTAXCOMBINATION},{HPRICEUNITID},{HPRICELISTENTRY},{HPAYORGID},{HSETTLEMODEID},{HSETTLECURRID},{HEXCHANGETYPEID},{HPAYCONDITIONID},{HEXCHANGERATE},{HLOCALCURRID},{HISINCLUDEDTAX},{HISPRICEEXCLUDETAX},{HTAXRATEID},{HCOSTPERCENT},{HCOSTAMOUNT},{HVAT},{HSELLERWITHHOLDING},{HBUYERWITHHOLDING},'{HMATERIALDESC}')"); |
| | | } |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBill_AfterSaveCtrl " + HInterID, "h_p_Cg_POOrderBill_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; |
| | |
| | | foreach (var oSub in subList) |
| | | { |
| | | sql = $@" |
| | | Insert into Cg_POOrderBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice,HTaxRate_TAX,HTaxMoney_TAX,HTaxPrice,HDiscountRate,HRelTaxPrice |
| | | ,HMoney,HTaxRate,HTaxMoney,HLineTotal,HlineTotalBB,HDate,HInStockQty,HInvoiceQty,HSeOrderBillNo,HSeOrderInterID |
| | | ,HSeOrderEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,HSourceBillType,HRelationQty,HBackRelationQty,HPropertyID,HBatChNo,HAuxPropID,HMTONo |
| | | ,HERPInterID,HERPEntryID |
| | | ,HSEQ,HRECEIVEDEPTID,HSUPPLIERLOT,HBOMID,HSTOCKUNITID,HBASEUNITID,HBFLOWID,HGIVEAWAY,HROWTYPE,HBASEUNITQTY,HSTOCKBASEQTY |
| | | ,HREQTRACENO,HTAXNETPRICE,HPRICECOEFFICIENT,HTAXCOMBINATION,HPRICEUNITID,HPRICELISTENTRY,HPAYORGID,HSETTLEMODEID,HSETTLECURRID |
| | | ,HEXCHANGETYPEID,HPAYCONDITIONID,HEXCHANGERATE,HLOCALCURRID,HISINCLUDEDTAX,HISPRICEEXCLUDETAX,HTAXRATEID,HCOSTPERCENT,HCOSTAMOUNT |
| | | ,HVAT,HSELLERWITHHOLDING,HBUYERWITHHOLDING,HMATERIALDESC) |
| | | values('{oSub.HInterID}','{oSub.HEntryID}','{oSub.HMaterID}','{oSub.HUnitID}','{oSub.HQty}','{oSub.HPrice}','{oSub.HPrice}','{oSub.HTaxRate_TAX}','{oSub.HTaxMoney_TAX}','{oSub.HDiscountRate}','{oSub.HRelTaxPrice}', |
| | | '{oSub.HMoney}','{oSub.HTaxRate}','{oSub.HTaxMoney}','{oSub.HlineTotal}','{oSub.HlineTotalBB}','{oSub.HDate}','{oSub.HInStockQty}','{oSub.HInvoiceQty}','{oSub.HSeOrderBillNo}','{oSub.HSeOrderInterID}', |
| | | '{oSub.HSeOrderEntryID}','{oSub.HRemark}','{oSub.HSourceInterID}','{oSub.HSourceEntryID}','{oSub.HSourceBillNo}', |
| | | '{oSub.HSourceBillType}','{oSub.HRelationQty}','{oSub.HBackRelationQty}','{oSub.HPropertyID}','{oSub.HBatChNo}','{oSub.HAuxPropID}','{oSub.HMTONo}', |
| | | '{oSub.HERPInterID}','{oSub.HERPEntryID}', |
| | | '{oSub.HSEQ}','{oSub.HRECEIVEDEPTID}','{oSub.HSUPPLIERLOT}','{oSub.HBOMID}','{oSub.HSTOCKUNITID}','{oSub.HBASEUNITID}','{oSub.HBFLOWID}','{oSub.HGIVEAWAY}','{oSub.HROWTYPE}','{oSub.HBASEUNITQTY}','{oSub.HSTOCKBASEQTY}', |
| | | '{oSub.HREQTRACENO}','{oSub.HTAXNETPRICE}','{oSub.HPRICECOEFFICIENT}','{oSub.HTAXCOMBINATION}','{oSub.HPRICEUNITID}','{oSub.HPRICELISTENTRY}','{oSub.HPAYORGID}','{oSub.HSETTLEMODEID}','{oSub.HSETTLECURRID}', |
| | | '{oSub.HEXCHANGETYPEID}','{oSub.HPAYCONDITIONID}','{oSub.HEXCHANGERATE}','{oSub.HLOCALCURRID}','{oSub.HISINCLUDEDTAX}','{oSub.HISPRICEEXCLUDETAX}','{oSub.HTAXRATEID}','{oSub.HCOSTPERCENT}','{oSub.HCOSTAMOUNT}', |
| | | '{oSub.HVAT}','{oSub.HSELLERWITHHOLDING}','{oSub.HBUYERWITHHOLDING}','{oSub.HMATERIALDESC}')"; |
| | | oCN.RunProc(sql); |
| | | Insert into Cg_POOrderBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice,HTaxRate_TAX,HTaxMoney_TAX,HTaxPrice,HDiscountRate,HRelTaxPrice |
| | | ,HMoney,HTaxRate,HTaxMoney,HLineTotal,HlineTotalBB,HDate,HInStockQty,HInvoiceQty,HSeOrderBillNo,HSeOrderInterID |
| | | ,HSeOrderEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo |
| | | ,HSourceBillType,HRelationQty,HBackRelationQty,HPropertyID,HBatChNo,HAuxPropID,HMTONo |
| | | ,HERPInterID,HERPEntryID |
| | | ,HSEQ,HRECEIVEDEPTID,HSUPPLIERLOT,HBOMID,HSTOCKUNITID,HBASEUNITID,HBFLOWID,HGIVEAWAY,HROWTYPE,HBASEUNITQTY,HSTOCKBASEQTY |
| | | ,HREQTRACENO,HTAXNETPRICE,HPRICECOEFFICIENT,HTAXCOMBINATION,HPRICEUNITID,HPRICELISTENTRY,HPAYORGID,HSETTLEMODEID,HSETTLECURRID |
| | | ,HEXCHANGETYPEID,HPAYCONDITIONID,HEXCHANGERATE,HLOCALCURRID,HISINCLUDEDTAX,HISPRICEEXCLUDETAX,HTAXRATEID,HCOSTPERCENT,HCOSTAMOUNT |
| | | ,HVAT,HSELLERWITHHOLDING,HBUYERWITHHOLDING,HMATERIALDESC) |
| | | values('{oSub.HInterID}','{oSub.HEntryID}','{oSub.HMaterID}','{oSub.HUnitID}','{oSub.HQty}','{oSub.HPrice}','{oSub.HPrice}','{oSub.HTaxRate_TAX}','{oSub.HTaxMoney_TAX}','{oSub.HDiscountRate}','{oSub.HRelTaxPrice}', |
| | | '{oSub.HMoney}','{oSub.HTaxRate}','{oSub.HTaxMoney}','{oSub.HlineTotal}','{oSub.HlineTotalBB}','{oSub.HDate}','{oSub.HInStockQty}','{oSub.HInvoiceQty}','{oSub.HSeOrderBillNo}','{oSub.HSeOrderInterID}', |
| | | '{oSub.HSeOrderEntryID}','{oSub.HRemark}','{oSub.HSourceInterID}','{oSub.HSourceEntryID}','{oSub.HSourceBillNo}', |
| | | '{oSub.HSourceBillType}','{oSub.HRelationQty}','{oSub.HBackRelationQty}','{oSub.HPropertyID}','{oSub.HBatChNo}','{oSub.HAuxPropID}','{oSub.HMTONo}', |
| | | '{oSub.HERPInterID}','{oSub.HERPEntryID}', |
| | | '{oSub.HSEQ}','{oSub.HRECEIVEDEPTID}','{oSub.HSUPPLIERLOT}','{oSub.HBOMID}','{oSub.HSTOCKUNITID}','{oSub.HBASEUNITID}','{oSub.HBFLOWID}','{oSub.HGIVEAWAY}','{oSub.HROWTYPE}','{oSub.HBASEUNITQTY}','{oSub.HSTOCKBASEQTY}', |
| | | '{oSub.HREQTRACENO}','{oSub.HTAXNETPRICE}','{oSub.HPRICECOEFFICIENT}','{oSub.HTAXCOMBINATION}','{oSub.HPRICEUNITID}','{oSub.HPRICELISTENTRY}','{oSub.HPAYORGID}','{oSub.HSETTLEMODEID}','{oSub.HSETTLECURRID}', |
| | | '{oSub.HEXCHANGETYPEID}','{oSub.HPAYCONDITIONID}','{oSub.HEXCHANGERATE}','{oSub.HLOCALCURRID}','{oSub.HISINCLUDEDTAX}','{oSub.HISPRICEEXCLUDETAX}','{oSub.HTAXRATEID}','{oSub.HCOSTPERCENT}','{oSub.HCOSTAMOUNT}', |
| | | '{oSub.HVAT}','{oSub.HSELLERWITHHOLDING}','{oSub.HBUYERWITHHOLDING}','{oSub.HMATERIALDESC}')"; |
| | | oCN.RunProc(sql); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | |
| | | [HttpGet] |
| | | public object AuditCg_POOrderBill(string HInterID, int Type, string user) |
| | | { |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Cg_POOrderBillMain"; |
| | | ds = oCN.RunProcReturn("select * from Cg_POOrderBillMain where HInterID = " + int.Parse(HInterID), "Cg_POOrderBillMain"); |
| | | string HBillNo = ""; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | 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(); |
| | | } |
| | | //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_POOrderBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_POOrderBill_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_POOrderBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_POOrderBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Cg_POOrderBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_POOrderBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | ////夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | //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]["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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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; |
| | | // } |
| | | // } |
| | | //} |
| | | //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 (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 (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; |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | //oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | public class Kf_POStockInBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | public DAL.ClsCg_POInStockBill BillOld = new DAL.ClsCg_POInStockBill(); |
| | | //public DAL.ClsCg_POInStockBill BillOld = new DAL.ClsCg_POInStockBill(); |
| | | public DAL.ClsKf_POStockInBill BillOld = new DAL.ClsKf_POStockInBill(); |
| | | private json objJsonResult = new json(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | public DataSet ds = new DataSet(); |
| | |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBill_BeforeSaveCtrl " + HInterID, "h_p_Kf_POStockInBill_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; |
| | | } |
| | | //========================================================= |
| | | //主表 |
| | | String sql=$@"Insert Into Kf_ICStockBillMain |
| | | String sql =$@"Insert Into Kf_ICStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark |
| | | ,HInnerBillNo,HSTOCKORGID,HOWNERID ,HChecker,HCheckDate,HMaker,HMakeDate) |
| | |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | //ä¿ååæ§å¶========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBill_AfterSaveCtrl " + HInterID, "h_p_Kf_POStockInBill_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; |
| | |
| | | [HttpGet] |
| | | public object AuditKf_POStockInBill(string HInterID, int Type, string user) |
| | | { |
| | | string sql = ""; |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Kf_ICStockBillMain"; |
| | | ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain where HInterID = " + int.Parse(HInterID), "Kf_ICStockBillMain"); |
| | | string HBillNo = ""; |
| | | DAL.ClsKf_POStockInBill oBill = new DAL.ClsKf_POStockInBill(); |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | 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(); |
| | | } |
| | | //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 = "h_p_Kf_POStockInBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Kf_POStockInBill_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_Kf_POStockInBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_Kf_POStockInBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Kf_POStockInBill_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]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].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_Kf_POStockInBill_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"; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [模å
·ä¿å
»è®¡ååå é¤åè½] |
| | | #region [å·¥åºæµè½¬å¡å é¤åè½] |
| | | /// <summary> |
| | | /// 模å
·ç»´ä¿®åå é¤åè½ |
| | | /// å·¥åºæµè½¬å¡å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID")] |
| | |
| | | //================================================================================== |
| | | |
| | | |
| | | |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HInterID=" + HInterID, "Sc_ICMOBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | return objJsonResult; ; |
| | | } |
| | | |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | //ç产订åå é¤åå¡«éå®è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToICMO_Delete " + HInterID); |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æçä»»å¡åè¡¨ï¼æªå®æï¼å·²å®æï¼æ£å¨è¿è¡ï¼ |
| | | /// <summary> |
| | | /// è¿åæçä»»å¡å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_WorkTaskBill/PM_WorkTaskBillMainList")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskBillMainList( string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillMyList " + user, "h_p_PM_WorkTaskBillMyList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | { |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°æ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | #region å·¥ä½å¨æ»ç» å®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("PM_WorkTaskWeekBill/CheckPM_WorkReportWeekBillMain")] |
| | | [HttpGet] |
| | | public object CheckSc_ICMOReportBill(string HInterID, int IsAudit, string user) |
| | | public object CheckPM_WorkReportWeekBillMain(string HInterID, int IsAudit, string user) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é |
| | | //夿æ¯å¦æå
³éæé |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | if (IsAudit == 0) //å
³é夿 |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HCloseMan='" + user + "',HCloseDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | oCn.RunProc("update PM_WorkReportWeekBillMain set HCloseMan='',HCloseDate=null where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.Message = "åå
³éæå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCn.Commit(); |
| | |
| | | public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill(); |
| | | string user_LongShan = ""; |
| | | string HName_LongShan = ""; |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillNew1 = new DAL.ClsPM_WorkPlanMonthBillMain(); //å·¥ä½å¨æ»ç»å¯¹åºåæ®ç±» |
| | | public DAL.ClsPM_WorkPlanMonthBillMain BillOld1 = new DAL.ClsPM_WorkPlanMonthBillMain(); |
| | | |
| | | #region å·¥ç¨é¡¹ç® æ°å¢/ç¼è¾ |
| | | #region å·¥ç¨é¡¹ç® è¡¨å¤´æ°æ® |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æåº¦é¶æ®µè®¡åä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ä¿åæåº¦é¶æ®µè®¡å |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("PM_ProjectBill/SavePM_WorkPlanMonthBillMain")] |
| | | [HttpPost] |
| | | public object SavePM_WorkPlanMonthBillMain([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 msg3 = sArray[1].ToString(); //å表 |
| | | string refSav = sArray[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string user = sArray[3].ToString();//ç¨æ·å |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | //ä¿åæé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkPlanMonthBillMain_Add", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DAL.ClsPM_WorkPlanMonthBillMain oBill = new DAL.ClsPM_WorkPlanMonthBillMain(); |
| | | List<Model.ClsPM_WorkPlanMonthBillMain> lsmain = new List<Model.ClsPM_WorkPlanMonthBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_PM_WorkPlanMonthBillMain(msg2); |
| | | foreach (Model.ClsPM_WorkPlanMonthBillMain oItem in lsmain) |
| | | { |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew1.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 (BillOld1.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (BillOld1.omodel.HChecker != "" && BillOld1.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld1.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 = "4758"; |
| | | oItem.HBillSubType = "4758"; |
| | | |
| | | //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; |
| | | } |
| | | // è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | List<Model.ClsPM_WorkPlanMonthBillSub> ls = new List<Model.ClsPM_WorkPlanMonthBillSub>(); |
| | | ls = oListModels.getObjectByJson_PM_WorkPlanMonthBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsPM_WorkPlanMonthBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | |
| | | //oItemSub.HCloseMan = ""; //è¡å
³é |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | //oItemSub.HRemark = ""; //夿³¨ |
| | | |
| | | //oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | //oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | //oItemSub.HSourceBillNo = ""; //æºååå· |
| | | //oItemSub.HSourceBillType = ""; //æºåç±»å |
| | | //oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | //oItemSub.HRelationMoney = 0; //å
³èéé¢ |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | 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_ProjectBill/CheckPM_WorkPlanMonthBillMain")] |
| | | [HttpGet] |
| | | public object CheckPM_WorkPlanMonthBillMain(string HInterID, int IsAudit, string user) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("PM_WorkPlanMonthBillMain_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from PM_WorkPlanMonthBillMain where HInterID=" + HInterID, "PM_WorkPlanMonthBillMain"); |
| | | 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_WorkPlanMonthBillMain 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_WorkPlanMonthBillMain 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_ProjectBill/ClosePM_WorkPlanMonthBillMain")] |
| | | [HttpGet] |
| | | public object ClosePM_WorkPlanMonthBillMain(string HInterID, int IsAudit, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå
³éæé |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | var ds = oCN.RunProcReturn("select * from PM_WorkPlanMonthBillMain where HInterID=" + HInterID, "PM_WorkPlanMonthBillMain"); |
| | | 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_WorkPlanMonthBillMain set HCloseMan='" + user + "',HCloseDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³éæå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | oCN.RunProc("update PM_WorkPlanMonthBillMain set HCloseMan='',HCloseDate=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 |
| | | |
| | | #region æåº¦é¶æ®µè®¡å æ¥è¯¢ |
| | | /// <summary> |
| | | /// è¿å项ç®é¶æ®µå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_ProjectBill/getPM_WorkPlanMonthBillMainList")] |
| | | [HttpGet] |
| | | public object getPM_WorkPlanMonthBillMainList(string HInterID,string HEntryID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æ ¹æ®æç项ç®ä¸ 主åid 䏿¨æ¥è¿è¡æ¥è¯¢æ°æ®,ç¶ååæ¾å°é¡µé¢ |
| | | string sql= @"select a.HInterID HSourceInterID ,b.HEntryID HSourceEntryID,a.HBillNo HSourceBillNo,a.HBillType HSourceBillType, a.HProNumber ,a.HProName 项ç®åç§° ,c.HItemID HProjectStageID,c.HName 项ç®é¶æ®µ , b.HStageNote 项ç®é¶æ®µè¯¦ç»å
容, b.HPMGoodsID ç¸å
³äº¤ä»ç©, b.HIsKey æ¯å¦éç¨ç¢,b.HRate |
| | | from PM_ProjectBillMain a inner join PM_ProjectBillSub b on a.HInterID = b.HInterID left join gy_ProjectStage c on c.HItemID = b.HProjectStageID |
| | | where a.HInterID = '" + HInterID + "' and b.HEntryID = '"+ HEntryID + "'"; |
| | | ds = oCN.RunProcReturn(sql, "PM_ProjectBillMain"); |
| | | //æ·»å åå |
| | | 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 = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | List<Model.ClsPM_WorkReportWeekBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_WorkReportWeekBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// å¤çæ°å¢æåº¦é¶æ®µè®¡å表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsPM_WorkPlanMonthBillMain> getObjectByJson_PM_WorkPlanMonthBillMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsPM_WorkPlanMonthBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_WorkPlanMonthBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// å¤çæ°å¢æåº¦é¶æ®µè®¡åå表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsPM_WorkPlanMonthBillSub> getObjectByJson_PM_WorkPlanMonthBillSub(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsPM_WorkPlanMonthBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_WorkPlanMonthBillSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ¨¡å
·ä¿å
»è®°å½è¡¨ä¸»è¡¨çjson |