| | |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | if (user == "10000")//api同步方式 |
| | | { |
| | | oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID); |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | |
| | | //删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user)) |
| | | { |
| | |
| | | ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | oCN.RollBack();//回滚事务 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有数据,无法删除!"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack();//回滚事务 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!" + e.ToString(); |
| | |
| | | int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID; |
| | | int HNowSupID = mainList[0].HNowSupID; |
| | | int HNowSupTypeID = mainList[0].HNowSupTypeID; |
| | | |
| | | int HMadeSupID = mainList[0].HMadeSupID; |
| | | |
| | | |
| | | //主表 |
| | |
| | | ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" + |
| | | ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + |
| | | ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode" + |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + |
| | |
| | | ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" + |
| | | "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty + |
| | | "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" + |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'" + |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + |
| | | ") "); |
| | | |
| | | |
| | |
| | | int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID; |
| | | int HNowSupID = mainList[0].HNowSupID; |
| | | int HNowSupTypeID = mainList[0].HNowSupTypeID; |
| | | int HMadeSupID = mainList[0].HMadeSupID; |
| | | |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | |
| | | ",HNowSupTypeID=" + HNowSupTypeID.ToString() + |
| | | ",HProdWeight=" + HProdWeight.ToString() + |
| | | ",HBarCode='" + HBarCode.ToString() + "'" + |
| | | ",HMadeSupID=" + HMadeSupID + |
| | | " where HInterID=" + HInterID.ToString()); |
| | | |
| | | //修改子项目代码 |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 磨具档案修改按钮方法-计算下次保养/校正日期-获取档案最近一次的保养记录 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Gy_Mould_Edit/calculateHNextMainDate")] |
| | | [HttpGet] |
| | | public object calculateHNextMainDate(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | string sql = @"select top(1) a.HInterID, b.HEndDate 保养记录结束日期 |
| | | from Gy_MouldFileMain AS a LEFT OUTER JOIN |
| | | Sc_MouldMaintainBillMain AS b on a.HInterID = b.HMouldID |
| | | where a.HInterID = " + HInterID + |
| | | " order by b.HEndDate desc"; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainBillMain"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 磨具档案修改按钮方法 |