DAL/ClsPM_WorkPlanMonthBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/ClsPM_WorkPlanMonthBillMain.cs
@@ -33,75 +33,70 @@ #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; 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 + ", HMonth = " + omodel.HMonth + ", HRemark = '" + omodel.HRemark + "', HUpDater = '" + omodel.HUpDater + "', HUpDateDate = getdate()" + //=============================================================== ", HBeginDate = '" + omodel.HBeginDate + "', HEndDate = '" + omodel.HEndDate + "', HPlanEmpID = " + omodel.HPlanEmpID + " where HInterID = " + omodel.HInterID; // //å é¤å ³è // DeleteRelation(ref sReturn, lngBillKey); // //å é¤å表 // DeleteBillSub(lngBillKey); //å é¤å ³è 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); // } //} //æå ¥å表 omodel.HInterID = lngBillKey; 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 æ°å¢åæ® WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤³ÌÏîÄ¿/PM_ProjectBillController.cs
@@ -1610,5 +1610,170 @@ } #endregion #region æåº¦é¶æ®µè®¡åå表 æ¥è¯¢ /// <summary> /// è¿å项ç®é¶æ®µå表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("PM_ProjectBill/getPM_WorkPlanMonthBillMainLists")] [HttpGet] public object getPM_WorkPlanMonthBillMainLists(string sWhere, 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; } if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_PM_WorkPlanMonthBillMainList order by åæ®å· desc", "h_v_PM_WorkPlanMonthBillMainList"); } else { string sql1 = "select * from h_v_PM_WorkPlanMonthBillMainList where 1 = 1 "; string sql = sql1 + sWhere + " order by åæ®å· desc"; ds = oCN.RunProcReturn(sql, "h_v_PM_WorkPlanMonthBillMainList"); } //æ·»å åå 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 æåº¦é¶æ®µè®¡åå表 å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainDelete")] [HttpGet] public object PM_WorkReportWeekBillMainDelete(string HInterID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_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_WorkPlanMonthBillMain where HInterID = " + HInterID); oCN.RunProc("delete from PM_WorkPlanMonthBillSub 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 #region æåº¦é¶æ®µè®¡åå表 è·åç¼è¾åè¡¨æ°æ® [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainEditList")] [HttpGet] public object PM_WorkPlanMonthBillMainEditList(string HInterID,string User) { try { List<DataTable> tableList = new List<DataTable>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_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("exec h_p_PM_WorkPlanMonthBillMain_EditInit " + HInterID, "h_p_PM_WorkPlanMonthBillMain_EditInit"); tableList.Add(ds.Tables[0]); tableList.Add(ds.Tables[1]); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = tableList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } }