Beispiel #1
0
 private void LoadContents(XmlNode iNode)
 {
     foreach (XmlNode lNode in iNode.ChildNodes)
     {
         RoyalGazetteContent lContent = RoyalGazetteContent.CreateContentObject(lNode.Name);
         if (lContent != null)
         {
             lContent.DoLoad(lNode);
             BoardMeetingTopic lTopic = new BoardMeetingTopic();
             lTopic.Topic     = lContent;
             lTopic.Effective = TambonHelper.GetAttributeOptionalDateTime(lNode, "effective");
             String s = TambonHelper.GetAttributeOptionalString(lNode, "type");
             if (String.IsNullOrEmpty(s))
             {
                 s = TambonHelper.GetAttributeOptionalString(lNode, "new");
             }
             if (!String.IsNullOrEmpty(s))
             {
                 lTopic.Type = (EntityType)Enum.Parse(typeof(EntityType), s);
             }
             lTopic.FindGazette();
             Contents.Add(lTopic);
         }
     }
 }
Beispiel #2
0
        public object Clone()
        {
            object lNewObject = Activator.CreateInstance(this.GetType());
            RoyalGazetteContent lNewContent = lNewObject as RoyalGazetteContent;

            lNewContent.DoCopy(this);
            return(lNewContent);
        }
 protected override void ProcessContent(RoyalGazetteContent iContent)
 {
     base.ProcessContent(iContent);
     RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;
     if (lCreate.Type == EntityType.KingAmphoe)
     {
         mNumberOfKingAmphoeCreations++;
     }
 }
 protected override void ProcessContent(RoyalGazetteContent iContent)
 {
     base.ProcessContent(iContent);
     RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;
     if (lCreate.Type == EntityType.KingAmphoe)
     {
         mNumberOfKingAmphoeCreations++;
     }
 }
 protected Boolean ContentFitting(RoyalGazetteContent iContent)
 {
     Boolean retval = false;
     if ( iContent is RoyalGazetteContentCreate )
     {
         RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;
         retval = EntityFitting(lCreate.Type);
     }
     return retval;
 }
Beispiel #6
0
        protected Boolean ContentFitting(RoyalGazetteContent iContent)
        {
            Boolean retval = false;

            if (iContent is RoyalGazetteContentCreate)
            {
                RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;
                retval = EntityFitting(lCreate.Type);
            }
            return(retval);
        }
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            Int32 lMubanNumber = lCreate.Geocode % 100;
            if ( lMubanNumber != lCreate.Geocode )
            {
                mHighestMubanNumber.IncrementForCount(lMubanNumber, lCreate.Geocode);
            }
            ProcessContentForName(lCreate);
        }
 protected override void DoCopy(RoyalGazetteContent other)
 {
     if (other != null)
     {
         base.DoCopy(other);
         if (other is RoyalGazetteContentAreaDefinition)
         {
             RoyalGazetteContentAreaDefinition iOtherArea = (RoyalGazetteContentAreaDefinition)other;
             NumberOfSubdivision = iOtherArea.NumberOfSubdivision;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentAreaChange)
         {
             RoyalGazetteContentAreaChange iOtherArea = (RoyalGazetteContentAreaChange)iOther;
             Area = iOtherArea.Area;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentAreaChange)
         {
             RoyalGazetteContentAreaChange iOtherArea = (RoyalGazetteContentAreaChange)iOther;
             Area = iOtherArea.Area;
         }
     }
 }
Beispiel #11
0
 protected void LoadContents(XmlNode iNode)
 {
     foreach (XmlNode lNode in iNode.ChildNodes)
     {
         RoyalGazetteContent lContent = RoyalGazetteContent.CreateContentObject(lNode.Name);
         if (lContent != null)
         {
             lContent.DoLoad(lNode);
             Content.Add(lContent);
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentConstituency)
         {
             RoyalGazetteContentConstituency iOtherConstituency = (RoyalGazetteContentConstituency)iOther;
             Type = iOtherConstituency.Type;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentConstituency)
         {
             RoyalGazetteContentConstituency iOtherConstituency = (RoyalGazetteContentConstituency)iOther;
             Type = iOtherConstituency.Type;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent other)
 {
     if ( other != null )
     {
         base.DoCopy(other);
         if ( other is RoyalGazetteContentAreaDefinition )
         {
             RoyalGazetteContentAreaDefinition iOtherArea = (RoyalGazetteContentAreaDefinition)other;
             NumberOfSubdivision = iOtherArea.NumberOfSubdivision;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent other)
 {
     if (other != null)
     {
         base.DoCopy(other);
         if (other is RoyalGazetteContentStatus)
         {
             RoyalGazetteContentStatus iOtherStatus = (RoyalGazetteContentStatus)other;
             OldStatus = iOtherStatus.OldStatus;
             NewStatus = iOtherStatus.NewStatus;
         }
     }
 }
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            Int32 lMubanNumber = lCreate.Geocode % 100;

            if (lMubanNumber != lCreate.Geocode)
            {
                mHighestMubanNumber.IncrementForCount(lMubanNumber, lCreate.Geocode);
            }
            ProcessContentForName(lCreate);
        }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentRename)
         {
             RoyalGazetteContentRename iOtherRename = (RoyalGazetteContentRename)iOther;
             OldName    = iOtherRename.OldName;
             OldEnglish = iOtherRename.OldEnglish;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentRename)
         {
             RoyalGazetteContentRename iOtherRename = (RoyalGazetteContentRename)iOther;
             OldName = iOtherRename.OldName;
             OldEnglish = iOtherRename.OldEnglish;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentReassign)
         {
             RoyalGazetteContentReassign iOtherReassign = (RoyalGazetteContentReassign)iOther;
             OldGeocode = iOtherReassign.OldGeocode;
             OldParent  = iOtherReassign.OldParent;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentCreate)
         {
             RoyalGazetteContentCreate iOtherCreate = (RoyalGazetteContentCreate)iOther;
             Type   = iOtherCreate.Type;
             Parent = iOtherCreate.Parent;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentCreate)
         {
             RoyalGazetteContentCreate iOtherCreate = (RoyalGazetteContentCreate)iOther;
             Type = iOtherCreate.Type;
             Parent = iOtherCreate.Parent;
         }
     }
 }
 protected override void DoCopy(RoyalGazetteContent other)
 {
     if (other != null)
     {
         base.DoCopy(other);
         if (other is RoyalGazetteContentStatus)
         {
             RoyalGazetteContentStatus iOtherStatus = (RoyalGazetteContentStatus)other;
             OldStatus = iOtherStatus.OldStatus;
             NewStatus = iOtherStatus.NewStatus;
         }
     }
 }
Beispiel #23
0
        protected virtual void ProcessContent(RoyalGazetteContent iContent)
        {
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            mNumberOfCreations++;

            Int32 lChangwatGeocode = lCreate.Geocode;

            while (lChangwatGeocode > 100)
            {
                lChangwatGeocode = lChangwatGeocode / 100;
            }
            mNumberOfCreationsPerChangwat[lChangwatGeocode]++;
        }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentAbolish)
         {
             RoyalGazetteContentAbolish iOtherAbolish = (RoyalGazetteContentAbolish)iOther;
             Status = iOtherAbolish.Status;
             NewParent = iOtherAbolish.NewParent;
             Name = iOtherAbolish.Name;
             English = iOtherAbolish.English;
         }
     }
 }
Beispiel #25
0
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentAbolish)
         {
             RoyalGazetteContentAbolish iOtherAbolish = (RoyalGazetteContentAbolish)iOther;
             Status    = iOtherAbolish.Status;
             NewParent = iOtherAbolish.NewParent;
             Name      = iOtherAbolish.Name;
             English   = iOtherAbolish.English;
         }
     }
 }
Beispiel #26
0
 protected virtual void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         Geocode       = iOther.Geocode;
         TambonGeocode = iOther.TambonGeocode;
         Owner         = iOther.Owner;
         Name          = iOther.Name;
         English       = iOther.English;
     }
     foreach (RoyalGazetteContent lContent in iOther.mSubEntries)
     {
         RoyalGazetteContent lNewContent = (RoyalGazetteContent)lContent.Clone();
         mSubEntries.Add(lNewContent);
     }
 }
Beispiel #27
0
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentCapital)
         {
             RoyalGazetteContentCapital iOtherCapital = (RoyalGazetteContentCapital)iOther;
             Type              = iOtherCapital.Type;
             TypeCapital       = iOtherCapital.TypeCapital;
             GeocodeCapital    = iOtherCapital.GeocodeCapital;
             GeocodeCapitalOld = iOtherCapital.GeocodeCapitalOld;
             CapitalName       = iOtherCapital.CapitalName;
             CapitalNameOld    = iOtherCapital.CapitalNameOld;
             CapitalEnglish    = iOtherCapital.CapitalEnglish;
             CapitalEnglishOld = iOtherCapital.CapitalEnglishOld;
         }
     }
 }
Beispiel #28
0
 virtual internal void DoLoad(XmlNode iNode)
 {
     if (iNode != null)
     {
         Geocode       = TambonHelper.GetAttributeOptionalInt(iNode, "geocode", 0);
         TambonGeocode = TambonHelper.GetAttributeOptionalInt(iNode, "tambon", 0);
         Name          = TambonHelper.GetAttributeOptionalString(iNode, "name");
         English       = TambonHelper.GetAttributeOptionalString(iNode, "english");
         Owner         = TambonHelper.GetAttributeOptionalInt(iNode, "owner", 0);
         foreach (XmlNode lNode in iNode.ChildNodes)
         {
             var lContent = RoyalGazetteContent.CreateContentObject(lNode.Name);
             if (lContent != null)
             {
                 lContent.DoLoad(lNode);
                 mSubEntries.Add(lContent);
             }
         }
     }
 }
Beispiel #29
0
 public RoyalGazette(RoyalGazette value)
 {
     Description      = value.Description;
     Volume           = value.Volume;
     URI              = value.URI;
     PageInfo         = new RoyalGazettePageinfo(value.PageInfo);
     Issue            = new RoyalGazetteIssue(value.Issue);
     Title            = value.Title;
     SubTitle         = value.SubTitle;
     Publication      = value.Publication;
     Sign             = value.Sign;
     Effective        = value.Effective;
     SignedByPosition = value.SignedByPosition;
     SignedBy         = value.SignedBy;
     foreach (RoyalGazetteContent entry in value.Content)
     {
         RoyalGazetteContent lNewContent = (RoyalGazetteContent)entry.Clone();
         Content.Add(lNewContent);
     }
 }
Beispiel #30
0
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            Int32 lParentGeocode = lCreate.Geocode / 100;

            if (!mCreationsPerParent.ContainsKey(lParentGeocode))
            {
                mCreationsPerParent.Add(lParentGeocode, 0);
            }
            mCreationsPerParent[lParentGeocode]++;

            Int32        lMaxSubEntityIndex = 0;
            List <Int32> lParentEntities    = new List <Int32>();

            foreach (RoyalGazetteContent lSubEntry in lCreate.SubEntries)
            {
                if (lSubEntry is RoyalGazetteContentCreate)
                {
                    lMaxSubEntityIndex++;
                }
                if (lSubEntry is RoyalGazetteContentReassign)
                {
                    lMaxSubEntityIndex++;

                    RoyalGazetteContentReassign lReassign = (RoyalGazetteContentReassign)lSubEntry;
                    Int32 lParentEntityCode = lReassign.OldGeocode / 100;
                    if (!lParentEntities.Contains(lParentEntityCode))
                    {
                        lParentEntities.Add(lParentEntityCode);
                    }
                }
            }

            mNumberOfSubEntities.IncrementForCount(lMaxSubEntityIndex, lCreate.Geocode);
            if (lParentEntities.Any())
            {
                mNumberOfParentEntities.IncrementForCount(lParentEntities.Count, lCreate.Geocode);
            }
        }
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            List <Int32> lTargetMubanNumbers = new List <Int32>();

            foreach (RoyalGazetteContent lSubEntry in lCreate.SubEntries)
            {
                if (lSubEntry is RoyalGazetteContentReassign)
                {
                    RoyalGazetteContentReassign lReassign = (RoyalGazetteContentReassign)lSubEntry;
                    Int32 lTargetMubanCode = lSubEntry.Geocode % 100;
                    if (lTargetMubanCode == 0)
                    {
                    }
                    else if (lTargetMubanNumbers.Contains(lTargetMubanCode))
                    {
                        ;  // This should no happen, probably mistake in XML
                    }
                    else
                    {
                        lTargetMubanNumbers.Add(lTargetMubanCode);
                    }
                    Int32 lOldMubanCode = lReassign.OldGeocode % 100;
                    if ((lTargetMubanCode != 0) & (lOldMubanCode != 0))
                    {
                        if (lTargetMubanCode == lOldMubanCode)
                        {
                            mMubanNumberEqual++;
                        }
                        else
                        {
                            mMubanNumberChanged++;
                        }
                    }
                }
            }
        }
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            List<Int32> lTargetMubanNumbers = new List<Int32>();
            foreach (RoyalGazetteContent lSubEntry in lCreate.SubEntries)
            {
                if (lSubEntry is RoyalGazetteContentReassign)
                {
                    RoyalGazetteContentReassign lReassign = (RoyalGazetteContentReassign)lSubEntry;
                    Int32 lTargetMubanCode = lSubEntry.Geocode % 100;
                    if (lTargetMubanCode == 0)
                    { }
                    else if (lTargetMubanNumbers.Contains(lTargetMubanCode))
                    {
                        ;  // This should no happen, probably mistake in XML
                    }
                    else
                    {
                        lTargetMubanNumbers.Add(lTargetMubanCode);
                    }
                    Int32 lOldMubanCode = lReassign.OldGeocode % 100;
                    if ((lTargetMubanCode != 0) & (lOldMubanCode != 0))
                    {
                        if (lTargetMubanCode == lOldMubanCode)
                        {
                            mMubanNumberEqual++;
                        }
                        else
                        {
                            mMubanNumberChanged++;
                        }
                    }

                }
            }
        }
Beispiel #33
0
        static internal RoyalGazetteContent CreateContentObject(String iName)
        {
            RoyalGazetteContent retval = null;

            switch (iName)
            {
            case RoyalGazetteContentRename.XmlLabel:
            {
                retval = new RoyalGazetteContentRename();
                break;
            }

            case RoyalGazetteContentStatus.XmlLabel:
            {
                retval = new RoyalGazetteContentStatus();
                break;
            }

            case RoyalGazetteContentCreate.XmlLabel:
            {
                retval = new RoyalGazetteContentCreate();
                break;
            }

            case RoyalGazetteContentAreaChange.XmlLabel:
            {
                retval = new RoyalGazetteContentAreaChange();
                break;
            }

            case RoyalGazetteContentAreaDefinition.XmlLabel:
            {
                retval = new RoyalGazetteContentAreaDefinition();
                break;
            }

            case RoyalGazetteContentReassign.XmlLabel:
            {
                retval = new RoyalGazetteContentReassign();
                break;
            }

            case RoyalGazetteContentAbolish.XmlLabel:
            {
                retval = new RoyalGazetteContentAbolish();
                break;
            }

            case RoyalGazetteContentConstituency.XmlLabel:
            {
                retval = new RoyalGazetteContentConstituency();
                break;
            }

            case RoyalGazetteContentMention.XmlLabel:
            {
                retval = new RoyalGazetteContentMention();
                break;
            }

            case RoyalGazetteContentCapital.XmlLabel:
            {
                retval = new RoyalGazetteContentCapital();
                break;
            }
            }
            return(retval);
        }
 protected override void DoCopy(RoyalGazetteContent iOther)
 {
     if (iOther != null)
     {
         base.DoCopy(iOther);
         if (iOther is RoyalGazetteContentCapital)
         {
             RoyalGazetteContentCapital iOtherCapital = (RoyalGazetteContentCapital)iOther;
             Type = iOtherCapital.Type;
             TypeCapital = iOtherCapital.TypeCapital;
             GeocodeCapital = iOtherCapital.GeocodeCapital;
             GeocodeCapitalOld = iOtherCapital.GeocodeCapitalOld;
             CapitalName = iOtherCapital.CapitalName;
             CapitalNameOld = iOtherCapital.CapitalNameOld;
             CapitalEnglish = iOtherCapital.CapitalEnglish;
             CapitalEnglishOld = iOtherCapital.CapitalEnglishOld;
         }
     }
 }
        protected virtual void ProcessContent(RoyalGazetteContent iContent)
        {
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;
            mNumberOfCreations++;

            Int32 lChangwatGeocode = lCreate.Geocode;
            while ( lChangwatGeocode > 100 )
            {
                lChangwatGeocode = lChangwatGeocode / 100;
            }
            mNumberOfCreationsPerChangwat[lChangwatGeocode]++;
        }
        protected override void ProcessContent(RoyalGazetteContent iContent)
        {
            base.ProcessContent(iContent);
            RoyalGazetteContentCreate lCreate = (RoyalGazetteContentCreate)iContent;

            Int32 lParentGeocode = lCreate.Geocode / 100;

            if (!mCreationsPerParent.ContainsKey(lParentGeocode))
            {
               mCreationsPerParent.Add(lParentGeocode, 0);
            }
            mCreationsPerParent[lParentGeocode]++;

            Int32 lMaxSubEntityIndex = 0;
            List<Int32> lParentEntities = new List<Int32>();
            foreach (RoyalGazetteContent lSubEntry in lCreate.SubEntries)
            {
                if (lSubEntry is RoyalGazetteContentCreate)
                {
                    lMaxSubEntityIndex++;
                }
                if (lSubEntry is RoyalGazetteContentReassign)
                {
                    lMaxSubEntityIndex++;

                    RoyalGazetteContentReassign lReassign = (RoyalGazetteContentReassign)lSubEntry;
                    Int32 lParentEntityCode = lReassign.OldGeocode / 100;
                    if (!lParentEntities.Contains(lParentEntityCode))
                    {
                        lParentEntities.Add(lParentEntityCode);
                    }
                }
            }

            mNumberOfSubEntities.IncrementForCount(lMaxSubEntityIndex, lCreate.Geocode);
            if (lParentEntities.Any())
            {
                mNumberOfParentEntities.IncrementForCount(lParentEntities.Count, lCreate.Geocode);
            }
        }
 protected virtual void DoCopy(RoyalGazetteContent iOther)
 {
     if ( iOther != null )
     {
         Geocode = iOther.Geocode;
         TambonGeocode = iOther.TambonGeocode;
         Owner = iOther.Owner;
         Name = iOther.Name;
         English = iOther.English;
     }
     foreach ( RoyalGazetteContent lContent in iOther.mSubEntries )
     {
         RoyalGazetteContent lNewContent = (RoyalGazetteContent)lContent.Clone();
         mSubEntries.Add(lNewContent);
     }
 }