Exemplo n.º 1
0
        public static void ShowConfiguration()
        {
            var configuration = ConfigAccess.ReadConfiguration();

            var table = new Table();

            // Add some columns
            table.AddColumn($"[Blue]Color1[/]");
            table.AddColumn($"[Blue]Color2[/]");
            table.AddColumn($"[Blue]Color3[/]");
            table.AddColumn($"[Blue]Salario[/]");
            table.AddRow($"[{configuration.Color1}]{configuration.Color1}[/]", $"[{configuration.Color2}]{configuration.Color2}[/]", $"[{configuration.Color3}]{configuration.Color3}[/]", configuration.Salary.ToString());
            AnsiConsole.Render(table);
        }
Exemplo n.º 2
0
        public static void CreateNewConfiguration()
        {
            if (ConfigAccess.ReadConfiguration() is not null)
            {
                ShowConfiguration();
                var option = AnsiConsole.Confirm("Desea eliminar la configuración?");
                if (option) ConfigAccess.DeleteConfiguration();
            }
            else
            {
                var color1 = AnsiConsole.Prompt(new SelectionPrompt<string>().Title("Color 1, row 1 table?").AddChoices(Colors));
                var color2 = AnsiConsole.Prompt(new SelectionPrompt<string>().Title("Color 2, row 2 table?").AddChoices(Colors));
                var color3 = AnsiConsole.Prompt(new SelectionPrompt<string>().Title("Color 3, header table?").AddChoices(Colors));
                var salary = AnsiConsole.Ask<int>("Salario minimo");

                ConfigAccess.CreateConfigurations(color1, color2, color3, salary);
            }
        }
Exemplo n.º 3
0
 public static void DeleteConfiguration()
 {
     ShowConfiguration();
     var option = AnsiConsole.Confirm("Desea eliminar la configuración?");
     if (option) ConfigAccess.DeleteConfiguration();
 }
Exemplo n.º 4
0
 public static Configuration ValidateConfiguration()
 {
     if (ConfigAccess.ReadConfiguration() != null) return ConfigAccess.ReadConfiguration();
     ConfigurationMenu(1);
     return  ConfigAccess.ReadConfiguration();
 }