Ejemplo n.º 1
0
        public static int Run(AddPeriodOptions opts)
        {
            var runner = new PeriodRunner();
            int result = (int)ExitCodes.FailedToConvertArgs;

            try
            {
                result = runner.Create(opts.ToPeriod());
            }
            catch (Exception) { }
            return(result);
        }
Ejemplo n.º 2
0
        public static int Run(DissociateItemsOptions opts)
        {
            var ids = opts.Ids?.Select(id =>
            {
                try
                {
                    return(new ObjectId(id));
                }
                catch (Exception)
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.WriteLine($"[{id}] Is not a valid ObjectId. Ignoring...");
                    return(null);
                }
            })
                      .Where(id => id != null);
            var runner = new PeriodRunner();

            return(runner.DissociateItems(new DissociateItemArgs {
                EzName = opts.EzName, Items = opts.Items, Ids = ids
            }));
        }
Ejemplo n.º 3
0
        public static int Run(RunShowPeriodOptions opts)
        {
            var runner = new PeriodRunner();

            return(runner.Show(opts.ToShowPeriodArgs()));
        }
Ejemplo n.º 4
0
        public static int Run(DeletePeriodOptions opts)
        {
            var runner = new PeriodRunner();

            return(runner.DeletePeriod(opts.ToDeletePeriodArgs()));
        }