| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("WW_PPBomBill_Query", 1, false, user)) |
| | | { |
| | |
| | | } |
| | | |
| | | ds = WW_PPBomBillList(sWhere); |
| | | if (ds == null) |
| | | |
| | | |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æ°æ®å¼å¸¸ï¼è¯·ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | foreach (DataColumn col in ds.Tables[0].Columns)//éådsä¸ç¬¬ä¸ä¸ªè¡¨ï¼Tables[0]ï¼çææåï¼Columnsï¼æ¯æ¬¡å¾ªç¯ä¸ï¼colåé伿æå½ååçå¼ç¨ |
| | | { |
| | | Type dataType = col.DataType; //è·åå½åæ°æ®ç±»åä¼ å
¥ èªå®ä¹åédatadataType |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //åç¬¦ä¸²æ¼æ¥ // å°åååæ°æ®ç±»åä¿¡æ¯æ¼æ¥æä¸ä¸ªJSONæ ¼å¼çå符串 |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0];//代ç å°ç¬¬ä¸ä¸ªDataTableï¼ç´¢å¼ä¸º0ï¼èµå¼ç»objJsonResultçdata屿§ |
| | | objJsonResult.list = columnNameList;//å°columnNameListèµå¼ç»objJsonResultçlist屿§ |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°æ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_WW_PPBomBillList"); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |