示例#1
0
        internal static BoardMeetingEntry Load(XmlNode node)
        {
            BoardMeetingEntry result = null;

            if (node != null && node.Name.Equals("boardmeeting"))
            {
                result = new BoardMeetingEntry();
                String url = TambonHelper.GetAttributeOptionalString(node, "url");
                if (!String.IsNullOrEmpty(url))
                {
                    result.WebLink = new Uri(url);
                }
                result.Date          = TambonHelper.GetAttributeDateTime(node, "date");
                result.BoardNumber   = TambonHelper.GetAttribute(node, "board");
                result.MeetingNumber = Convert.ToInt32(TambonHelper.GetAttribute(node, "number"));

                result.LoadContents(node);
            }

            return(result);
        }
示例#2
0
        internal static RoyalGazette Load(XmlNode iNode)
        {
            RoyalGazette RetVal = null;

            if (iNode != null && iNode.Name.Equals("entry"))
            {
                RetVal             = new RoyalGazette();
                RetVal.Description = TambonHelper.GetAttributeOptionalString(iNode, "description");
                RetVal.URI         = TambonHelper.GetAttribute(iNode, "uri");
                RetVal.Title       = TambonHelper.GetAttribute(iNode, "title");
                RetVal.SubTitle    = TambonHelper.GetAttributeOptionalString(iNode, "subtitle");
                RetVal.Volume      = Convert.ToInt32(TambonHelper.GetAttribute(iNode, "volume"));
                RetVal.Issue       = new RoyalGazetteIssue(TambonHelper.GetAttribute(iNode, "issue"));
                RetVal.PageInfo    = new RoyalGazettePageinfo(TambonHelper.GetAttribute(iNode, "page"));
                Int32 lPageEnd = TambonHelper.GetAttributeOptionalInt(iNode, "pageend", 0);
                if (lPageEnd != 0)
                {
                    RetVal.PageInfo.PageEnd = lPageEnd;
                }
                RetVal.Sign        = TambonHelper.GetAttributeOptionalDateTime(iNode, "sign");
                RetVal.Effective   = TambonHelper.GetAttributeOptionalDateTime(iNode, "effective");
                RetVal.Publication = TambonHelper.GetAttributeDateTime(iNode, "publication");
                RetVal.SignedBy    = TambonHelper.GetAttributeOptionalString(iNode, "signedby");
                String s = TambonHelper.GetAttributeOptionalString(iNode, "signedbyfunction");
                if (!String.IsNullOrEmpty(s))
                {
                    RetVal.SignedByPosition = (GazetteSignPosition)Enum.Parse(typeof(GazetteSignPosition), s);
                }
                Int32 lEffectiveRelative = TambonHelper.GetAttributeOptionalInt(iNode, "effectiveafter", -1);
                if (lEffectiveRelative >= 0)
                {
                    RetVal.Effective = RetVal.Publication.AddDays(lEffectiveRelative);
                }
                RetVal.LoadContents(iNode);
            }

            return(RetVal);
        }