| | |
| | | public DataSet ds = new DataSet(); |
| | | private json objjson = new json(); |
| | | private json objJsonResult = new json(); |
| | | // private POInStockBillServices oclscg_poinstockbillmain = new POInStockBillServices(); |
| | | // private POInStockBillServices oclscg_poinstockbillmain = new POInStockBillServices(); |
| | | /// <summary> |
| | | /// 送货单表头信息 |
| | | /// </summary> |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //获取最大ID值赋值 |
| | | DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_BadReason ", "Gy_BadReason"); |
| | | if (Maxds!=null||Maxds.Tables[0].Rows.Count > 0) |
| | | if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | { |
| | | //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | var maxid=Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); |
| | | var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); |
| | | maxid += 1; |
| | | HItemID = maxid; |
| | | } |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()) ) |
| | | if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //查询数据中是否存在重复代码 |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_BadReason where HStopflag=0 and HNumber='" + oItem.HNumber.Trim()+"'", "Gy_BadReason"); |
| | | if ( oItem.HNumber.Trim()=="" ) |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_BadReason where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadReason"); |
| | | if (oItem.HNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //新增时判断 |
| | | if (oItem.HItemID==0) |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | } |
| | | oItem.HShortNumber = sShortNumber;//短代码 |
| | | oItem.HEndFlag = true;//末级标志 |
| | | oItem.HLevel= DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级 |
| | | oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级 |
| | | |
| | | oBill.oModel = oItem; |
| | | } |
| | | |
| | | |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult; |
| | |
| | | } |
| | | oCN.BeginTran();//开始事务 |
| | | ds = oCN.RunProcReturn("select * from Gy_BadReason where HItemID=" + HItemID, "Gy_BadReason"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0 ) |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 报废原因 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetScrapReasonList_Json")] |
| | | [HttpGet] |
| | | public object GetScrapReasonList_Json(string BadReason) |
| | | { |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (BadReason != ""&& BadReason != null) |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + BadReason + "%' or HName like '%" + BadReason + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_ScrapReason where HStopflag=0 Order by HItemID ", "Gy_ScrapReason"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HNumber ,HName from Gy_ScrapReason where HStopflag=0 and HEndFlag=1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_ScrapReason"); |
| | | } |
| | | |
| | | //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取工序计划单列表 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取点检项目列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetCheckItemList_Json")] |
| | | [HttpGet] |
| | | public object GetCheckItemList_Json(string CheckItem) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (CheckItem != ""&& CheckItem!=null) |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) "; |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber,HName from Gy_DotCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HNumber,HName from Gy_DotCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取生产任务单列表 |
| | | /// </summary> |
| | | /// <returns></returns> |