public static void DelBcf(string progId, List <string> list, LibDataAccess dataAccess, LibManagerMessage manager = null) { if (manager == null) { manager = new LibManagerMessage(); } try { foreach (var item in list) { if (!string.IsNullOrEmpty(item)) { LibBcfData bcfData = (LibBcfData)LibBcfSystem.Default.GetBcfInstance(progId); bcfData.DataAccess = dataAccess; DataSet ds = bcfData.BrowseTo(new object[] { item }); if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) { continue; } ds.Clear(); bcfData.Delete(new object[] { item }); } } } catch (Exception ex) { manager.AddMessage(new LibMessage() { MessageKind = LibMessageKind.Error, Message = string.Format("系统错误:{0}", ex.Message) }); } }
/// <summary> /// 根据当前标准工艺路线的ID返回其本身或复制的数据模型 /// </summary> /// <param name="techRouteId">标准工艺路线的唯一标识</param> /// <param name="materialId">物料的唯一标识</param> /// <param name="isCopy">是否要复制当前标准工艺路线的数据模型,true表示复制,false表示不复制</param> /// <returns>返回当前标准工艺路线本身或复制的组件布局数据模型</returns> public JsonResult GetTechRouteInfoById(string techRouteId, string materialId, bool isCopy) { ExecuteBcfMethodResult result = new ExecuteBcfMethodResult(); LibManagerMessage manageMessage = new LibManagerMessage(); TechRouteModel techRouteModel = CPSModuleConfig.GetTechRouteInfoById(techRouteId, materialId, isCopy, manageMessage); result.Result = techRouteModel; result.Messages = manageMessage.MessageList; return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获得生产线下所有工作站点的派工单的完成情况 /// </summary> /// <param name="info">CPS产线配置模型数据</param> /// <returns>返回生产线下的工作站点-派工单的信息</returns> public JsonResult GetProduceLineOfStationInfo(CPSProduceControlLineConfig info) { ExecuteBcfMethodResult result = new ExecuteBcfMethodResult(); LibManagerMessage manageMessage = new LibManagerMessage(); List <ProduceModuleInfo> produceControlLineModel = CPSModuleConfig.GetProduceLineOfStationInfo(info, manageMessage); result.Result = produceControlLineModel; result.Messages = manageMessage.MessageList; return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> ///验证产线配置规则,并保存为CPS产线模型数据和产线配置数据 /// </summary> /// <param name="info">CPS产线配置模型数据</param> /// <returns>返回保存后的CPS产线配置模型数据以及错误信息</returns> public JsonResult SaveProduceControlLine(CPSProduceControlLineConfig info) { ExecuteBcfMethodResult result = new ExecuteBcfMethodResult(); LibManagerMessage manageMessage = new LibManagerMessage(); try { var model = CPSModuleConfig.SaveProduceControlLine(info, manageMessage); result.Result = model; result.Messages = manageMessage.MessageList; } catch (Exception ex) { string message = ex.InnerException == null ? ex.Message : ex.InnerException.Message; manageMessage.AddMessage(LibMessageKind.SysException, string.Format("异常信息:{0}{1}异常堆栈:{2}", message, Environment.NewLine, ex.StackTrace)); result.Messages = manageMessage.MessageList; } return(Json(result, JsonRequestBehavior.AllowGet)); }