Пример #1
0
        public static void CreateXMLFile(FilePreparationDateRequired dateRequired, IEnumerable <ActiveRuleValidity> ruleNames, RuleToFunctorParser rfp, int UKPRN, string folder, uint scale, List <FileRuleLearner> allLearners)
        {
            XmlGenerator xml          = new XmlGenerator(rfp, UKPRN);
            int          learnerIndex = 0;
            long         ULNIndex     = 0;

            foreach (var arv in ruleNames)
            {
                for (uint i = 0; i != scale; ++i)
                {
                    learnerIndex += xml.GenerateRequiredLearnersAndProgression(arv.RuleName, arv.Valid, learnerIndex, ref ULNIndex);
                }
            }

            foreach (XmlTriplet trip in xml._triplets)
            {
                xml.PopulateHeaders(dateRequired, trip);
                xml.WriteFile(folder, (int)dateRequired, trip);
                allLearners.AddRange(trip.FileRuleLearners);
            }
        }
Пример #2
0
        private MessageHeader CreateHeader(FilePreparationDateRequired fpdr, int ukprn)
        {
            var result = new MessageHeader()
            {
                CollectionDetails = new MessageHeaderCollectionDetails()
                {
                    Collection          = MessageHeaderCollectionDetailsCollection.ILR,
                    Year                = MessageHeaderCollectionDetailsYear.Item1718,
                    FilePreparationDate = DateTime.Today //.ToString("yyyy-MM-dd")
                },
                Source = new MessageHeaderSource()
                {
                    DateTime          = DateTime.Now,
                    ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIALSENSITIVEPersonal,
                    Release           = "0.1",
                    SoftwareSupplier  = "Own Software",
                    UKPRN             = ukprn,
                    SerialNo          = "01"
                }
            };

            switch (fpdr)
            {
            case FilePreparationDateRequired.January:
                result.CollectionDetails.FilePreparationDate = DateTime.Parse(Helpers.ValueOrFunction("[AY|JAN|13]"));
                break;

            case FilePreparationDateRequired.December:
                result.CollectionDetails.FilePreparationDate = DateTime.Parse(Helpers.ValueOrFunction("[AY|DEC|13]"));
                break;

            default:
                break;
            }

            return(result);
        }
Пример #3
0
 internal void PopulateHeaders(FilePreparationDateRequired fpdr, XmlTriplet triplet)
 {
     File                  = new Message();
     File.Header           = CreateHeader(fpdr, triplet.UKPRN);
     File.LearningProvider = CreateLearningProvider(triplet.UKPRN);
 }