| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | sWhere = sWhere?.Replace("'", "''") ?? ""; |
| | | if (string.IsNullOrEmpty(sWhere)) |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldLifeChangeBillList_Query"); |
| | | } |
| | |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldLifeChangeBillList_Query"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | // æ·»å ç©ºå¼æ£æ¥ |
| | | if (ds == null || ds.Tables.Count == 0) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢æåï¼ä½æ æ°æ®ï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | // æ£æ¥ç¬¬ä¸ä¸ªè¡¨ |
| | | if (ds.Tables[0] != null) |
| | | { |
| | | //æ·»å åå |
| | | 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)); |
| | | } |
| | | } |
| | | |
| | | // æ£æ¥ç¬¬äºä¸ªè¡¨åè¡æ°æ® |
| | | int totalCount = 0; |
| | | if (ds.Tables.Count > 1 && ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) |
| | | { |
| | | var countRow = ds.Tables[1].Rows[0]["count"]; |
| | | if (countRow != null && countRow != DBNull.Value) |
| | | { |
| | | totalCount = int.Parse(countRow.ToString()); |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.count = totalCount; |
| | | objJsonResult.Message = "Successï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = ds.Tables[0] ?? new DataTable(); // ç¡®ä¿ä¸ä¸ºnull |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |