| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string hnumber = ""; |
| | | if (tb2.Rows.Count > 0) |
| | | { |
| | | hnumber = DBUtility.ClsPub.isStrNull(tb2.Rows[0]["产品代码"].ToString()); |
| | | } |
| | | |
| | | for (int i = 0; i <= tb2.Rows.Count - 1; i++) |
| | | { |
| | | string sHNumber = ""; |
| | | if (DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()) != "") |
| | | { |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()); |
| | | //审核代码是否合理 |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (hnumber == DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString())) |
| | | //得到物料内码 |
| | | if (!oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | //得到物料内码 |
| | | if (!oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i+1).ToString() + "行," + sHNumber + "没有找到对应的物料!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | hnumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()); |
| | | sHNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()); |
| | | |
| | | //审核代码是否合理 |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "物料代码中不能出现连续‘.’并且首位末位不能为‘.’!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //得到物料内码 |
| | | if (!oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1).ToString() + "行," + sHNumber + "没有找到对应的物料!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1).ToString() + "行," + sHNumber + "没有找到对应的物料!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | |
| | | HProcID = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | |
| | | //获取工作中心 |
| | | ds = oCN.RunProcReturn("select * from Gy_WorkCenter Where HNumber='" + list[i]["工作中心代码"].ToString() + "'", "Gy_WorkCenter"); |
| | | ds = oCN.RunProcReturn("select * from Gy_WorkCenter Where HName='" + list[i]["工作中心"].ToString() + "'", "Gy_WorkCenter"); |
| | | var HCenterID = "0"; |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | HCenterID = ds.Tables[0].Rows[0]["HItemID"].ToString(); |