| | |
| | | DataSet ds; |
| | | |
| | | #region 条码主档分页列表 |
| | | [Route("Gy_BarCodeBillList/page")] |
| | | [HttpGet] |
| | | public json page(string sWhere, string user, int page, int size) |
| | | { |
| | | json res = new json(); |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //编辑权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",''", "h_p_IF_BarCodeBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList"); |
| | | } |
| | | //[Route("Gy_BarCodeBillList/page")] |
| | | //[HttpGet] |
| | | //public json page(string sWhere, string user, int page, int size) |
| | | //{ |
| | | // json res = new json(); |
| | | // try |
| | | // { |
| | | // List<object> columnNameList = new List<object>(); |
| | | // //编辑权限 |
| | | // if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user)) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "无查看权限!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // if (sWhere == null || sWhere.Equals("")) |
| | | // { |
| | | // ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",''", "h_p_IF_BarCodeBillList"); |
| | | // } |
| | | // else |
| | | // { |
| | | // ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList"); |
| | | // } |
| | | |
| | | //添加列名 |
| | | 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列对象的列名 |
| | | } |
| | | // //添加列名 |
| | | // 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列对象的列名 |
| | | // } |
| | | |
| | | res.code = CodeConstant.SUCCEED; |
| | | res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | res.Message = "Sucess!"; |
| | | res.list = columnNameList; |
| | | res.data = ds.Tables[0]; |
| | | return res; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | res.code = CodeConstant.FAIL; |
| | | res.count = CountConstant.FAIL; |
| | | res.Message = "Exception!" + e.ToString(); |
| | | res.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | // res.code = CodeConstant.SUCCEED; |
| | | // res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | // res.Message = "Sucess!"; |
| | | // res.list = columnNameList; |
| | | // res.data = ds.Tables[0]; |
| | | // return res; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // res.code = CodeConstant.FAIL; |
| | | // res.count = CountConstant.FAIL; |
| | | // res.Message = "Exception!" + e.ToString(); |
| | | // res.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | } |