| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | DataSet ds; |
| | | |
| | | /// <summary> |
| | | /// 返回仓库列表 |
| | | /// 返回故障类别列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //编辑权限 |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType", 1, false, user)) |
| | | //{ |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_ConkTypeList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 包装方式列表删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | |
| | | [Route("DeltetGy_ConkType")] |
| | | [HttpGet] |
| | | public object DeltetGy_ConkType(string HItemID, string user) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [Route("Gy_ConkType/List_PDA")] |
| | | [HttpGet] |
| | | public object List_PDA(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (sWhere != "" && sWhere != null) |
| | | { |
| | | sWhere = " and 禁用标志='' and ( 故障类别代码 like '%" + sWhere + "%' or 故障类别 like '%" + sWhere + "%' ) "; |
| | | } |
| | | else |
| | | { |
| | | sWhere = " and 禁用标志='' "; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_Gy_ConkTypeList where 1=1 "); |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by 故障类别代码 ", "h_v_Gy_ConkTypeList"); |
| | | |
| | | //添加列名 |
| | | 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 = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |