| | |
| | | using WebAPI.Models; |
| | | using System.Threading.Tasks; |
| | | using DLL; |
| | | using SyntacticSugar.constant; |
| | | |
| | | namespace WebAPI.Controllers.项ç®ç®¡ç.å·¥ä½ä»»å¡ |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½ä»»å¡å表å页å表 |
| | | [Route("PM_WorkTaskBill/page")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | 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; |
| | | //} |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_WorkTaskBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | 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 å·¥ä½ä»»å¡å表 䏿¨æ°æ®æ¥è¯¢ |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 任塿±æ¥å页å表 |
| | | [Route("PM_WorkTaskReportBill/page")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskReportBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | 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; |
| | | //} |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskReportBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_WorkTaskReportBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | 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 任塿±æ¥ ç¼è¾-页é¢èµå¼ |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | |
| | | #region èªå¨å 载页é¢è¡¨å¤´ |
| | | /// <summary> |
| | | /// è¿å项ç®é¶æ®µå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Xt_DefineBillMainSet/getDefineBillMainSet")] |
| | | [HttpGet] |
| | | public object getDefineBillMainSet(string HModName, string user) |
| | | { |
| | | try |
| | | { |
| | | string sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='" + user + "' order by HArrangeOrder,HArrangeOrderSub"; |
| | | ds = oCN.RunProcReturn(sql, "Xt_DefineBillMainSet"); |
| | | //#region èªå¨å 载页é¢è¡¨å¤´ |
| | | ///// <summary> |
| | | ///// è¿å项ç®é¶æ®µå表 |
| | | /////åæ°ï¼string sqlã |
| | | /////è¿åå¼ï¼objectã |
| | | ///// </summary> |
| | | //[Route("Xt_DefineBillMainSet/getDefineBillMainSet")] |
| | | //[HttpGet] |
| | | //public object getDefineBillMainSet(string HModName, string user) |
| | | //{ |
| | | // try |
| | | // { |
| | | // string sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='" + user + "' order by HArrangeOrder,HArrangeOrderSub"; |
| | | // ds = oCN.RunProcReturn(sql, "Xt_DefineBillMainSet"); |
| | | |
| | | if(ds!=null && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='admin' order by HArrangeOrder,HArrangeOrderSub"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Xt_DefineBillMainSet_AutoLoadList"); |
| | | } |
| | | // if(ds!=null && ds.Tables[0].Rows.Count == 0) |
| | | // { |
| | | // sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='admin' order by HArrangeOrder,HArrangeOrderSub"; |
| | | // ds = oCN.RunProcReturn(sql, "h_v_Xt_DefineBillMainSet_AutoLoadList"); |
| | | // } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "Sucessï¼"; |
| | | // objJsonResult.data = ds.Tables[0]; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //#endregion |
| | | } |
| | | } |