| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» è·ååè¡¨æ°æ® |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillList")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList order by åæ®å· desc", "h_v_PM_WorkReportWeekBillMainList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_PM_WorkReportWeekBillMainList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by åæ®å· desc"; |
| | | ds = oCn.RunProcReturn(sql, "h_v_PM_WorkReportWeekBillMainList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªè·åå°å¨æ»ç»ç¸å
³æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥è¯¢æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» è·åç¼è¾åè¡¨æ°æ® |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainEditList")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillMainEditList(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList where HInterID='" + HInterID + "'", "h_v_PM_WorkReportWeekBillMainList"); |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªè·åå°å¨æ»ç»ç¸å
³æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥è¯¢æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» éæ©æ»ç»äººå¸¦åºå·¥æ¶ |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] |
| | | [HttpGet] |
| | |
| | | |
| | | #region å·¥ä½å¨æ»ç»ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ä¿åçäº§é¢æå |
| | | /// ä¿åå·¥ä½å¨æ»ç» |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | |
| | | oItem.HBillType = "4757"; |
| | | oItem.HBillSubType = "4757"; |
| | | |
| | | //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½å¨æ»ç» å é¤ |
| | | /// <summary> |
| | | ///åæ°ï¼string HInterIDã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainDelete")] |
| | | [HttpGet] |
| | | public object PM_WorkReportWeekBillMainDelete(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_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_WorkReportWeekBillMain where HInterID = " + HInterID); |
| | | //oCn.RunProc("delete from PM_WorkTaskWeekBillSub 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 |
| | | } |
| | | } |