/// <summary> /// 取的runcard的資料來源 /// </summary> /// <param name="LotDataList"></param> /// <returns></returns> private DataSet GetRunCardDataSource(ToolInfo toolData) { #region 定義 LOTDATA 資料表 DataTable dtToolData = toolData.CopyDataToTable("TOOLData"); dtToolData.Columns.Add("ToolTypeDescr"); #endregion var toolTypeInfo = ToolTypeInfo.GetToolTypeByType(toolData.ToolType); dtToolData.Rows[0]["ToolTypeDescr"] = toolTypeInfo.Description; DataSet dsReportData = new DataSet(); dsReportData.Tables.Add(dtToolData); return(dsReportData); }
/// <summary> /// 依照檢驗計畫取得該物件的datatable /// </summary> /// <param name="QCTypeData"></param> /// <param name="objectName"></param> /// <returns></returns> public static DataTable GetInspectionData(QCTypeInfo QCTypeData, string objectName) { string sql = ""; DataTable dtQCTarget = null; #region 依照檢驗計畫取得該物件的datatable switch (QCTypeData.QCTarget) { case "MES_WIP_LOT": { LotInfo lot = LotInfo.GetLotByLot(objectName); if (lot == null) { throw new Exception(TextMessage.Error.T00378(objectName)); } dtQCTarget = lot.CopyDataToTable(lot.ID); } break; case "MES_WIP_COMP": { //取得component資訊以及所在的工作站 sql = @"SELECT L.OPERATION,C.* FROM MES_WIP_COMP C INNER JOIN MES_WIP_LOT L ON C.CURRENTLOT = L.LOT WHERE COMPONENTID = #[STRING]"; ComponentInfo comp = InfoCenter.GetBySQL <ComponentInfo>(sql, objectName); if (comp == null) { throw new Exception(TextMessage.Error.T00154(objectName)); } dtQCTarget = comp.CopyDataToTable(comp.ID); } break; case "MES_CMS_CAR": { CarrierInfo carrier = CarrierInfo.GetCarrierByCarrierNo(objectName); if (carrier == null) { throw new RuleCimesException(TextMessage.Error.T00725(objectName)); } dtQCTarget = carrier.CopyDataToTable(carrier.ID); } break; case "MES_TOOL_MAST": { ToolInfo tool = ToolInfo.GetToolByName(objectName); if (tool == null) { throw new Exception(TextMessage.Error.T00592(objectName)); } dtQCTarget = tool.CopyDataToTable(tool.ID); } break; case "MES_MMS_MLOT": { MaterialLotInfo mlot = MaterialLotInfo.GetMaterialLotByMaterialLot(objectName); if (mlot == null) { throw new Exception(TextMessage.Error.T00512(objectName)); } dtQCTarget = mlot.CopyDataToTable(mlot.ID); } break; case "MES_EQP_EQP": { EquipmentInfo equipment = EquipmentInfo.GetEquipmentByName(objectName); if (equipment == null) { throw new Exception(TextMessage.Error.T00885(objectName)); } dtQCTarget = equipment.CopyDataToTable(equipment.ID); } break; default: { sql = string.Format("SELECT * FROM {0} WHERE {1} = #[STRING]", QCTypeData.QCTarget, QCTypeData.IdentityColumn); dtQCTarget = DBCenter.GetDataTable(sql, objectName); if (dtQCTarget == null || dtQCTarget.Rows.Count == 0) { throw new Exception(TextMessage.Error.T00030("InspectionTarget", objectName)); } } break; } #endregion return(dtQCTarget); }