コード例 #1
0
        private ResourceDescription CreateSeasonResourceDescription(FTN.Season cimSeason)
        {
            ResourceDescription rd = null;

            if (cimSeason != null)
            {
                long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.SEASON, importHelper.CheckOutIndexForDMSType(DMSType.SEASON));
                rd = new ResourceDescription(gid);
                importHelper.DefineIDMapping(cimSeason.ID, gid);

                ////populate ResourceDescription
                PowerTransformerConverter.PopulateSeasonProperties(cimSeason, rd);
            }
            return(rd);
        }
コード例 #2
0
 public static void PopulateSeasonProperties(FTN.Season cimSeason, ResourceDescription rd)
 {
     if ((cimSeason != null) && (rd != null))
     {
         PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimSeason, rd);
         if (cimSeason.EndDateHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SEASON_EDATE, cimSeason.EndDate.Ticks));
         }
         if (cimSeason.StartDateHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SEASON_SDATE, cimSeason.StartDate.Ticks));
         }
     }
 }
コード例 #3
0
        private void ImportSeasons()
        {
            SortedDictionary <string, object> Seasons = concreteModel.GetAllObjectsOfType("FTN.Season");

            if (Seasons != null)
            {
                foreach (KeyValuePair <string, object> SeasonPair in Seasons)
                {
                    FTN.Season cimSeason = SeasonPair.Value as FTN.Season;

                    ResourceDescription rd = CreateSeasonResourceDescription(cimSeason);
                    if (rd != null)
                    {
                        delta.AddDeltaOperation(DeltaOpType.Insert, rd, true);
                        report.Report.Append("Season ID = ").Append(cimSeason.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString());
                    }
                    else
                    {
                        report.Report.Append("Season ID = ").Append(cimSeason.ID).AppendLine(" FAILED to be converted");
                    }
                }
                report.Report.AppendLine();
            }
        }