| | |
| | | using System.Data; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> a = new List<object>(); |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | a.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = a; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_QCCheckProjectList order by hmainid desc ", "h_v_Gy_QCCheckProjectList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_QCCheckProjectList order by 日期 desc ", "h_v_Gy_QCCheckProjectList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_QCCheckProjectList where 1=1"; |
| | | string sql = sql1 + sWhere+ " order by hmainid desc "; |
| | | string sql = sql1 + sWhere+ " order by 日期 desc "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_QCCheckProjectList"); |
| | | } |
| | | } |
| | |
| | | oItemSub.HRelationQty = 0; |
| | | oItemSub.HRelationMoney = 0; |
| | | oItemSub.HCloseMan = ""; |
| | | oItemSub.HDestructInspect = Convert.ToInt32(oItemSub.HDestructInspect); |
| | | oItemSub.HKeyInspect = Convert.ToInt32(oItemSub.HKeyInspect); |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |