Exemple #1
0
        public int Run()
        {
            if (Helper.DiffersFromThreshold(1, GenerateEmployeeType, GenerateTicketsPerDayDistribution, GenerateWorkshifts, BoundaryConditions))
            {
                Print("You may only select one generator function!");
                return(1);
            }
            if (GenerateEmployeeType)
            {
                var etcm = ExampleGenerator.GetEmployeeTypeContentManager();
                etcm.Save(Filename);

                Print("Saved example employee types to " + Filename);
            }
            if (GenerateTicketsPerDayDistribution)
            {
                var gentic = new TicketsPerDayDistributionGenerator();
                gentic.Save(Filename);
                Print("Saved tickets per day distribution " + Filename);
            }
            if (GenerateWorkshifts)
            {
                var ws = ExampleGenerator.GetWorkshifts();
                ws.Save(Filename);
                Print("Saved workshifts example files to " + Filename);
            }
            if (BoundaryConditions)
            {
                var json = JsonConvert.SerializeObject(new BoundaryConditions(), Formatting.Indented);
                File.WriteAllText(Filename, json);
            }

            return(0);
        }