| | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 项ç®è´¹ç¨å¾
ä¿åå表 |
| | | #region å·¥ç¨é¡¹ç®è´¹ç¨å¾
ä¿åå表 |
| | | [Route("PM_ProjectBill/NeedSaveQuery")] |
| | | [HttpGet] |
| | | public object PM_ProjectBillNeedSaveQuery(string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æé |
| | | //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = CodeConstant.FAIL; |
| | | // objJsonResult.count = CountConstant.FAIL; |
| | | // objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillNeedSaveQuery ", "h_p_PM_ProjectBillNeedSaveQuery"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ç¨é¡¹ç®è´¹ç¨ ä¿ååä¿å |
| | | |
| | | [Route("PM_ProjectBill/SaveTaskMoney")] |
| | | [HttpGet] |
| | | public object SaveTaskMoney(string HInterID, string Type, string user,int HMoney) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Pm_ProjectBill_edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "PM_ProjectBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | 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; |
| | | } |
| | | //Type ä»»å¡å®è£
è´¹ä¿åæ è®° |
| | | if (Type == "SetupMoneySave") |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HTaskSetupMoneySaveFlag"].ToString() == "False") |
| | | { |
| | | oCN.RunProcReturn("update PM_ProjectBillMain set HTaskSetupMoneySaveFlag = 1,HTaskSetupMoney="+HMoney+" where HInterID = " + HInterID, "PM_ProjectBillMain"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è´¹ç¨å·²ä¿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | } |
| | | //ä»»å¡éå±ä¿å |
| | | else if (Type == "OtherMoneySave") |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HTaskOtherMoneySaveFlag"].ToString() == "False") |
| | | { |
| | | oCN.RunProcReturn("update PM_ProjectBillMain set HTaskOtherMoneySaveFlag = 1,HTaskOtherMoney=" + HMoney + " where HInterID = " + HInterID, "PM_ProjectBillMain"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è´¹ç¨å·²ä¿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | } |
| | | //ä»»å¡èæ ¸è´¹ä¿å |
| | | else if (Type == "ExamMoneySave") |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HTaskExamMoneySaveFlag"].ToString() == "False") |
| | | { |
| | | oCN.RunProcReturn("update PM_ProjectBillMain set HTaskExamMoneySaveFlag = 1,HTaskExamMoney=" + HMoney + " where HInterID = " + HInterID, "PM_ProjectBillMain"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è´¹ç¨å·²ä¿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | } |
| | | //ä»»å¡å·¥è´¹ä¿åæ è®° |
| | | else if (Type == "WorkMoneySave") |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HTaskWorkMoneySaveFlag"].ToString() == "False") |
| | | { |
| | | oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 1,HTaskWorkMoney=" + HMoney + " where HInterID = " + HInterID, "PM_ProjectBillMain"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è´¹ç¨å·²ä¿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | } |
| | | //åä¿åè´¹ç¨ |
| | | else if (Type == "UnSave") |
| | | { |
| | | |
| | | oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 0,HTaskExamMoneySaveFlag = 0,HTaskOtherMoneySaveFlag = 0,HTaskSetupMoneySaveFlag = 0 where HInterID = " + HInterID, "PM_ProjectBillMain"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸ç±»åä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | |
| | | 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 |
| | | |
| | | #endregion |
| | | } |
| | | } |