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); }
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 })); }
public static int Run(RunShowPeriodOptions opts) { var runner = new PeriodRunner(); return(runner.Show(opts.ToShowPeriodArgs())); }
public static int Run(DeletePeriodOptions opts) { var runner = new PeriodRunner(); return(runner.DeletePeriod(opts.ToDeletePeriodArgs())); }