| | |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Windows.Forms; |
| | | using SyntacticSugar.constant; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 销售出库单下推查询列表 |
| | | [Route("Kf_SellOutBill/PushList")] |
| | | [HttpGet] |
| | | public object PushList(string HBillNo, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql = "select * from h_v_IF_SellOutBillList_EditInit where 单据号 = '" + HBillNo + "' and 状态 = '已审核' and 数量 - 关联数量 > 0"; |
| | | |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_SellOutBillList_EditInit"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "找不到符合条件单据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |