DAL/ClsPM_ProjectMoneyBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/DAL.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/基础资料/基础资料/ClsGy_ProjectMoney_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/项目管理/ClsPM_ProjectMoneyBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/项目管理/ClsPM_ProjectMoneyBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsGy_ProjectMoney_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Service/LuBaoSevice.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/ClsPM_ProjectMoneyBillMain.cs
New file @@ -0,0 +1,286 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsPM_ProjectMoneyBillMain : DBUtility.ClsXt_BaseBill { public Model.ClsPM_ProjectMoneyBillMain omodel = new Model.ClsPM_ProjectMoneyBillMain(); public List<Model.ClsPM_ProjectMoneyBillSub> DetailColl = new List<Model.ClsPM_ProjectMoneyBillSub>(); public ClsPM_ProjectMoneyBillMain() { base.MvarItemKeySub = "PM_ProjectMoneyBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey= "PM_ProjectMoneyBillMain"; base.MvarReportTitle="项ç®è´¹ç¨å"; base.BillType="4759"; base.HBillSubType = "4759"; } #region åºå®ä»£ç #region æ åæé 彿° ~ClsPM_ProjectMoneyBillMain() { DetailColl = null; } #endregion #endregion //#region ä¿®æ¹åæ® public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) { try { oCn.BeginTran(); //æ´æ°ä¸»è¡¨ string mainSql = "update PM_ProjectMoneyBillMain set " + " HBillNo = '" + omodel.HBillNo + "', HRemark = '" + omodel.HRemark + "', HProNumber = '" + omodel.HProNumber + "', HProjectID = '" + omodel.HProjectID + "', HProNumber = " + omodel.HProNumber+ ", HProName = " + omodel.HProName + ", HCusID = '" + omodel.HCusID + "', HPMTeamID = '" + omodel.HPMTeamID + "', HPMEmpID = '" + omodel.HPMEmpID + "', HWorkEmpID = '" + omodel.HWorkEmpID + "', HManagerID = '" + omodel.HManagerID + "', HOrgID ='" + omodel.HOrgID + "', HUpDateDate = getdate()" + //=============================================================== " where HInterID = " + omodel.HInterID; oCn.RunProc(mainSql); //å é¤å ³è DeleteRelation(ref sReturn, lngBillKey); //å é¤å表 DeleteBillSub(lngBillKey); //æå ¥å表 omodel.HInterID = lngBillKey; foreach (Model.ClsPM_ProjectMoneyBillSub oSub in DetailColl) { string subSql = "insert into PM_ProjectMoneyBillSub " + "" + "" + "" + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + ",HProMoneyID,HQty,HPrice,HMoney) " + " values(" + "" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HSourceInterID + "," + oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "','" + oSub.HProMoneyID + "'," + oSub.HQty + "," + oSub.HPrice + ",'" + oSub.HMoney + "')"; 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_ProjectMoneyBillMain where HInterID = " + omodel.HInterID, "PM_ProjectMoneyBillMain"); 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_ProjectMoneyBillMain" + "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" + ",HProjectID,HProNumber,HProName,HCusID,HPMTeamID,HPMEmpID,HWorkEmpID,HManagerID,HOrgID) " + "values(" + "" + (omodel.HYear.ToString() != "0" ? omodel.HYear.ToString() : DateTime.Now.Year.ToString()) + "," + omodel.HPeriod.ToString() + ",'" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID + ",'" + omodel.HDate + "','" + omodel.HBillNo + "','" + omodel.HRemark + "','" + omodel.HMaker + "','" + omodel.HMakeDate + "','" + omodel.HProjectID + "','" + omodel.HProNumber + "'," + omodel.HProName+ ",'" + omodel.HCusID+ "','" + omodel.HPMTeamID+ "','" + omodel.HPMEmpID+ "','" + omodel.HWorkEmpID+ "','" + omodel.HManagerID+ "','" + omodel.HOrgID+ "')"; oCn.RunProc(mainSql); //æå ¥å表 foreach (Model.ClsPM_ProjectMoneyBillSub oSub in DetailColl) { string subSql = "insert into PM_ProjectMoneyBillSub " + "" + "" + "" + "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + ",HProMoneyID,HQty,HPrice,HMoney) " + " values(" + "" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HSourceInterID + "," + oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "','" + oSub.HProMoneyID + "'," + oSub.HQty + "," + oSub.HPrice + ",'" + oSub.HMoney + "')"; 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 } } DAL/DAL.csproj
@@ -80,6 +80,7 @@ <Compile Include="ClsPay_EarlyLateErrBill.cs" /> <Compile Include="ClsPay_RewardPunishBill.cs" /> <Compile Include="ClsPay_WorkErrTimesBill.cs" /> <Compile Include="ClsPM_ProjectMoneyBillMain.cs" /> <Compile Include="ClsPM_CustomerTaskBillMain.cs" /> <Compile Include="ClsPM_WorkPlanMonthBillMain.cs" /> <Compile Include="MES\ClsSc_SourceLineRepairBill.cs" /> Model/Model.csproj
@@ -351,6 +351,7 @@ <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Operator_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_RateType_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Staff_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_ProjectMoney_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TaxMIXMain_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TaxMIXSub_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_TaxRate_Model.cs" /> @@ -975,6 +976,8 @@ <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_LadingBillSub.cs" /> <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillMain.cs" /> <Compile Include="éå®ç®¡ç\åè¯ç®¡ç\ClsXs_ShippingAdviceBillSub.cs" /> <Compile Include="项ç®ç®¡ç\ClsPM_ProjectMoneyBillSub.cs" /> <Compile Include="项ç®ç®¡ç\ClsPM_ProjectMoneyBillMain.cs" /> <Compile Include="项ç®ç®¡ç\ClsPM_CustomerTaskBillMain.cs" /> <Compile Include="项ç®ç®¡ç\ClsPM_WorkPlanMonthBillMain.cs" /> <Compile Include="项ç®ç®¡ç\ClsPM_CustomerTaskBillSub.cs" /> Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_ProjectMoney_Model.cs
New file @@ -0,0 +1,14 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_ProjectMoney_Model : DBUtility.ClsGy_Base_Model { public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; } } Model/ÏîÄ¿¹ÜÀí/ClsPM_ProjectMoneyBillMain.cs
New file @@ -0,0 +1,21 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsPM_ProjectMoneyBillMain : DBUtility.ClsXt_BaseBillMain { public Int64 HProjectID; //int 项ç®å ç public string HProNumber;// varchar(50) //项ç®ä»£ç public string HProName;// varchar(50) 项ç®é¶æ®µ public Int64 HCusID;// int //å®¢æ· public Int64 HPMTeamID;// int äº¤ä»æ¹ public Int64 HPMEmpID;// int 项ç®ç»ç public Int64 HWorkEmpID;// int 宿½æ å½ public Int64 HManagerID;// int 管çå public Int64 HOrgID;// int //ç»ç» } } Model/ÏîÄ¿¹ÜÀí/ClsPM_ProjectMoneyBillSub.cs
New file @@ -0,0 +1,14 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsPM_ProjectMoneyBillSub : DBUtility.ClsXt_BaseBillSub { public Int64 HProMoneyID; //int --项ç®è´¹ç¨ public decimal HQty; //money --æ°é public decimal HPrice; //money --åä»· public decimal HMoney; //money --éé¢ } } WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -4634,6 +4634,247 @@ } #endregion #region 项ç®è´¹ç¨ æ¥è¯¢,å®¡æ ¸ï¼åå®¡æ ¸ï¼ç¦ç¨ï¼åç¦ç¨ /// <summary> /// ä¾åºååç±» æ¥è¯¢ /// </summary> /// <param name="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_ProjectMoneyList")] [HttpGet] public object Gy_ProjectMoneyList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoney_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_ProjectMoney where 1 = 1"; string sql = sql1 + sWhere + " order by 项ç®è´¹ç¨ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_ProjectMoney"); //æ·»å åå 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; } } /// <summary> /// 项ç®è´¹ç¨ å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/AuditGy_ProjectMoney")] [HttpGet] public object AuditGy_ProjectMoney(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ProjectMoney_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HInterID, "Gy_ProjectMoney"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].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 Gy_ProjectMoney set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_ProjectMoney set HCheckEmp='',HCheckTime=null where HItemID=" + 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; } } /// <summary> /// 项ç®è´¹ç¨ ç¦ç¨ãåç¦ç¨ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/StopGy_ProjectMoney")] [HttpGet] public object StopGy_ProjectMoney(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ProjectMoney_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HInterID, "Gy_SupType"); if (ds.Tables[0].Rows.Count > 0) { if (IsStop == 0) //ç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsStop == 1) //åç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].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 (IsStop == 0) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_ProjectMoney set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_ProjectMoney set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + 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 å¼å¸¸ç±»å æ¥è¯¢ WebAPI/Controllers/WebAPIController.cs
@@ -7859,6 +7859,287 @@ } #endregion #region 项ç®è´¹ç¨ 设置å表/ä¿å/ç¼è¾/å 餿¹æ³ /// <summary> /// 项ç®è´¹ç¨ ä¿å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_ProjectMoneyList")] [HttpPost] public object SaveGy_ProjectMoneyList([FromBody] JObject msg) { DataSet ds; var _value = msg["msg"].ToString(); string msg3 = _value.ToString(); string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg1 = sArray[0].ToString(); string msg2 = sArray[1].ToString(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoney_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } Int64 HItemID = 0; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //è·åæå¤§IDå¼èµå¼ DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_ProjectMoney ", "Gy_ProjectMoney"); if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) { //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); maxid += 1; HItemID = maxid; } ListModels oListModels = new ListModels(); try { WebAPI.DLL.ClsGy_ProjectMoney_Ctl oBill = new WebAPI.DLL.ClsGy_ProjectMoney_Ctl(); List<Model.ClsGy_ProjectMoney_Model> lsmain = new List<Model.ClsGy_ProjectMoney_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_ProjectMoney(msg1); foreach (Model.ClsGy_ProjectMoney_Model oItem in lsmain) { if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (oItem.HName.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = 1; return objJsonResult; } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_ProjectMoney"); if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ°å¢æ¶å¤æ if (oItem.HItemID == 0) { if (ds == null || ds.Tables[0].Rows.Count == 0) { } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } else//ç¼è¾æ¶å¤æ { //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } //å¾å°ç代ç string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); if (sShortNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } oItem.HShortNumber = sShortNumber;//ç代ç oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oItem.HMakeEmp = msg2; //å建人 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// 项ç®è´¹ç¨ è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_ProjectMoneyDetail")] [HttpGet] public ApiResult<DataSet> GetGy_ProjectMoneyDetail(string HID) { var model = LuBaoSevice.GetGy_ProjectMoneyDetail(HID); return model; } /// <summary> /// 项ç®è´¹ç¨ å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_ProjectMoney")] [HttpGet] public object DeltetGy_ProjectMoney(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoney_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HItemID, "Gy_ProjectMoney"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_ProjectMoney where HItemID=" + HItemID); oCN.Commit();//æäº¤äºå¡ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "æ°æ®å 餿åï¼"; objJsonResult.data = null; return objJsonResult; ; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion /// <summary> /// ç¨å ³èå·¥åºè·åä¿¡æ¯ WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤³ÌÏîÄ¿/PM_ProjectBillController.cs
@@ -2337,5 +2337,534 @@ } } #endregion #region 项ç®è´¹ç¨ ä¿å/ç¼è¾ /// <summary> /// 项ç®è´¹ç¨ /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("PM_ProjectBill/SavePM_ProjectMoneyBillMain")] [HttpPost] public object SavePM_ProjectMoneyBillMain([FromBody] JObject sMainSub) { var _value = sMainSub["sMainSub"].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_ProjectMoneyBillMain_Edit", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } DAL.ClsPM_ProjectMoneyBillMain oBill = new DAL.ClsPM_ProjectMoneyBillMain(); List<Model.ClsPM_ProjectMoneyBillMain> lsmain = new List<Model.ClsPM_ProjectMoneyBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_PM_ProjectMoneyBillMain(msg2); foreach (Model.ClsPM_ProjectMoneyBillMain 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 = "4762"; oItem.HBillSubType = "4762"; //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_ProjectMoneyBillSub> ls = new List<Model.ClsPM_ProjectMoneyBillSub>(); ls = oListModels.getObjectByJson_PM_ProjectMoneyBillSub(msg3); int i = 0; foreach (Model.ClsPM_ProjectMoneyBillSub oItemSub in ls) { i++; oItemSub.HEntryID = i; oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å 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 项ç®è´¹ç¨å表 æ¥è¯¢ /// <summary> /// è¿å项ç®è´¹ç¨å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("PM_ProjectBill/getPM_ProjectMoneyBillMainList")] [HttpGet] public object getPM_ProjectMoneyBillMainList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("PM_ProjectMoneyBillMain_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; objJsonResult.data = null; return objJsonResult; } if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_PM_ProjectMoneyBillMainList order by åæ®å· desc", "h_v_PM_ProjectMoneyBillMainList"); } else { string sql1 = "select * from h_v_PM_ProjectMoneyBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_PM_ProjectMoneyBillMainList"); } //æ·»å åå 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 #region 项ç®è´¹ç¨å表 è·åç¼è¾åè¡¨æ°æ® [Route("PM_ProjectBill/PM_ProjectMoneyBillMainEditList")] [HttpGet] public object PM_ProjectMoneyBillMainEditList(string HInterID, string User) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("PM_ProjectMoneyBillMain_Edit", 1, false, User)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID == null || HInterID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } ds = oCN.RunProcReturn("select * from h_v_PM_ProjectMoneyBillMainList where HInterID =" + HInterID, "h_v_PM_ProjectMoneyBillMainList"); //æ·»å åå 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 = "æ¥è¯¢æåï¼"; 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 #region 项ç®è´¹ç¨å表 å®¡æ ¸/åå®¡æ ¸åè½ [Route("PM_ProjectBill/CheckPM_ProjectMoneyBillMain")] [HttpGet] public object CheckPM_ProjectMoneyBillMain(string HInterID, int IsAudit, string user) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("PM_ProjectMoneyBillMain_Check", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from PM_ProjectMoneyBillMain where HInterID=" + HInterID, "PM_ProjectMoneyBillMain "); 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_ProjectMoneyBillMain 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_ProjectMoneyBillMain 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_ProjectMoneyBillMain")] [HttpGet] public object ClosePM_ProjectMoneyBillMain(string HInterID, int IsAudit, string user) { try { //夿æ¯å¦æå ³éæé if (!DBUtility.ClsPub.Security_Log("PM_ProjectMoneyBillMain_Close", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æéå ³é!"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from PM_ProjectMoneyBillMain where HInterID=" + HInterID, "PM_ProjectMoneyBillMain"); 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_ProjectMoneyBillMain 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_ProjectMoneyBillMain 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 HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("PM_ProjectBill/PM_ProjectMoneyBillMainDelete")] [HttpGet] public object PM_ProjectMoneyBillMainDelete(string HInterID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("PM_ProjectMoneyBillMain_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } if (HInterID == null || HInterID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); oCN.RunProc("delete from PM_ProjectMoneyBillMain where HInterID = " + HInterID); oCN.RunProc("delete from PM_ProjectMoneyBillMain where HInterID='" + HInterID + "'"); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; 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 } } WebAPI/DLL/ClsGy_ProjectMoney_Ctl.cs
New file @@ -0,0 +1,102 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_ProjectMoney_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_ProjectMoney_Model oModel = new Model.ClsGy_ProjectMoney_Model(); //æ°å¢ public override bool AddNew() { // try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //ä¿®æ¹ public override bool ModifyByID(Int64 sItemID) { try { oCn.BeginTran(); oCn.RunProc("Update " + MvarItemKey + " set " + " HNumber='" + oModel.HNumber + "'" + ",HName='" + oModel.HName + "'" + ",HShortNumber='" + oModel.HShortNumber + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //å°ä¸çº§ ä¸ºéæ«çº§ oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); // oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //æ ¹æ®ä»£ç å¤æä¿¡æ¯ public override bool HavParentCode(string sCode, Int64 sItemID) { DataSet DS; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); if (DS.Tables[0].Rows.Count == 0) return false; else { oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); return true; } } catch (Exception e) { throw (e); } } //æé 彿° public ClsGy_ProjectMoney_Ctl() { MvarItemKey = "Gy_ProjectMoney"; MvarReportTitle = "项ç®è´¹ç¨è®¾ç½®"; oModel = new Model.ClsGy_ProjectMoney_Model(); } } } WebAPI/ListModels.cs
@@ -951,7 +951,7 @@ List<Model.ClsGy_CusType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CusType_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢ä¾åºåå类表çjson /// </summary> @@ -963,7 +963,17 @@ List<Model.ClsGy_SupType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SupType_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é¡¹ç®è´¹ç¨è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_ProjectMoney_Model> getObjectByJson_Gy_ProjectMoney(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_ProjectMoney_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ProjectMoney_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸ç±»å表çjson /// </summary> @@ -1044,7 +1054,28 @@ List<Model.ClsPM_CustomerTaskBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_CustomerTaskBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é¡¹ç®è´¹ç¨è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsPM_ProjectMoneyBillMain> getObjectByJson_PM_ProjectMoneyBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsPM_ProjectMoneyBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_ProjectMoneyBillMain>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é¡¹ç®è´¹ç¨å表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsPM_ProjectMoneyBillSub> getObjectByJson_PM_ProjectMoneyBillSub(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsPM_ProjectMoneyBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPM_ProjectMoneyBillSub>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢æ¨¡å ·ä¿å »è®°å½è¡¨ä¸»è¡¨çjson /// </summary> WebAPI/Service/LuBaoSevice.cs
@@ -584,7 +584,7 @@ var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_PoStockStyle where HItemID= " + HID + " ", "h_v_Gy_PoStockStyle"); return dataSet; } /// <summary> /// ä¾åºååç±»æ ¹æ®idè·åä¿¡æ¯ /// </summary> @@ -605,6 +605,25 @@ } /// <summary> /// 项ç®è´¹ç¨æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_ProjectMoneyDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_ProjectMoneyDb(HID); 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 }; } public static DataSet GetGy_ProjectMoneyDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_ProjectMoney where HItemID= " + HID + " ", "h_v_Gy_ProjectMoney"); return dataSet; } /// <summary> ///客æ·åç±»æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_CusTypeDetail(string HID) WebAPI/WebAPI.csproj
@@ -631,6 +631,7 @@ <Compile Include="DLL\ClsGy_AreaSet_Ctl.cs" /> <Compile Include="DLL\ClsGy_CusType_Ctl.cs" /> <Compile Include="DLL\ClsGy_StockCheckItem_Ctl.cs" /> <Compile Include="DLL\ClsGy_ProjectMoney_Ctl.cs" /> <Compile Include="DLL\ClsGy_SupType_Ctl.cs" /> <Compile Include="DLL\ClsGy_SellStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_PostSkill_Ctl.cs" />