|  |  | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 获取物料精度通过id | 
 |  |  |         [Route("Gy_Material/getDecByID")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object getDecByID(int HMaterID) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 if(HMaterID == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "没有选择物料"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 ds = oCN.RunProcReturn(@"select HQtyDec,HPriceDec,HMoneyDec from Gy_Material where HitemID=" + HMaterID , "Gy_Material"); | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "没有找到该物料编码"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Success"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 return objJsonResult; | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "Exception!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 获取项目号 | 
 |  |  |         [Route("Gy_Material/Get_HProject")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Get_HProject(string HOrgID) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 DataSet oDs = new DataSet(); | 
 |  |  |                 //========== | 
 |  |  |                 oDs = oCN.RunProcReturn("select top(20) HInterID as HItemID,HProName HName from PM_ProjectBillMain", "PM_ProjectBillMain"); | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "获取成功!"; | 
 |  |  |                 objJsonResult.data = oDs.Tables[0]; | 
 |  |  |                 return objJsonResult; ; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "删除失败!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 物料设置获取信息 | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_Query", 1, false, user)) | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                 string sql = sql1 + sWhere + " order by hmainid desc"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  | 
 |  |  |                 long HSPID = mainList[0].HSPID; | 
 |  |  |                 Double HDesignLife = mainList[0].HDesignLife; | 
 |  |  |                 Double HUseLife = mainList[0].HUseLife; | 
 |  |  |                 Double HInitLife = mainList[0].HInitLife;//上线初始化寿命 | 
 |  |  |                 Double HLeaveLife = mainList[0].HLeaveLife; | 
 |  |  |                 Double HProdQty = mainList[0].HProdQty; | 
 |  |  |                 Double HProdWeight = mainList[0].HProdWeight; | 
 |  |  | 
 |  |  |                 ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + | 
 |  |  |                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + | 
 |  |  |                 ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" + | 
 |  |  |                 ",HMouldClass,HNowWHID,HNowSPID) " + | 
 |  |  |                 ",HMouldClass,HNowWHID,HNowSPID,HInitLife) " + | 
 |  |  |                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + | 
 |  |  |                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + | 
 |  |  |                 ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" + | 
 |  |  | 
 |  |  |                 "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty + | 
 |  |  |                 "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" + | 
 |  |  |                 ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + | 
 |  |  |                 ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ") "); | 
 |  |  |                 ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') "); | 
 |  |  |  | 
 |  |  |                 //子表 | 
 |  |  |                 oCN.RunProc("Insert into Gy_MouldFileSub " + | 
 |  |  | 
 |  |  |                 long HSPID = mainList[0].HSPID; | 
 |  |  |                 Double HDesignLife = mainList[0].HDesignLife; | 
 |  |  |                 Double HUseLife = mainList[0].HUseLife; | 
 |  |  |                 Double HInitLife = mainList[0].HInitLife; | 
 |  |  |                 Double HLeaveLife = mainList[0].HLeaveLife; | 
 |  |  |                 Double HProdQty = mainList[0].HProdQty; | 
 |  |  |                 Double HProdWeight = mainList[0].HProdWeight; | 
 |  |  | 
 |  |  |                 ",HMadeSupID=" + HMadeSupID + | 
 |  |  |                 ",HNowWHID=" + HNowWHID + | 
 |  |  |                 ",HNowSPID=" + HNowSPID + | 
 |  |  |                 " where HInterID=" + HInterID.ToString()); | 
 |  |  |                 ",HInitLife='" + HInitLife + | 
 |  |  |                 "' where HInterID=" + HInterID.ToString()); | 
 |  |  |  | 
 |  |  |                 //修改子项目代码 | 
 |  |  |                 //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |