Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var arguments = LoadArguments(args);

            switch (arguments.Option)
            {
            case ProgramOption.Help:
                PrintHelp();
                return;

            case ProgramOption.Update:
            case ProgramOption.Post:

                var restaurantSettingses = JsonParser.ParseRestaurantSetting(arguments.JsonFilePath);
                var slackSettings        = JsonParser.ParseSlackSetting(arguments.SlackFilePath);

                var menus = MenuParser.GetMenuFromMenicka(restaurantSettingses);

                if (CheckMenu(menus) == false)
                {
                    ScheduleUdate();
                }
                else
                {
                    ScheduleEnd();
                }

                var slackHelper = new SlackHelper(slackSettings);

                if (arguments.Option == ProgramOption.Post)
                {
                    slackHelper.PostMenu(menus);
                }
                else
                {
                    slackHelper.UpdateMenu(menus);
                }

                break;
            }
        }