Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Team()
 {
     this.teamIdField      = 0;
     this.teamNameField    = string.Empty;
     this.specialistsField = new Specialists();
     this.youthSquadField  = new YouthSquad();
 }
        private YouthSquad ParseYouthSquadNode(XmlNode youthSquadNode)
        {
            try
            {
                YouthSquad youthSquad = new YouthSquad();

                foreach (XmlNode xmlNode in youthSquadNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                        case Tags.Investment:
                            youthSquad.investmentField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                            break;
                        case Tags.HasPromoted:
                            youthSquad.hasPromotedField = GenericFunctions.ConvertStringToBool(xmlNode.InnerText);
                            break;
                        case Tags.YouthLevel:
                            youthSquad.youthLevelField = GenericFunctions.ConvertStringToByte(xmlNode.InnerText);
                            break;
                    }
                }

                return youthSquad;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }