private static ToolTypeClassList getToolTypeList(XmlNode productparameter, ToolTypeClassList toolTypeClassList) { ToolTypeClassList toolTypeList = new ToolTypeClassList(); XmlNodeList toolTypes = productparameter.ChildNodes; foreach (XmlNode tooType in toolTypes) { string toolTypeID = tooType.InnerText; ToolTypeClass toolType = toolTypeClassList.GetToolType(tooType.InnerText); toolTypeList.AddToolType(toolType); } return(toolTypeList); }
public ToolList loadTool(InitDataLoad initDataLoad) { ToolTypeClassList toolTypeClassList = initDataLoad.MetaData.ToolTypeMetaData; ProductClassList productslist = initDataLoad.MetaData.ProductsMetaData; FileManager fileManger = new FileManager(); string filePath; filePath = @"C:\Users\eyurkovs\Desktop\final progect\FinalProject\FinalProject\FinalProject\dataSets\Scenario1\ToolList.csv"; DataTable toolTable; try { toolTable = fileManger.GetCSV(filePath); } catch (Exception) { MessageBox.Show("Choose toollist file path"); filePath = fileManger.openFilePathCSV(); toolTable = fileManger.GetCSV(filePath); } ToolList toollist = new ToolList(); foreach (DataRow row in toolTable.Rows) { Tool tool = new Tool(); tool.ToolID = row[0].ToString(); tool.ToolName = row[1].ToString(); tool.ToolType = toolTypeClassList.GetToolType(row[2].ToString()); tool.ShiftStartTime = Convert.ToInt16(row[3].ToString()); tool.ShiftStartTime = Convert.ToInt16(row[4].ToString()); ProductClass product = productslist.GetProduct(row[5].ToString()); int productionTime = Convert.ToInt16(row[6].ToString()); tool.ProductsProcessingTime.Add(product, productionTime); toollist.AddTool(tool); } return(toollist); }