Example #1
0
        public OilProduct(XmlNode xmlNode)
        {
            XmlNodeList typeNodeList = xmlNode.SelectNodes("type");

            if (typeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in typeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        typeIDRef = item.Attributes["id"].Name;
                        OilProductType ob = OilProductType();
                        IDManager.SetID(typeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        typeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        type = new OilProductType(item);
                    }
                }
            }


            XmlNodeList gradeNodeList = xmlNode.SelectNodes("grade");

            if (gradeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in gradeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        gradeIDRef = item.Attributes["id"].Name;
                        CommodityProductGrade ob = CommodityProductGrade();
                        IDManager.SetID(gradeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        gradeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        grade = new CommodityProductGrade(item);
                    }
                }
            }
        }
 public OilProduct(XmlNode xmlNode)
 {
     XmlNode typeNode = xmlNode.SelectSingleNode("type");
     
     if (typeNode != null)
     {
         if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null) 
         {
             if (typeNode.Attributes["id"] != null) 
             {
                 typeIDRef_ = typeNode.Attributes["id"].Value;
                 OilProductType ob = new OilProductType(typeNode);
                 IDManager.SetID(typeIDRef_, ob);
             }
             else if (typeNode.Attributes["href"] != null)
             {
                 typeIDRef_ = typeNode.Attributes["href"].Value;
             }
             else
             {
                 type_ = new OilProductType(typeNode);
             }
         }
         else
         {
             type_ = new OilProductType(typeNode);
         }
     }
     
 
     XmlNode gradeNode = xmlNode.SelectSingleNode("grade");
     
     if (gradeNode != null)
     {
         if (gradeNode.Attributes["href"] != null || gradeNode.Attributes["id"] != null) 
         {
             if (gradeNode.Attributes["id"] != null) 
             {
                 gradeIDRef_ = gradeNode.Attributes["id"].Value;
                 CommodityProductGrade ob = new CommodityProductGrade(gradeNode);
                 IDManager.SetID(gradeIDRef_, ob);
             }
             else if (gradeNode.Attributes["href"] != null)
             {
                 gradeIDRef_ = gradeNode.Attributes["href"].Value;
             }
             else
             {
                 grade_ = new CommodityProductGrade(gradeNode);
             }
         }
         else
         {
             grade_ = new CommodityProductGrade(gradeNode);
         }
     }
     
 
 }
 public OilProduct(XmlNode xmlNode)
 {
     XmlNodeList typeNodeList = xmlNode.SelectNodes("type");
     if (typeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in typeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 typeIDRef = item.Attributes["id"].Name;
                 OilProductType ob = OilProductType();
                 IDManager.SetID(typeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 typeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 type = new OilProductType(item);
             }
         }
     }
     
 
     XmlNodeList gradeNodeList = xmlNode.SelectNodes("grade");
     if (gradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in gradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 gradeIDRef = item.Attributes["id"].Name;
                 CommodityProductGrade ob = CommodityProductGrade();
                 IDManager.SetID(gradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 gradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 grade = new CommodityProductGrade(item);
             }
         }
     }
     
 
 }
Example #4
0
        public OilProduct(XmlNode xmlNode)
        {
            XmlNode typeNode = xmlNode.SelectSingleNode("type");

            if (typeNode != null)
            {
                if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null)
                {
                    if (typeNode.Attributes["id"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["id"].Value;
                        OilProductType ob = new OilProductType(typeNode);
                        IDManager.SetID(typeIDRef_, ob);
                    }
                    else if (typeNode.Attributes["href"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        type_ = new OilProductType(typeNode);
                    }
                }
                else
                {
                    type_ = new OilProductType(typeNode);
                }
            }


            XmlNode gradeNode = xmlNode.SelectSingleNode("grade");

            if (gradeNode != null)
            {
                if (gradeNode.Attributes["href"] != null || gradeNode.Attributes["id"] != null)
                {
                    if (gradeNode.Attributes["id"] != null)
                    {
                        gradeIDRef_ = gradeNode.Attributes["id"].Value;
                        CommodityProductGrade ob = new CommodityProductGrade(gradeNode);
                        IDManager.SetID(gradeIDRef_, ob);
                    }
                    else if (gradeNode.Attributes["href"] != null)
                    {
                        gradeIDRef_ = gradeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        grade_ = new CommodityProductGrade(gradeNode);
                    }
                }
                else
                {
                    grade_ = new CommodityProductGrade(gradeNode);
                }
            }
        }