예제 #1
0
 /// <summary>
 /// Converts the gazette operation into a entity history entry.
 /// </summary>
 /// <returns>Coresponding history entry.</returns>
 public override HistoryEntryBase ConvertToHistory()
 {
     var historyCreate = new HistoryCreate();
     historyCreate.splitfrom.AddRange(this.SplitFrom());
     historyCreate.type = this.type;
     return historyCreate;
 }
예제 #2
0
        /// <summary>
        /// Converts the gazette operation into a entity history entry.
        /// </summary>
        /// <returns>Corresponding history entry.</returns>
        public override HistoryEntryBase ConvertToHistory()
        {
            var historyCreate = new HistoryCreate();

            historyCreate.splitfrom.AddRange(this.SplitFrom());
            historyCreate.type = this.type;
            Int32 subdivisions = 0;

            switch (historyCreate.type)
            {
            case EntityType.Amphoe:
            case EntityType.KingAmphoe:
                historyCreate.subdivisiontype          = EntityType.Tambon;
                historyCreate.subdivisiontypeSpecified = true;
                break;

            case EntityType.Tambon:
                historyCreate.subdivisiontype          = EntityType.Muban;
                historyCreate.subdivisiontypeSpecified = true;
                break;

            case EntityType.Khet:
                historyCreate.subdivisiontype          = EntityType.Khwaeng;
                historyCreate.subdivisiontypeSpecified = true;
                break;
            }
            foreach (var item in Items)
            {
                var itemReassign = item as GazetteReassign;
                if (itemReassign != null)
                {
                    subdivisions++;
                    if (itemReassign.typeSpecified)
                    {
                        historyCreate.subdivisiontype          = itemReassign.type;
                        historyCreate.subdivisiontypeSpecified = true;
                    }
                }
            }
            if (subdivisions > 0)
            {
                historyCreate.subdivisions          = subdivisions;
                historyCreate.subdivisionsSpecified = true;
            }
            else
            {
                historyCreate.subdivisiontypeSpecified = false;
            }
            return(historyCreate);
        }
예제 #3
0
 /// <summary>
 /// Converts the gazette operation into a entity history entry.
 /// </summary>
 /// <returns>Corresponding history entry.</returns>
 public override HistoryEntryBase ConvertToHistory()
 {
     if (this.old == EntityType.SaphaTambon && this.@new == EntityType.TAO)
     {
         var historyCreate = new HistoryCreate();
         historyCreate.type = this.@new;
         return(historyCreate);
     }
     else
     {
         var historyStatus = new HistoryStatus();
         historyStatus.old  = this.old;
         historyStatus.@new = this.@new;
         return(historyStatus);
     }
 }