public static IEnumerable<XElement> GetFormulationMaterialsXML(Formulation formulation) { /* <object> <field name="Materials" /> <tableSection pivotType="1" propertyCount="92" rowCount="4"> <elementTags layout="" /> <tableProperty height="0" width="1440" visible="false"> <property name="Lot Container Pair" /> <elementTags fieldData="<fieldData name="Lot Container Pair" />" /> </tableProperty> <tableProperty height="0" width="1635" visible="true"> <property name="Name" /> <elementTags fieldData="<fieldData name="Name" />" /> </tableProperty> <tableProperty height="0" width="480" visible="true"> <property name="Materials Step" /> <elementTags fieldData="<fieldData name="Step" keyField="False" linkTable="Steps:Steps Step" />" /> </tableProperty> <tableProperty height="0" width="1185" visible="true"> <property name="Materials Addition Order" /> <elementTags fieldData="<fieldData name="Addition Order" />" /> </tableProperty> <tableProperty height="0" width="1800" visible="true"> <property name="Materials Percent Volume of Total" /> <elementTags fieldData="<fieldData name="Percent Volume of Total" />" /> </tableProperty> <tableProperty height="0" width="1215" visible="true"> <property name="Materials wt/wt of Total" /> <elementTags fieldData="<fieldData name="wt/wt of Total" />" /> </tableProperty> <tableProperty height="0" width="660" visible="true"> <property name="Materials Stage Number" /> <elementTags fieldData="<fieldData name="Stage #" />" /> </tableProperty> <tableProperty height="0" width="1380" visible="true"> <property name="Safety Code 1" /> <elementTags fieldData="<fieldData name="Safety Code 1" />" /> </tableProperty> <tableProperty height="0" width="1380" visible="true"> <property name="Safety Code 2" /> <elementTags fieldData="<fieldData name="Safety Code 2" />" /> </tableProperty> <tableProperty height="0" width="1380" visible="true"> <property name="Container Updated" /> <elementTags fieldData="<fieldData name="Container Updated" />" /> </tableProperty> <tableProperty height="0" width="1380" visible="true"> <property name="Materials Nitrogen Content" /> <elementTags fieldData="<fieldData name="Nitrogen Content" />" /> </tableProperty> <tableProperty height="0" width="1665" visible="true"> <property name="Materials Nitrogen Contribution" /> <elementTags fieldData="<fieldData name="Nitrogen Contribution" />" /> </tableProperty> <tableProperty height="0" width="1185" visible="true"> <property name="Materials Safety Code 1" /> <elementTags fieldData="<fieldData name="Mat'l Safety Code 1" />" /> </tableProperty> <tableProperty height="0" width="1185" visible="true"> <property name="Materials Safety Code 2" /> <elementTags fieldData="<fieldData name="Mat'l Safety Code 2" />" /> </tableProperty> <tableProperty height="0" width="1620" visible="true"> <property name="Materials Phosphorus Content" /> <elementTags fieldData="<fieldData name="Phosphorus Content" />" /> </tableProperty> <tableProperty height="0" width="1065" visible="true"> <property name="Materials Purity" /> <elementTags fieldData="<fieldData name="Purity" />" /> </tableProperty> <tableProperty height="0" width="1110" visible="true"> <property name="Materials Container ID" /> <elementTags fieldData="<fieldData name="Container ID" />" /> </tableProperty> <tableProperty height="0" width="1905" visible="true"> <property name="Materials Phosphorus Contribution" /> <elementTags fieldData="<fieldData name="Phosphorus Contribution" />" /> </tableProperty> <tableProperty height="0" width="1185" visible="true"> <property name="Materials Sulfur Content" /> <elementTags fieldData="<fieldData name="Sulfur Content" />" /> </tableProperty> <tableProperty height="0" width="1455" visible="true"> <property name="Materials Lot ID" /> <elementTags fieldData="<fieldData name="Lot ID" />" /> </tableProperty> <tableProperty height="0" width="1470" visible="true"> <property name="Materials Container Number" /> <elementTags fieldData="<fieldData name="Container #" />" /> </tableProperty> <tableProperty height="0" width="1470" visible="true"> <property name="Materials Sulfur Contribution" /> <elementTags fieldData="<fieldData name="Sulfur Contribution" />" /> </tableProperty> <tableProperty height="0" width="1665" visible="true"> <property name="Materials Designed Treat Rate" /> <elementTags fieldData="<fieldData name="Designed Treat Rate" />" /> </tableProperty> <tableProperty height="0" width="5865" visible="true"> <property name="Materials Treat Rate" /> <elementTags fieldData="<fieldData name="Materials Treat Rate" />" /> </tableProperty> <tableProperty height="0" width="1200" visible="true"> <property name="Materials Base Oil Group" /> <elementTags fieldData="<fieldData name="Materials Base Oil Group" />" /> </tableProperty> <tableProperty height="0" width="1275" visible="true"> <property name="Materials MSDS" /> <elementTags fieldData="<fieldData name="Materials MSDS" />" /> </tableProperty> <tableProperty height="0" width="2100" visible="true"> <property name="Materials Molecular Weight" /> <elementTags fieldData="<fieldData name="Materials Molecular Weight" />" /> </tableProperty> <tableProperty height="0" width="855" visible="true"> <property name="Materials Material ID" /> <elementTags fieldData="<fieldData name="Material ID" keyField="True" />" /> </tableProperty> <tableProperty height="0" width="1605" visible="true"> <property name="Materials Fluid Code" /> <elementTags fieldData="<fieldData name="Materials Fluid Code" />" /> </tableProperty> <tableProperty height="0" width="1410" visible="true"> <property name="Materials FC Mod" /> <elementTags fieldData="<fieldData name="Materials FC Mod" />" /> </tableProperty> <tableProperty height="0" width="1650" visible="true"> <property name="Materials FC Number" /> <elementTags fieldData="<fieldData name="Materials FC Number" />" /> </tableProperty> <tableProperty height="0" width="1485" visible="true"> <property name="Materials FC Prefix" /> <elementTags fieldData="<fieldData name="Materials FC Prefix" />" /> </tableProperty> <tableProperty height="0" width="1560" visible="true"> <property name="Materials FC Rev" /> <elementTags fieldData="<fieldData name="Materials FC Rev" />" /> </tableProperty> <tableProperty height="0" width="1305" visible="true"> <property name="Materials Status" /> <elementTags fieldData="<fieldData name="Materials Status" />" /> </tableProperty> <tableProperty height="0" width="1260" visible="true"> <property name="Materials Expiration Date" /> <elementTags fieldData="<fieldData name="Expiration Date" />" /> </tableProperty> <tableProperty height="0" width="1935" visible="true"> <property name="Materials X-Number Alias" /> <elementTags fieldData="<fieldData name="Materials X-Number Alias" />" /> </tableProperty> <tableProperty height="0" width="1440" visible="true"> <property name="Materials HMIS_F" /> <elementTags fieldData="<fieldData name="HMIS_F" />" /> </tableProperty> <tableProperty height="0" width="1470" visible="true"> <property name="Materials HMIS_H" /> <elementTags fieldData="<fieldData name="HMIS_H" />" /> </tableProperty> <tableProperty height="0" width="1800" visible="true"> <property name="Materials Manufacturer" /> <elementTags fieldData="<fieldData name="Materials Manufacturer" />" /> </tableProperty> <tableProperty height="0" width="1530" visible="true"> <property name="Materials On TSCA" /> <elementTags fieldData="<fieldData name="Materials On TSCA" />" /> </tableProperty> <tableProperty height="0" width="2085" visible="true"> <property name="Materials Research Aliases" /> <elementTags fieldData="<fieldData name="Materials Research Aliases" />" /> </tableProperty> <tableProperty height="0" width="1515" visible="true"> <property name="Materials Shelf Life" /> <elementTags fieldData="<fieldData name="Materials Shelf Life" />" /> </tableProperty> <tableProperty height="0" width="1605" visible="true"> <property name="Materials Master Lot?" /> <elementTags fieldData="<fieldData name="Materials Master Lot" />" /> </tableProperty> <tableProperty height="0" width="1815" visible="true"> <property name="Materials Material Type" /> <elementTags fieldData="<fieldData name="Materials Material Type" />" /> </tableProperty> <tableProperty height="0" width="1530" visible="true"> <property name="Materials HMIS_PE" /> <elementTags fieldData="<fieldData name="HMIS_PE" />" /> </tableProperty> <tableProperty height="0" width="1470" visible="true"> <property name="Materials HMIS_R" /> <elementTags fieldData="<fieldData name="HMIS_R" />" /> </tableProperty> <tableProperty height="0" width="1290" visible="true"> <property name="Materials Genre" /> <elementTags fieldData="<fieldData name="Materials Genre" />" /> </tableProperty> <tableProperty height="0" width="1740" visible="true"> <property name="Materials HiTEC Alias" /> <elementTags fieldData="<fieldData name="Materials HiTEC Alias" />" /> </tableProperty> <tableProperty height="0" width="1410" visible="true"> <property name="Materials Formula" /> <elementTags fieldData="<fieldData name="Materials Formula" />" /> </tableProperty> <tableProperty height="0" width="1065" visible="true"> <property name="Materials Lot Number" /> <elementTags fieldData="<fieldData name="Lot #" />" /> </tableProperty> <tableProperty height="0" width="1635" visible="true"> <property name="Materials Flash Point" /> <elementTags fieldData="<fieldData name="Materials Flash Point" />" /> </tableProperty> <tableProperty height="0" width="1650" visible="true"> <property name="Materials Description" /> <elementTags fieldData="<fieldData name="Materials Description" />" /> </tableProperty> <tableProperty height="0" width="1560" visible="true"> <property name="Materials Champion" /> <elementTags fieldData="<fieldData name="Materials Champion" />" /> </tableProperty> <tableProperty height="0" width="1950" visible="true"> <property name="Materials HS&E Caution" /> <elementTags fieldData="<fieldData name="HS&amp;E Caution" />" /> </tableProperty> <tableProperty height="0" width="1620" visible="true"> <property name="Materials Toxicology" /> <elementTags fieldData="<fieldData name="Materials Toxicology" />" /> </tableProperty> <tableProperty height="0" width="1275" visible="true"> <property name="Materials Role" /> <elementTags fieldData="<fieldData name="Role" />" /> </tableProperty> <tableProperty height="0" width="870" visible="true"> <property name="Chemical Structure" /> <elementTags fieldData="<fieldData name="Structure" />" /> </tableProperty> <tableProperty height="0" width="990" visible="true"> <property name="Materials Density" /> <elementTags fieldData="<fieldData name="Density" />" /> </tableProperty> <tableProperty height="0" width="840" visible="true"> <property name="Materials Percent Active" /> <elementTags fieldData="<fieldData name="% Active" />" /> </tableProperty> <tableProperty height="0" width="855" visible="true"> <property name="Materials Cost/Mass" /> <elementTags fieldData="<fieldData name="Cost/Mass" />" /> </tableProperty> <tableProperty height="0" width="1155" visible="true"> <property name="Materials Cost/Amount" /> <elementTags fieldData="<fieldData name="Cost/Amount" />" /> </tableProperty> <tableProperty height="0" width="4515" visible="true"> <property name="Materials Percent Mass" /> <elementTags fieldData="<fieldData name="Mass/Mass" />" /> </tableProperty> <tableProperty height="0" width="1875" visible="true"> <property name="Materials Percent Mass of Total" /> <elementTags fieldData="<fieldData name="Percent Mass of Total" />" /> </tableProperty> <tableProperty height="0" width="2070" visible="true"> <property name="Materials Percent Mass Total Material" /> <elementTags fieldData="<fieldData name="Percent Mass Total Material" />" /> </tableProperty> <tableProperty height="0" width="24135" visible="true"> <property name="Materials Batch Mass Planned" /> <elementTags fieldData="<fieldData name="Batch Mass Planned" />" /> </tableProperty> <tableProperty height="0" width="23085" visible="true"> <property name="Materials Unit Volume Planned" /> <elementTags fieldData="<fieldData name="Unit Vol Planned" />" /> </tableProperty> <tableProperty height="0" width="1050" visible="true"> <property name="Materials Inventory ID" /> <elementTags fieldData="<fieldData name="Inventory ID" />" /> </tableProperty> <tableProperty height="0" width="28455" visible="true"> <property name="Materials Unit Mass Planned" /> <elementTags fieldData="<fieldData name="Unit Mass Planned" />" /> </tableProperty> <tableProperty height="0" width="795" visible="true"> <property name="Materials Supplier" /> <elementTags fieldData="<fieldData name="Supplier" />" /> </tableProperty> <tableProperty height="0" width="23085" visible="true"> <property name="Materials Batch Volume Planned" /> <elementTags fieldData="<fieldData name="Batch Vol Planned" />" /> </tableProperty> <tableProperty height="0" width="1080" visible="true"> <property name="Materials Formula Mass" /> <elementTags fieldData="<fieldData name="Formula Mass" />" /> </tableProperty> <tableProperty height="0" width="930" visible="true"> <property name="Materials Molarity" /> <elementTags fieldData="<fieldData name="Molarity" />" /> </tableProperty> <tableProperty height="0" width="1530" visible="true"> <property name="Materials Batch Mass Actual" /> <elementTags fieldData="<fieldData name="Batch Mass Act." />" /> </tableProperty> <tableProperty height="0" width="1830" visible="true"> <property name="Materials Batch Mass Actual Active" /> <elementTags fieldData="<fieldData name="Batch Mass Act. Active" />" /> </tableProperty> <tableProperty height="0" width="1110" visible="true"> <property name="Materials Batch Volume Actual" /> <elementTags fieldData="<fieldData name="Batch Vol Act." />" /> </tableProperty> <tableProperty height="0" width="1410" visible="true"> <property name="Materials Percent Mass Actual" /> <elementTags fieldData="<fieldData name="Act. Mass/Mass" />" /> </tableProperty> <tableProperty height="0" width="1905" visible="true"> <property name="Materials Mass/Vol" /> <elementTags fieldData="<fieldData name="Mass/Vol" />" /> </tableProperty> <tableProperty height="0" width="960" visible="true"> <property name="Materials CAS" /> <elementTags fieldData="<fieldData name="CAS" />" /> </tableProperty> <tableProperty height="0" width="1635" visible="true"> <property name="Materials Material Mass/Vol" /> <elementTags fieldData="<fieldData name="Material Mass/Vol" />" /> </tableProperty> <tableProperty height="0" width="2115" visible="true"> <property name="Materials Percent Mass of Total Actual" /> <elementTags fieldData="<fieldData name="Percent Mass of Total Act." />" /> </tableProperty> <tableProperty height="0" width="1425" visible="true"> <property name="Materials Material Molarity" /> <elementTags fieldData="<fieldData name="Material Molarity" />" /> </tableProperty> <tableProperty height="0" width="1605" visible="true"> <property name="Materials Vol/Vol" /> <elementTags fieldData="<fieldData name="Vol/Vol" />" /> </tableProperty> <tableProperty height="0" width="1230" visible="true"> <property name="Acute Toxicity" /> <elementTags fieldData="<fieldData name="Acute Toxicity" />" /> </tableProperty> <tableProperty height="0" width="1305" visible="true"> <property name="Carcinogenicity" /> <elementTags fieldData="<fieldData name="Carcinogenicity" />" /> </tableProperty> <tableProperty height="0" width="1035" visible="true"> <property name="Eye Effects" /> <elementTags fieldData="<fieldData name="Eye Effects" />" /> </tableProperty> <tableProperty height="0" width="1035" visible="true"> <property name="Materials On COSSH" /> <elementTags fieldData="<fieldData name="On COSSH" />" /> </tableProperty> <tableProperty height="0" width="1230" visible="true"> <property name="Physical State" /> <elementTags fieldData="<fieldData name="Physical State" />" /> </tableProperty> <tableProperty height="0" width="975" visible="true"> <property name="Sensitizers" /> <elementTags fieldData="<fieldData name="Sensitizers" />" /> </tableProperty> <tableProperty height="0" width="1245" visible="true"> <property name="Skin Corrosion" /> <elementTags fieldData="<fieldData name="Skin Corrosion" />" /> </tableProperty> <tableProperty height="0" width="1890" visible="true"> <property name="TOST: Single Exposure" /> <elementTags fieldData="<fieldData name="TOST: Single Exposure" />" /> </tableProperty> <tableProperty height="0" width="1230" visible="true"> <property name="TOST : Repeated Exposure" /> <elementTags fieldData="<fieldData name="TOST : Repeated Exposure" />" /> </tableProperty> <tableProperty height="0" width="0" visible="true"> <property name="Toxicity Levels" /> <elementTags fieldData="<fieldData name="Toxicity Levels" />" /> </tableProperty> <tableRow height="330" width="0"> <tableCell /> <tableCell value="X0171650001" foreColor="-16776961" tag="entered" /> <tableCell value="1" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell value="80.0000 g/kg" minValue="0.08" maxValue="0.08" /> <tableCell value="1" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="100.0000 %" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="8.0000 %" minValue="0.08" maxValue="0.08" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="1" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="8.0000 % w/w" minValue="0.08" maxValue="0.08" /> <tableCell value="8.0000 %" minValue="0.08" maxValue="0.08" /> <tableCell value="8.0000 %" minValue="0.08" maxValue="0.08" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="16 g" minValue="0.016" maxValue="0.016" foreColor="-16776961" tag="entered" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> </tableRow> <tableRow height="330" width="0"> <tableCell /> <tableCell value="SPECTRASYNELITE1" foreColor="-16776961" tag="entered" /> <tableCell value="1" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell value="306.0000 g/kg" minValue="0.306" maxValue="0.306" /> <tableCell value="2" minValue="2" maxValue="2" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="100.0000 %" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="30.6000 %" minValue="0.306" maxValue="0.306" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="2" minValue="2" maxValue="2" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="30.6000 % w/w" minValue="0.306" maxValue="0.306" /> <tableCell value="30.6000 %" minValue="0.306" maxValue="0.306" /> <tableCell value="30.6000 %" minValue="0.306" maxValue="0.306" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="61.2 g" minValue="0.0612" maxValue="0.0612" foreColor="-16776961" tag="entered" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> </tableRow> </tableSection> </object> */ XElement rootElement = new XElement("tableSection"); int ingredientCount = 0; foreach (Ingredient ingredient in formulation.Ingredients.Where(w => w.BlendID == null)) { ++ingredientCount; XElement tableRowElement = new XElement("tableRow", new XAttribute("height", "330"), new XAttribute("width", "0")); tableRowElement.Add(new XElement("tableCell")); // Lot Container Pair if (ingredient.ProductName == null) tableRowElement.Add(new XElement("tableCell")); // Name else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.ProductName))); // Name tableRowElement.Add(new XElement("tableCell", new XAttribute("value", "1"), new XAttribute("minValue", "1"), new XAttribute("maxValue", "1"))); // Materials Step if (ingredient.AdditionOrder == null) tableRowElement.Add(new XElement("tableCell")); // Addition Order else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.AdditionOrder))); // Addition Order tableRowElement.Add(new XElement("tableCell")); // Materials Percent Volume of Total tableRowElement.Add(new XElement("tableCell")); // Materials wt/wt of Total tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredientCount), new XAttribute("minValue", ingredientCount), new XAttribute("maxValue", ingredientCount))); // Materials Stage Number if (ingredient.SafetyCode1 == null) tableRowElement.Add(new XElement("tableCell")); // Safety Code 1 else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.SafetyCode1))); // Safety Code 1 if (ingredient.SafetyCode2 == null) tableRowElement.Add(new XElement("tableCell")); // Safety Code 2 else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.SafetyCode2))); // Safety Code 2 tableRowElement.Add(new XElement("tableCell")); // Container Updated tableRowElement.Add(new XElement("tableCell")); // Materials Nitrogen Content tableRowElement.Add(new XElement("tableCell")); // Materials Nitrogen Contribution tableRowElement.Add(new XElement("tableCell")); // Materials Safety Code 1 (Not used) tableRowElement.Add(new XElement("tableCell")); // Materials Safety Code 2 (Not used) tableRowElement.Add(new XElement("tableCell")); // Materials Phosphorus Content tableRowElement.Add(new XElement("tableCell")); // Materials Purity if (ingredient.InventoryContainerID == null) tableRowElement.Add(new XElement("tableCell")); // Materials Container ID else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.InventoryContainerID))); // Materials Container ID tableRowElement.Add(new XElement("tableCell")); // Materials Phosphorus Contribution tableRowElement.Add(new XElement("tableCell")); // Materials Sulfur Content if (ingredient.InventoryLotID == null) tableRowElement.Add(new XElement("tableCell")); // Materials Lot ID else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.InventoryLotID))); // Materials Lot ID if (ingredient.InventoryContainerID == null) tableRowElement.Add(new XElement("tableCell")); // Materials Container Number else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.InventoryContainerID))); // Materials Container Number tableRowElement.Add(new XElement("tableCell")); // Materials Sulfur Contribution tableRowElement.Add(new XElement("tableCell")); // Materials Designed Treat Rate if (ingredient.TreatRate == null) tableRowElement.Add(new XElement("tableCell")); // Materials Treat Rate else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.TreatRate + " %"), new XAttribute("minValue", ingredient.TreatRate / 100.0), new XAttribute("maxValue", ingredient.TreatRate / 100.0))); // Materials Treat Rate tableRowElement.Add(new XElement("tableCell")); // Materials Base Oil Group if (ingredient.MSDS == null) tableRowElement.Add(new XElement("tableCell")); // MSDS else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.MSDS))); // MSDS tableRowElement.Add(new XElement("tableCell")); // Materials Molecular Weight tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredientCount), new XAttribute("minValue", ingredientCount), new XAttribute("maxValue", ingredientCount))); // Material ID tableRowElement.Add(new XElement("tableCell")); // Materials Fluid Code tableRowElement.Add(new XElement("tableCell")); // Materials FC Mod tableRowElement.Add(new XElement("tableCell")); // Materials FC Number tableRowElement.Add(new XElement("tableCell")); // Materials FC Prefix tableRowElement.Add(new XElement("tableCell")); // Materials FC Rev tableRowElement.Add(new XElement("tableCell")); // Materials Status tableRowElement.Add(new XElement("tableCell")); // Materials Expiration Date tableRowElement.Add(new XElement("tableCell")); // Materials X-Number Alias if (ingredient.Flammability == null) tableRowElement.Add(new XElement("tableCell")); // HMIS_F else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Flammability))); // HMIS_F if (ingredient.Health == null) tableRowElement.Add(new XElement("tableCell")); // HMIS_H else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Health))); // HMIS_H if (ingredient.Manufacturer == null) tableRowElement.Add(new XElement("tableCell")); // Manufacturer else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Manufacturer))); // Manufacturer if (ingredient.OnTSCA == null) tableRowElement.Add(new XElement("tableCell")); // OnTSCA else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.OnTSCA))); // OnTSCA tableRowElement.Add(new XElement("tableCell")); // Materials Research Aliases if (ingredient.ShelfLifeInDays == null) tableRowElement.Add(new XElement("tableCell")); // Material Shelf Life else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.ShelfLifeInDays))); // Material Shelf Life tableRowElement.Add(new XElement("tableCell")); // Materials Master Lot? tableRowElement.Add(new XElement("tableCell")); // Materials Material Type if (ingredient.ProtectiveEquipment == null) tableRowElement.Add(new XElement("tableCell")); // HMIS_PE else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.ProtectiveEquipment))); // HMIS_PE if (ingredient.Reactivity == null) tableRowElement.Add(new XElement("tableCell")); // HMIS_R else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Reactivity))); // HMIS_R tableRowElement.Add(new XElement("tableCell")); // Materials Genre tableRowElement.Add(new XElement("tableCell")); // Materials HiTEC Alias tableRowElement.Add(new XElement("tableCell")); // Materials Formula if (ingredient.InventoryLotNumber == null) tableRowElement.Add(new XElement("tableCell")); // Lot # else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.InventoryLotNumber))); // Lot # tableRowElement.Add(new XElement("tableCell")); // Materials Flash Point if (ingredient.Notes == null) tableRowElement.Add(new XElement("tableCell")); // Materials Description else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Notes))); // Materials Description tableRowElement.Add(new XElement("tableCell")); // Materials Champion tableRowElement.Add(new XElement("tableCell")); // Materials HS&E Caution tableRowElement.Add(new XElement("tableCell")); // Materials Toxicology tableRowElement.Add(new XElement("tableCell")); // Materials Role tableRowElement.Add(new XElement("tableCell")); // Chemical Structure if (ingredient.Density == null) tableRowElement.Add(new XElement("tableCell")); // Materials Density else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Density))); // Materials Density tableRowElement.Add(new XElement("tableCell")); // Materials Percent Active tableRowElement.Add(new XElement("tableCell")); // Materials Cost/Mass tableRowElement.Add(new XElement("tableCell")); // Materials Cost/Amount tableRowElement.Add(new XElement("tableCell")); // Materials Percent Mass tableRowElement.Add(new XElement("tableCell")); // Materials Percent Mass of Total tableRowElement.Add(new XElement("tableCell")); // Materials Percent Mass Total Material tableRowElement.Add(new XElement("tableCell")); // Materials Batch Mass Planned tableRowElement.Add(new XElement("tableCell")); // Materials Unit Volume Planned tableRowElement.Add(new XElement("tableCell")); // Materials Inventory ID if (ingredient.Mass == null) tableRowElement.Add(new XElement("tableCell")); // Materials Unit Mass Planned else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Mass + " g"), new XAttribute("minValue", ingredient.Mass / 1000.0), new XAttribute("maxValue", ingredient.Mass / 1000.0))); // Materials Unit Mass Planned if (ingredient.Supplier == null) tableRowElement.Add(new XElement("tableCell")); // Supplier else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.Supplier))); // Supplier tableRowElement.Add(new XElement("tableCell")); // Materials Batch Volume Planned tableRowElement.Add(new XElement("tableCell")); // Materials Formula Mass tableRowElement.Add(new XElement("tableCell")); // Materials Molarity tableRowElement.Add(new XElement("tableCell")); // Materials Batch Mass Actual tableRowElement.Add(new XElement("tableCell")); // Materials Batch Mass Actual Active tableRowElement.Add(new XElement("tableCell")); // Materials Batch Volume Actual tableRowElement.Add(new XElement("tableCell")); // Materials Percent Mass Actual tableRowElement.Add(new XElement("tableCell")); // Materials Mass/Vol tableRowElement.Add(new XElement("tableCell")); // Materials CAS tableRowElement.Add(new XElement("tableCell")); // Materials Material Mass/Vol tableRowElement.Add(new XElement("tableCell")); // Materials Percent Mass of Total Actual tableRowElement.Add(new XElement("tableCell")); // Materials Material Molarity tableRowElement.Add(new XElement("tableCell")); // Materials Vol/Vol tableRowElement.Add(new XElement("tableCell")); // Acute Toxicity tableRowElement.Add(new XElement("tableCell")); // Carcinogenicity tableRowElement.Add(new XElement("tableCell")); // Eye Effects if (ingredient.OnCOSSH == null) tableRowElement.Add(new XElement("tableCell")); // Materials On COSSH else tableRowElement.Add(new XElement("tableCell", new XAttribute("value", ingredient.OnCOSSH))); // Materials On COSSH tableRowElement.Add(new XElement("tableCell")); // Physical State tableRowElement.Add(new XElement("tableCell")); // Sensitizers tableRowElement.Add(new XElement("tableCell")); // Skin Corrosion tableRowElement.Add(new XElement("tableCell")); // TOST: Single Exposure tableRowElement.Add(new XElement("tableCell")); // TOST : Repeated Exposure tableRowElement.Add(new XElement("tableCell")); // Toxicity Levels rootElement.Add(tableRowElement); } return rootElement.Descendants("tableRow"); }
private XDocument GetFormulationDocument(Formulation formulation) { XDocument formulationDocument = new XDocument(_formulationDocumentTemplate); formulationDocument.Root.Attribute("name").Value = formulation.MaterialName; var metadata1Element = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section").Elements("object").Elements("field") where e1.Attribute("name").Value == "Metadata1" select e1; var metadata2Element = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section").Elements("object").Elements("field") where e1.Attribute("name").Value == "Metadata2" select e1; var descriptionElement = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section").Elements("object").Elements("field") where e1.Attribute("name").Value == "Description" select e1; var healthAndSafetyElement = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section") where e1.Attribute("name").Value == "Environmental Health & Safety" select e1; var formulationMaterialsStepTableRowElement = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section").Elements("object").Elements("tableSection").Elements("tableRow") where e1.Parent.ElementsBeforeSelf("field").First().Attribute("name").Value == "Steps" select e1; var formulationMaterialsTableRowElement = from e1 in formulationDocument.Root.Elements("sectionSetView").Elements("section").Elements("object").Elements("tableSection") where e1.ElementsBeforeSelf("field").First().Attribute("name").Value == "Materials" select e1; formulationMaterialsTableRowElement.First().Attribute("rowCount").Value = formulation.Ingredients.Count.ToString(); XElement formulationMetadata1XML = XMLTools.GetFormulationMetadata1XML(formulation); XElement formulationMetadata2XML = XMLTools.GetFormulationMetadata2XML(formulation); XElement formulationDescriptionXML = XMLTools.GetFormulationDescriptionXML(formulation); IEnumerable<XElement> healthAndSafetyXMLElements = XMLTools.GetFormulationHealthAndSafetyXML(formulation); IEnumerable<XElement> formulationMaterialsStepXML = XMLTools.GetFormulationMaterialsStepXML(formulation); IEnumerable<XElement> formulationMaterialsXML = XMLTools.GetFormulationMaterialsXML(formulation); metadata1Element.First().Parent.Add(formulationMetadata1XML); metadata2Element.First().Parent.Add(formulationMetadata2XML); descriptionElement.First().Parent.Add(formulationDescriptionXML); foreach (XElement element in healthAndSafetyXMLElements) { healthAndSafetyElement.First().Add(element); } foreach (XElement element in formulationMaterialsStepXML) { formulationMaterialsStepTableRowElement.First().Add(element); } foreach (XElement element in formulationMaterialsXML) { formulationMaterialsTableRowElement.First().Add(element); } return formulationDocument; }
public static IEnumerable<XElement> GetFormulationHealthAndSafetyXML(Formulation formulation) { XElement rootElement = new XElement("root"); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "Health Cautions")), new XElement("propertyInstances", GetPropertyInstance("CoA", "CoA PLACEHOLDER"), GetPropertyInstance("Health Caution", formulation.HealthCaution), GetPropertyInstance("MSDS", formulation.MSDS)))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "Comment")), new XElement("styledText", new XElement("data"), new XElement("text")))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "Global")), new XElement("propertyInstances", GetPropertyInstance("Acute Toxicity", ""), GetPropertyInstance("Carcinogenicity", ""), GetPropertyInstance("Eye Effects", ""), GetPropertyInstance("Physical State", ""), GetPropertyInstance("Sensitizers", ""), GetPropertyInstance("Skin Corrosion", ""), GetPropertyInstance("TOST: Single Exposure", ""), GetPropertyInstance("TOST: Repeated Exposure", ""), GetPropertyInstance("Toxicity Levels", "")))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "HMIS")), new XElement("propertyInstances", GetPropertyInstance("Flammability", formulation.Flammability), GetPropertyInstance("Health", formulation.Health), GetPropertyInstance("On TSCA", formulation.OnTSCA), GetPropertyInstance("Personal Protective Equipment", formulation.ProtectiveEquipment), GetPropertyInstance("Reactivity", formulation.Reactivity)))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "England (COSHH)")), new XElement("propertyInstances", GetPropertyInstance("On COSSH", (formulation.OnCOSSH != null && (bool)formulation.OnCOSSH ? "Y" : "N")), GetPropertyInstance("Safety Code 1", formulation.Bracknell1), GetPropertyInstance("Safety Code 2", formulation.Bracknell2)))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "Asia (METI)")), new XElement("propertyInstances", GetPropertyInstance("Flammibility Codes", formulation.MITI_F), GetPropertyInstance("Corrosivity Codes", formulation.MITI_C)))); rootElement.Add(new XElement("object", new XElement("field", new XAttribute("name", "Additional Health Cautions")), new XElement("propertyInstances", GetPropertyInstance("Health Caution Additional", ""), GetPropertyInstance("Health Caution Additional", ""), GetPropertyInstance("Health Caution Additional", ""), GetPropertyInstance("MSDS Additional", "")))); return rootElement.Descendants("object"); }
public static IEnumerable<XElement> GetFormulationMaterialsStepXML(Formulation formulation) { /* <object> <field name="Steps" /> <tableSection pivotType="1" propertyCount="21" rowCount="1"> <elementTags layout="<XtraSerializer version="1.0" application="View"><property name="#LayoutVersion" /><property name="ActiveFilterEnabled">true</property><property name="Columns" iskey="true" value="20"><property name="Item1" isnull="true" iskey="true"><property name="VisibleIndex">0</property><property name="Visible">true</property><property name="Name">colColumn1</property></property><property name="Item2" isnull="true" iskey="true"><property name="VisibleIndex">1</property><property name="Visible">true</property><property name="Name">colColumn2</property></property><property name="Item3" isnull="true" iskey="true"><property name="VisibleIndex">2</property><property name="Visible">true</property><property name="Name">colColumn3</property></property><property name="Item4" isnull="true" iskey="true"><property name="VisibleIndex">3</property><property name="Visible">true</property><property name="Name">colColumn4</property></property><property name="Item5" isnull="true" iskey="true"><property name="VisibleIndex">4</property><property name="Visible">true</property><property name="Name">colColumn5</property></property><property name="Item6" isnull="true" iskey="true"><property name="VisibleIndex">5</property><property name="Visible">true</property><property name="Name">colColumn6</property></property><property name="Item7" isnull="true" iskey="true"><property name="VisibleIndex">6</property><property name="Visible">true</property><property name="Name">colColumn7</property></property><property name="Item8" isnull="true" iskey="true"><property name="VisibleIndex">7</property><property name="Visible">true</property><property name="Width">86</property><property name="Name">colColumn8</property></property><property name="Item9" isnull="true" iskey="true"><property name="VisibleIndex">8</property><property name="Visible">true</property><property name="Name">colColumn9</property></property><property name="Item10" isnull="true" iskey="true"><property name="VisibleIndex">9</property><property name="Visible">true</property><property name="Name">colColumn10</property></property><property name="Item11" isnull="true" iskey="true"><property name="VisibleIndex">10</property><property name="Visible">true</property><property name="Name">colColumn11</property></property><property name="Item12" isnull="true" iskey="true"><property name="VisibleIndex">11</property><property name="Visible">true</property><property name="Name">colColumn12</property></property><property name="Item13" isnull="true" iskey="true"><property name="VisibleIndex">12</property><property name="Visible">true</property><property name="Name">colColumn13</property></property><property name="Item14" isnull="true" iskey="true"><property name="VisibleIndex">13</property><property name="Visible">true</property><property name="Name">colColumn14</property></property><property name="Item15" isnull="true" iskey="true"><property name="VisibleIndex">14</property><property name="Visible">true</property><property name="Name">colColumn15</property></property><property name="Item16" isnull="true" iskey="true"><property name="VisibleIndex">15</property><property name="Visible">true</property><property name="Name">colColumn16</property></property><property name="Item17" isnull="true" iskey="true"><property name="VisibleIndex">16</property><property name="Visible">true</property><property name="Name">colColumn17</property></property><property name="Item18" isnull="true" iskey="true"><property name="VisibleIndex">17</property><property name="Visible">true</property><property name="Name">colColumn18</property></property><property name="Item19" isnull="true" iskey="true"><property name="VisibleIndex">18</property><property name="Visible">true</property><property name="Name">colColumn19</property></property><property name="Item20" isnull="true" iskey="true"><property name="VisibleIndex">19</property><property name="Visible">true</property><property name="Width">36</property><property name="Name">colColumn20</property></property></property><property name="OptionsView" isnull="true" iskey="true"><property name="ShowGroupPanel">false</property><property name="EnableAppearanceOddRow">true</property><property name="EnableAppearanceEvenRow">true</property><property name="ColumnAutoWidth">false</property><property name="NewItemRowPosition">Bottom</property><property name="RowAutoHeight">true</property></property><property name="ActiveFilterString" /><property name="GroupSummarySortInfoState" /></XtraSerializer>" options="<options />" /> <tableProperty height="0" width="555" visible="true"> <property name="Steps Step" /> <elementTags fieldData="<fieldData name="Steps Step" keyField="True" />" /> </tableProperty> <tableProperty height="0" width="570" visible="true"> <property name="Steps UCID" /> </tableProperty> <tableProperty height="0" width="645" visible="true"> <property name="Name" /> <elementTags fieldData="<fieldData name="Name" />" /> </tableProperty> <tableProperty height="0" width="1425" visible="true"> <property name="Steps Total Phosphorus" /> </tableProperty> <tableProperty height="0" width="990" visible="true"> <property name="Steps Total Sulfur" /> </tableProperty> <tableProperty height="0" width="1680" visible="true"> <property name="Steps Description" /> <elementTags fieldData="<fieldData name="Description" />" /> </tableProperty> <tableProperty height="0" width="945" visible="true"> <property name="Steps Treat Rate" /> </tableProperty> <tableProperty height="0" width="1125" visible="true"> <property name="Steps Temperature" /> </tableProperty> <tableProperty height="0" width="1185" visible="true"> <property name="Steps Total Nitrogen" /> </tableProperty> <tableProperty height="0" width="540" visible="true"> <property name="Steps Cost" /> </tableProperty> <tableProperty height="0" width="885" visible="true"> <property name="Steps Mass Ratio" /> </tableProperty> <tableProperty height="0" width="1170" visible="true"> <property name="Steps Volume Ratio" /> </tableProperty> <tableProperty height="0" width="1815" visible="true"> <property name="Steps Unit Mass Planned" /> </tableProperty> <tableProperty height="0" width="735" visible="true"> <property name="Steps Primary" /> </tableProperty> <tableProperty height="0" width="1575" visible="true"> <property name="Steps Unit Volume Planned" /> </tableProperty> <tableProperty height="0" width="1935" visible="true"> <property name="Steps Batch Mass Planned" /> <elementTags fieldData="<fieldData name="Batch Mass Planned" />" /> </tableProperty> <tableProperty height="0" width="1920" visible="true"> <property name="Steps Batch Mass Actual" /> <elementTags fieldData="<fieldData name="Batch Mass Act." />" /> </tableProperty> <tableProperty height="0" width="1620" visible="true"> <property name="Steps Batch Volume Planned" /> <elementTags fieldData="<fieldData name="Batch Vol Planned" />" /> </tableProperty> <tableProperty height="0" width="1620" visible="true"> <property name="Steps Batch Volume Actual" /> <elementTags fieldData="<fieldData name="Batch Vol Act." />" /> </tableProperty> <tableProperty height="0" width="1530" visible="true"> <property name="Steps Percent Mass of Total" /> <elementTags fieldData="<fieldData name="% w/w of Total" />" /> </tableProperty> <tableProperty height="0" width="0" visible="true"> <property name="Steps pH" /> </tableProperty> <tableRow height="330" width="0"> <tableCell value="1" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="100.0000 %" minValue="1" maxValue="1" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="100.0000 %" minValue="1" maxValue="1" /> <tableCell /> <tableCell value="200 g" minValue="0.2" maxValue="0.2" foreColor="-16776961" tag="entered" /> <tableCell /> <tableCell /> <tableCell value="0.0000 µg" minValue="0" maxValue="0" /> <tableCell /> <tableCell /> <tableCell /> <tableCell value="100.0000 % w/w" minValue="1" maxValue="1" /> <tableCell /> </tableRow> </tableSection> </object> */ XElement rootElement = new XElement("tableRow"); rootElement.Add(new XElement("tableCell", new XAttribute("value", "1"), new XAttribute("minValue", "1"), new XAttribute("maxValue", "1"))); // Steps Step rootElement.Add(new XElement("tableCell")); // Steps UCID rootElement.Add(new XElement("tableCell")); // Name rootElement.Add(new XElement("tableCell")); // Steps Total Phosphorus rootElement.Add(new XElement("tableCell")); // Steps Total Sulfur rootElement.Add(new XElement("tableCell")); // Steps Description rootElement.Add(new XElement("tableCell", new XAttribute("value", formulation.FinishedFluidTreatRate + " %"), new XAttribute("minValue", formulation.FinishedFluidTreatRate / 100.0), new XAttribute("maxValue", formulation.FinishedFluidTreatRate / 100.0))); // Steps Treat Rate rootElement.Add(new XElement("tableCell")); // Steps Temperature rootElement.Add(new XElement("tableCell")); // Steps Total Nitrogen rootElement.Add(new XElement("tableCell")); // Steps Cost rootElement.Add(new XElement("tableCell")); // Steps Mass Ratio rootElement.Add(new XElement("tableCell")); // Steps Volume Ratio rootElement.Add(new XElement("tableCell", new XAttribute("value", formulation.StepMass + " " + formulation.Unit.ToLower()), new XAttribute("minValue", formulation.StepMass / 1000.0), new XAttribute("maxValue", formulation.StepMass / 1000.0), new XAttribute("foreColor", "-16776961"), new XAttribute("tag", "entered"))); // Steps Unit Mass Planned rootElement.Add(new XElement("tableCell")); // Steps Primary rootElement.Add(new XElement("tableCell")); // Steps Unit Volume Planned rootElement.Add(new XElement("tableCell")); // Steps Batch Mass Planned rootElement.Add(new XElement("tableCell")); // Steps Batch Mass Actual rootElement.Add(new XElement("tableCell")); // Steps Batch Volume Planned rootElement.Add(new XElement("tableCell")); // Steps Batch Volume Actual rootElement.Add(new XElement("tableCell")); // Steps Percent Mass of Total rootElement.Add(new XElement("tableCell")); // Steps pH return rootElement.Descendants("tableCell"); }
public static XElement GetFormulationDescriptionXML(Formulation formulation) { XElement rootElement = new XElement("styledText"); if (formulation != null) { rootElement.Add(new XElement("data", formulation.Description), new XElement("text", formulation.Description)); } return rootElement; }
public static XElement GetFormulationMetadata2XML(Formulation formulation) { XElement rootElement = new XElement("propertyInstances"); rootElement.Add(GetPropertyInstance("Product Line", formulation.ProductLine)); rootElement.Add(GetPropertyInstance("Product Name", formulation.ProductName1)); rootElement.Add(GetPropertyInstance("Product Type", formulation.ProductType)); rootElement.Add(GetPropertyInstance("Shelf Life (Months)", formulation.ShelfLife.ToString())); rootElement.Add(GetPropertyInstance("Expiration Date", "EXPIRATION DATE PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Formulation Code", "FORMULATION CODE PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Material Code", formulation.MaterialName)); rootElement.Add(GetPropertyInstance("Created by", formulation.CreatedBy)); rootElement.Add(GetPropertyInstance("Date Created", formulation.DateCreated.ToString())); rootElement.Add(GetPropertyInstance("Modified By", formulation.ModifiedBy)); rootElement.Add(GetPropertyInstance("Date Modified", formulation.DateModified.ToString())); rootElement.Add(GetPropertyInstance("Actual Blend Date", "ACTUAL BLEND DATE PLACEHOLDER - PROBABLY NOT NEEDED")); rootElement.Add(GetPropertyInstance("Blend Device", "BLEND DEVICE PLACEHOLDER - PROBABLY NOT NEEDED")); rootElement.Add(GetPropertyInstance("Blended By ", "BLENDED BY PLACEHOLDER - PROBABLY NOT NEEDED")); rootElement.Add(GetPropertyInstance("Viscosity Grade", formulation.ViscosityGrade)); rootElement.Add(GetPropertyInstance("Date Required", "DATE REQUIRED PLACEHOLDER - PROBABLY NOT NEEDED")); rootElement.Add(GetPropertyInstance("Pitch Date", formulation.PitchDate.ToString())); return rootElement; }
public static XElement GetFormulationMetadata1XML(Formulation formulation) { XElement rootElement = new XElement("propertyInstances"); rootElement.Add(GetPropertyInstance("Experiment Title", formulation.MaterialName)); rootElement.Add(GetPropertyInstance("Research Name", formulation.MaterialName)); rootElement.Add(GetPropertyInstance("Department", "DEPARTMENT PLACEHOLDER")); rootElement.Add(GetPropertyInstance("SBU", "SBU PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Cost Center", formulation.CostCenter)); rootElement.Add(GetPropertyInstance("Site", formulation.RequestersSite)); rootElement.Add(GetPropertyInstance("User Full Name", "USER FULL NAME PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Requested For", formulation.RequestedBy)); rootElement.Add(GetPropertyInstance("Project Number", formulation.ProjectNumber)); rootElement.Add(GetPropertyInstance("Project Name", "PROJECT NAME PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Subproject Number", formulation.SubprojectNumber)); rootElement.Add(GetPropertyInstance("Experiment Keyword", "EXPERIMENT KEYWORD PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Comment", formulation.Comments)); rootElement.Add(GetPropertyInstance("Supervisor", "SUPERVISOR PLACEHOLDER")); rootElement.Add(GetPropertyInstance("Customer", formulation.Customer)); return rootElement; }
/// <summary> /// Create a new Formulation object. /// </summary> /// <param name="formulationID">Initial value of the FormulationID property.</param> /// <param name="requestCode">Initial value of the RequestCode property.</param> /// <param name="formulationStatusID">Initial value of the FormulationStatusID property.</param> public static Formulation CreateFormulation(global::System.Int32 formulationID, global::System.String requestCode, global::System.Int32 formulationStatusID) { Formulation formulation = new Formulation(); formulation.FormulationID = formulationID; formulation.RequestCode = requestCode; formulation.FormulationStatusID = formulationStatusID; return formulation; }
/// <summary> /// Deprecated Method for adding a new object to the Formulations EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFormulations(Formulation formulation) { base.AddObject("Formulations", formulation); }