| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBillList where hmainid=" + HInterID, "h_v_IF_POInStockBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBillEdit where hmainid=" + HInterID, "h_v_IF_POInStockBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region 收料通知单分页列表 |
| | | [Route("Cg_POInStockBill/page")] |
| | | [HttpGet] |
| | | public object Cg_POInStockBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | json res = new json(); |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //判断权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "您没有该模块权限,请与管理员联系!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_POInStockBillList " + page + "," + size + ",''", "h_p_IF_POInStockBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_POInStockBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_POInStockBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 res; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 返回收料通知单列表 |
| | |
| | | foreach (ClsCg_POInStockBillSub oSub in DetailColl) |
| | | { |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "行,数量不能为0或者小于0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "行,数量不能为0或者小于0"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | |
| | | } |
| | | string sql = "select * from h_v_Cg_POInStockBillQuerySub where hmainid = " + hmainid; |
| | | |
| | | ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Cg_POInStockBillQuerySub"); |
| | | ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Cg_POInStockBillQuerySub"); |
| | | |
| | | |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |