Ejemplo n.º 1
0
        public void Start()
        {
            Console.Clear();

            while (!ALineWon())
            {
                for (int i = 0; i < RacingLines.Count; ++i)
                {
                    RacingLines[i].TryToRun();
                }

                Thread.Sleep(20);
            }

            Line winner = GetWinningLine();

            Console.Clear();

            int    consoleHalfWidth = Console.WindowWidth / 2;
            string winningLineMsg   = "The Winning Line is: ";

            Console.SetCursorPosition(consoleHalfWidth - (winningLineMsg.Length / 2), (Console.WindowHeight / 2) - 5);
            Console.WriteLine(winningLineMsg, Color.White);
            Console.SetCursorPosition((Console.WindowWidth / 2) - 4, (Console.WindowHeight / 2) - 3);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);

            Console.ForegroundColor = Color.White;
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            var game       = new Logic.Core.Game();
            var gameState  = game.CheckedGameState();
            var styleSheet = CreateStyleSheet();

            while (gameState == GameState.Game)
            {
                Console.Clear();
                Console.WriteLineStyled(DrawBoard.Draw(game), styleSheet);

                if (game.CurrentPlayer.IsEnemy)
                {
                    Thread.Sleep(1000);
                    game.MakeMove(GeneratorBot.GeneratedMove(game.Player.Board));
                }
                else
                {
                    game.MakeMove(GameInput.DoMove());
                }
            }


            System.Console.WriteLine(gameState);
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 public static void tryingAuthorizationKey()
 {
     try
     {
         using (HttpRequest httpRequest = new HttpRequest())
         {
             string result = httpRequest.Get("https://developers.auth.gg/USERS/?type=count&authorization=" + Program.AuthorizationKey).ToString();
             if (result.Contains("\"status\":\"failed\""))
             {
                 Console.WriteLine("\nSomething went wrong, please check your authorization key or renew it.", Color.Red);
             }
             else if (result.Contains("\"status\":\"success\""))
             {
                 Console.Clear();
                 Program.Menu();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("\n " + ex.Message, Color.Red);
         Console.ReadLine();
         Environment.Exit(0);
     }
 }
Ejemplo n.º 4
0
 public static void printLogo()
 {
     Console.Clear();
     Console.WriteLine(Program.logo);
     Console.WriteLine("");
     Console.Write("[OUTLAWZ] ", Color.LightGoldenrodYellow);
 }
Ejemplo n.º 5
0
        public static configObject renewconfig(Boolean AskToSave)
        {
            Console.Clear();
            Write.ascii();
            Colorful.Console.WriteLine("Author Name:", Color.White);
            config.Author = Console.ReadLine();
            Colorful.Console.WriteLine("Module Name:", Color.White);
            config.ModuleName = Console.ReadLine();
            Colorful.Console.WriteLine("Post Url:", Color.White);
            config.postUrl = Console.ReadLine();
            Colorful.Console.WriteLine("Post Data:", Color.White);
            config.postData = Console.ReadLine();
            Colorful.Console.WriteLine("Good Keycheck:", Color.White);
            config.goodkeycheck = Console.ReadLine();
            Colorful.Console.WriteLine("Bad Keycheck:", Color.White);
            config.Badkeycheck = Console.ReadLine();
            Colorful.Console.WriteLine("Post Type:", Color.White);
            config.posttype = Console.ReadLine();
nigger:
            System.IO.File.WriteAllText("compiled.json", JsonConvert.SerializeObject(config));
            Console.WriteLine("Compiled Successfully...", Color.LawnGreen);
            Thread.Sleep(500);
            mainmenu.menu();
            return(config);
        }
Ejemplo n.º 6
0
        public static void SelectAlg()
        {
            Console.Clear();
            Console.WriteLine(figlet.ToAscii("Knewin Test"), ColorTranslator.FromHtml("#8AFFEF"));
            Console.WriteLine("Selecione um algoritmo: ");
            Console.WriteLine("1 - Buscador de Números Repetidos", Color.Yellow);
            Console.WriteLine("2 - Verificador de Palíndromos", Color.Yellow);
            Console.WriteLine("0 - Sair", Color.Gray);
            var choice = Console.ReadKey().KeyChar;

            Console.WriteLine();

            if (choice == '1')
            {
                searchFirstRepeatedIndex.Begin();
            }

            if (choice == '2')
            {
                confirmPalindrome.Begin();
            }

            if (choice != '0')
            {
                System.Console.WriteLine("Selecione um dos dois algoritmos!");
                SelectAlg();
            }
        }
Ejemplo n.º 7
0
        static void ColorfulAnimation()
        {
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 30; j++)
                {
                    Console.Clear();

                    // steam
                    Console.Write("       . . . . o o o o o o", Color.LightGray);
                    for (int s = 0; s < j / 2; s++)
                    {
                        Console.Write(" o", Color.LightGray);
                    }
                    Console.WriteLine();

                    var margin = "".PadLeft(j);
                    Console.WriteLine(margin + "                _____      o", Color.LightGray);
                    Console.WriteLine(margin + "       ____====  ]OO|_n_n__][.", Color.DeepSkyBlue);
                    Console.WriteLine(margin + "      [________]_|__|________)< ", Color.DeepSkyBlue);
                    Console.WriteLine(margin + "       oo    oo  'oo OOOO-| oo\\_", Color.Blue);
                    Console.WriteLine("   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+", Color.Silver);

                    Thread.Sleep(200);
                }
            }
        }
Ejemplo n.º 8
0
        public static int PrintMainMenu(string strLogInOut, Client myActiveClient)
        {
            ColorAlternatorFactory alternatorFactory = new ColorAlternatorFactory();
            ColorAlternator        alternator        = alternatorFactory.GetAlternator(1, Color.Aqua, Color.Aquamarine);
            string strOp;

            Console.Clear();
            Console.ResetColor();
            HpVarious.WriteArt(APP_NAME);
            if (myActiveClient.Name != null)
            {
                Console.WriteLine($"{myActiveClient.Name} {myActiveClient.LastName} ({(DateTime.Today.Year - myActiveClient.Birthdate.Year).ToString()} años), Bienvenido...\n", Color.AliceBlue);
            }
            Console.WriteLineAlternating("\t(1) MOSTRAR CATALOGO", alternator);
            Console.WriteLineAlternating("\t(2) ALQUILAR/DEVOLVER PELICULA", alternator);
            Console.WriteLineAlternating("\t(3) MIS ALQUILERES", alternator);
            Console.WriteLineAlternating($"\t(4) {strLogInOut}", alternator);
            Console.WriteLineAlternating("\t(5) SALIR", alternator);
            do
            {
                Console.Write("\nOpcion: ", Color.CadetBlue);
                Console.ResetColor();
                strOp = HpVarious.ReadNumber("12345", 1);
            } while (strOp == "");

            Console.ResetColor();
            return(Convert.ToInt32(strOp));//return Convert.ToInt32(Console.ReadLine());
        }
Ejemplo n.º 9
0
        public static void Menu()
        {
            design.Logo();
            Console.WriteLineFormatted("\n {0}{4}{2} Users", Color.White, design.colors);
            Console.WriteLineFormatted(" {0}{5}{2} Licenses", Color.White, design.colors);
            Console.WriteLineFormatted(" {0}{6}{2} HWID", Color.White, design.colors);
            Console.WriteFormatted("  {3} ", Color.White, design.colors);
            string option = Console.ReadLine();

            switch (option)
            {
            case "1":
                Console.Clear();
                Users();
                break;

            case "2":
                Console.Clear();
                LicenseMenu();
                break;

            case "3":
                Console.Clear();
                HWIDMenu();
                break;
            }
        }
Ejemplo n.º 10
0
        private async Task VerifyConnectionAsync()
        {
            var isReady = false;
            int tries = 0, waitTime = 0;

            LogHandler <MainHandler> .Log.Information("Verifying internet connectivity before proceeding.");

            while (!isReady && tries < _config.MaxConnectionRetries)
            {
                var ping = await _httpHandler.PingAsync().ConfigureAwait(false);

                if (ping)
                {
                    isReady = ping;
                    LogHandler <MainHandler> .Log.Information(
                        "Internet connection verified successfully! Continuing ...");

                    Console.Clear();
                }
                else
                {
                    tries++;
                    waitTime += _config.ReconnectInterval;
                    LogHandler <MainHandler> .Log.Warning(
                        $"Attempt #{tries}, next attempt in {TimeSpan.FromMilliseconds(waitTime).Seconds}s.");

                    await Task.Delay(waitTime).ConfigureAwait(false);
                }
            }
        }
Ejemplo n.º 11
0
        } //ErrorMessage
        static void ConsoleDraw(IEnumerable<string> lines, int x, int y) //pulled from https://stackoverflow.com/questions/2725529/how-to-create-ascii-animation-in-windows-console-application-using-c
        {
            if (x > Console.WindowWidth) return;
            if (y > Console.WindowHeight) return;

            var trimLeft = x < 0 ? -x : 0;
            int index = y;

            x = x < 0 ? 0 : x;
            y = y < 0 ? 0 : y;

            var linesToPrint =
                from line in lines
                let currentIndex = index++
                where currentIndex > 0 && currentIndex < Console.WindowHeight
                select new
                {
                    Text = new String(line.Skip(trimLeft).Take(Math.Min(Console.WindowWidth - x, line.Length - trimLeft)).ToArray()),
                    X = x,
                    Y = y++
                };

            Console.Clear();
            foreach (var line in linesToPrint)
            {
                Console.SetCursorPosition(line.X, line.Y);
                Console.Write(line.Text);
            }
        }//ConsoleDraw
Ejemplo n.º 12
0
 public static void DrawWelcome()
 {
     Console.BackgroundColor = Color.DarkSlateBlue;
     Console.Clear();
     Console.ForegroundColor = Color.LightYellow;
     Console.SetCursorPosition(0, Console.WindowHeight / 2 - 1);
     Console.Write(Center(StringWelcome, Console.WindowWidth));
 }
Ejemplo n.º 13
0
        static void t()
        {
            int i  = 0;
            int st = 6;

            Console.Clear();
            Console.WriteAscii(" CPU MONITOR V1.0 ", Color.FromArgb(255, 0, 200));
            Console.SetCursorPosition(0, 5);
            Console.WriteLine("  CPU TEMP", Color.Red);
            while (true)
            {
                Computer myComputer = new Computer();
                myComputer.CPUEnabled = true;
                myComputer.Open();
                List <int> ctemp_value = new List <int>();

                foreach (var hardwareItem in myComputer.Hardware)
                {
                    foreach (var sensor in hardwareItem.Sensors)
                    {
                        if (sensor.Identifier.ToString() == "/intelcpu/0/temperature/0" || sensor.Identifier.ToString() == "/intelcpu/0/temperature/1" || sensor.Identifier.ToString() == "/intelcpu/0/temperature/2" || sensor.Identifier.ToString() == "/intelcpu/0/temperature/3")
                        {
                            string name = sensor.Identifier.ToString();
                            name = name.Replace("/intelcpu/0/temperature/", "CPU ");
                            ctemp_value.Add(Convert.ToInt32(sensor.Value));
                        }
                    }
                }//COLOR
                int r = 255;
                int g = 0;
                int b = 255;

                double avg = ctemp_value.Average();
                //print cpu
                Console.SetCursorPosition(0, st);
                Console.Write("\r  CPU 0 : {0}%   ", ctemp_value[0], Color.FromArgb(r, g, b));
                Console.SetCursorPosition(0, st + 1);
                Console.Write("\r  CPU 1 : {0}%   ", ctemp_value[1], Color.FromArgb(r, g, b));
                Console.SetCursorPosition(0, st + 2);
                Console.Write("\r  CPU 2 : {0}%   ", ctemp_value[2], Color.FromArgb(r, g, b));
                Console.SetCursorPosition(0, st + 3);
                Console.Write("\r  CPU 3 : {0}%   ", ctemp_value[3], Color.FromArgb(r, g, b));
                Console.SetCursorPosition(0, st + 4);
                Console.Write("\r  AVG {0}%   ", avg, Color.FromArgb(r, g, b));
                //SEt DELEY
                i += 1;
                if (i % 2 == 0)
                {
                    s.Write("1");
                }
                else
                {
                    s.Write("2");
                }
                Thread.Sleep(300);
            }
        }
Ejemplo n.º 14
0
 public ConsoleWriter()
 {
     Console.Clear();
     Console.Title        = "SivQuest";
     Console.WindowWidth  = 80;
     Console.BufferWidth  = 80;
     Console.WindowHeight = 25;
     Console.BufferHeight = 25;
 }
Ejemplo n.º 15
0
        }//FinishTransaction

        public void MasterPage()
        {
            Console.Clear();
            Console.WriteLine("Umbrella Corp: Vendo-Matic 7000");
            Console.WriteAscii("Snacking Refactored!", FigletFont.Default, Color.Plum);
            StyleSheet styleSheetMM = new StyleSheet(Color.White);
            styleSheetMM.AddStyle("MAIN MENU", (Color.LimeGreen));
            //StyleSheet styleSheetPM = new StyleSheet(Color.White);
            //styleSheetPM.AddStyle("PURCHASE MENU", (Color.LimeGreen));
        }
Ejemplo n.º 16
0
        }//RunInterface
        public bool Menu()
        {
            
            MasterPage();
            StyleSheet styleSheetMM = new StyleSheet(Color.White);
            styleSheetMM.AddStyle("MAIN MENU", (Color.LimeGreen));
            Console.WriteLine("MAIN MENU", Color.LimeGreen);
            Console.WriteLine("\n(1) Display Vending Machine Items\n(2) Make A Purchase\n(3) End Program\n");
            string menuInput = Console.ReadLine();

           
            const bool StopMenu = false;
            const bool ContinueMenu = true;
            const bool Incomplete = false;
            bool isPurchaseTransactionComplete = Incomplete;
            const string DisplaySelction = "1";
            const string PurchaseSelection = "2";
            const string SecretReport = "9";
            const string EndProgram = "3";

            if (menuInput == DisplaySelction)
            {
                Display();
                Console.WriteLineStyled("\n\nPress enter to return to the MAIN MENU...", styleSheetMM);
                Console.ReadLine();
                return StopMenu;
            }
            else if (menuInput == PurchaseSelection)
            {
                while (isPurchaseTransactionComplete == Incomplete)
                {
                    isPurchaseTransactionComplete = Purchase();
                }
                return StopMenu;
            }
            else if (menuInput == EndProgram)
            {
                return ContinueMenu;
            }
            else if (menuInput == SecretReport)
            {
                Console.WriteLine("Generating sales report...", Color.LimeGreen);
                InitiateSalesReport();
                Console.ReadLine();
                Console.Clear();
                return StopMenu;
            }
            else
            {
                ErrorMessage();                    
                Console.WriteLineStyled("SELECTION NOT VALID! Press enter to return to the MAIN MENU.", styleSheetMM);
                Console.ReadLine();
                return StopMenu;
            }
        }//Menu
Ejemplo n.º 17
0
 public static void DrawGameOver()
 {
     Pause   = true;
     CanPlay = false;
     WType   = WindowType.GameOver;
     Console.BackgroundColor = Color.DarkMagenta;
     Console.Clear();
     Console.ForegroundColor = Color.White;
     Console.SetCursorPosition(0, Console.WindowHeight / 2 - 1);
     Console.Write(Center(StringGameOver, Console.WindowWidth));
     Console.Write(Center($"Total score: {Score} | Game time: " + TimeToString(GameTime), Console.WindowWidth));
 }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            FigletFont font   = FigletFont.Load("standard.flf");
            Figlet     figlet = new Figlet(font);

            while (true)
            {
                Console.WriteLine(figlet.ToAscii(DateTime.Now.ToString("hh:mm:ss")), ColorTranslator.FromHtml("#00cc00"));
                Thread.Sleep(65);
                Console.Clear();
            }
        }
Ejemplo n.º 19
0
        static void MultiLineAnimation()
        {
            var counter = 0;

            for (int i = 0; i < 30; i++)
            {
                Console.Clear();

                switch (counter % 4)
                {
                case 0:
                {
                    Console.WriteLine("╔════╤╤╤╤════╗");
                    Console.WriteLine("║    │││ \\   ║");
                    Console.WriteLine("║    │││  O  ║");
                    Console.WriteLine("║    OOO     ║");
                    break;
                };

                case 1:
                {
                    Console.WriteLine("╔════╤╤╤╤════╗");
                    Console.WriteLine("║    ││││    ║");
                    Console.WriteLine("║    ││││    ║");
                    Console.WriteLine("║    OOOO    ║");
                    break;
                };

                case 2:
                {
                    Console.WriteLine("╔════╤╤╤╤════╗");
                    Console.WriteLine("║   / │││    ║");
                    Console.WriteLine("║  O  │││    ║");
                    Console.WriteLine("║     OOO    ║");
                    break;
                };

                case 3:
                {
                    Console.WriteLine("╔════╤╤╤╤════╗");
                    Console.WriteLine("║    ││││    ║");
                    Console.WriteLine("║    ││││    ║");
                    Console.WriteLine("║    OOOO    ║");
                    break;
                };
                }

                counter++;
                Thread.Sleep(200);
            }
        }
Ejemplo n.º 20
0
Archivo: Game.cs Proyecto: CMS18/Grupp2
        public void Menu()
        {
            bool validInput = true;

            while (validInput)
            {
                Console.Clear();
                string text = @"
                                ***************************************
                                * Aloha and welcome to your Adventure *
                                ***************************************
                                
                                Please make a choice

                                1. New Game
                                2. Command List
                                3. Are you a little dumb? L2P and RTFM
                                4. Exit";
                Formatting(text);
                Console.Write("> ", Color.DeepPink);
                string input = Console.ReadLine();
                switch (input)
                {
                case "1":
                    CreatePlayer();
                    break;

                case "2":
                    RulesAndCommands.Commands();
                    break;

                case "3":
                    RulesAndCommands.Rules();
                    break;

                case "4":
                    Console.Clear();
                    Console.WriteLine("I knew you didn't have it in you. Peasant.");
                    ExitGame();
                    Console.ReadLine();
                    Environment.Exit(0);
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Wrong input! Please chose a valid number!");
                    Console.ReadLine();
                    break;
                }
            }
        }
Ejemplo n.º 21
0
    public static void death_comic(int score)
    {
        string buf = "     " + "SCORE : " + (score * 10).ToString();

        ConsoleB.BackgroundColor = _back;
        ConsoleB.Clear();
        for (int i = 10; i >= 0; --i)
        {
            ConsoleB.BackgroundColor = _back;
            ConsoleB.SetCursorPosition(0, 14);
            Thread.Sleep(70);
            ConsoleB.WriteAscii(buf.Remove(0, i), color: Color.Black);
        }
    }
Ejemplo n.º 22
0
        public static int PrintRoomMenu()
        {
            ColorAlternatorFactory alternatorFactory = new ColorAlternatorFactory();
            ColorAlternator        alternator        = alternatorFactory.GetAlternator(1, Color.Aqua, Color.Aquamarine);

            Console.Clear();
            HpVarious.WriteArt(APP_NAME);
            WriteArea("AREA HABITACIONES\n");
            Console.WriteLineAlternating("\t(1) REGISTRAR HABITACION (INCLUIR NUEVA HABITACION)", alternator);
            Console.WriteLineAlternating("\t(2) CONSULTAR HABITACIONES", alternator);
            Console.WriteLineAlternating("\t(3) VOLVER", alternator);
            Console.Write("\nOpcion: ");
            return(Convert.ToInt32(Console.ReadLine()));
        }
Ejemplo n.º 23
0
        static void DownloadAudio()
        {
            Console.Clear();
            Console.WriteLine("Enter Post URL:", Color.SkyBlue);
            string url = Console.ReadLine();

            Console.Clear();
            Console.WriteLine("Pulling Data...", Color.CadetBlue);
            PullJSON(url);
            client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
            client.DownloadFile(tko.props.pageProps.musicInfo.music.coverThumb, "Audio//" + tko.props.pageProps.musicData.musicName + " - " + tko.props.pageProps.musicData.musicName + ".jpeg");
            client.DownloadFileAsync(new Uri(tko.props.pageProps.musicInfo.music.playUrl), "Audio//" + tko.props.pageProps.musicData.musicName + " - " + tko.props.pageProps.musicData.musicName + ".mp3");
            Console.ReadLine();
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Prints a summary of the reservation details.
        /// </summary>
        private void PrintConfirmationPage()
        {
            int    userResId = reservationDAO.GetReservationId();
            string fromMonth = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(userFromDate.Month);
            string toMonth   = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(userToDate.Month);

            Console.Clear();
            PrintHeader();
            Console.WriteLine();
            Console.WriteLine($"********************************************************************     RESERVATION SUCCESSFUL     *********************************************************************", Color.Gold);
            Console.WriteLine();
            Console.WriteLine("  [Confirmation #]           [ Park Name ]           [ Campground ]         [ Site ID ]     [ Check-In Date ]      [ Check Out Date ]      [ Reserved For ]         [Total Due]                      ", Color.GreenYellow);
            Console.WriteLine("__________________________________________________________________________________________________________________________________________________________________________", Color.DimGray);
            Console.WriteLine($"           {userResId}                   {userParkName}                 {userCampgroundName}               {siteIdString}          {fromMonth} {userFromDate.Day}, {userFromDate.Year}         {fromMonth} {userToDate.Day}, {userFromDate.Year}         {reservationName}            {totalCost:C}                    ", Color.Gold);
            Console.WriteLine();
            Console.WriteLine("__________________________________________________________________________________________________________________________________________________________________________", Color.DimGray);
            Console.WriteLine();
            // TODO Will, Can we add Color to the "M" and "Q" here so they stand out?
            Console.Write(@"    Press M - Main Menu                                             Press Q - Quit                             Enter Selection: ", Color.WhiteSmoke);

            while (true)
            {
                string userChoice = Console.ReadLine();

                Console.Clear();

                switch (userChoice.ToLower())
                {
                case "m":

                    RunMainMenuCLI();
                    break;

                case "q":
                    PrintHeader();
                    Console.WriteLine();
                    Console.WriteLine("---------------------------------------------------------THANK YOU FOR USING THE NATIONAL PARK RESERVATION SERVICE--------------------------------------------------------", Color.GreenYellow);
                    Console.WriteLine("__________________________________________________________________________________________________________________________________________________________________________", Color.DimGray);
                    Console.WriteLine("**************************************************************      Press [ENTER] to exit the service      ***************************************************************", Color.LightSteelBlue);
                    Console.ReadLine();
                    Environment.Exit(0);
                    return;

                default:
                    Console.WriteLine("The command provided was not a valid command, please try again.", Color.OrangeRed);
                    break;
                }
            }
        }
Ejemplo n.º 25
0
        static void Main(string[] args)
        {
            Console.Write("Starting up");
            for (int i = 0; i < 12; i++)
            {
                Sleep(200);
                Console.Write(".");
            }

            for (int i = 0; i < 4; i++)
            {
                Sleep(10);
                Console.Write(".");
            }



            Console.WriteLine("\nDone!");
            Sleep(1000);

            Console.ResetColor();
            Console.BackgroundColor = Color.Black;
            Console.ReplaceColor(Color.Black, Color.FromArgb(0, 30, 0));


            while (true)
            {
                for (int i = 0; i < 3; i++)
                {
                    Sleep(300);
                    Console.Write(".");
                }
                Console.Clear();

                Console.WriteLine("Give me your message that you want to see in color");

                string inp = Console.ReadLine();

                if (inp == "stop")
                {
                    break;
                }

                Console.SetCursorPosition(0, Console.CursorTop - 1);
                RainbowText(inp);
            }

            Console.WriteLine("Until next time!", Color.Red);
        }
Ejemplo n.º 26
0
        public void deleteCustomer()
        {
            System.Console.WriteLine();
            Console.Write(" ENTER THE ID TO DELETE : ");

            System.Console.WriteLine();
            System.Console.WriteLine();

            var table = new ConsoleTable(" ID ", " C U S T O M E R  N A M E ", " T O T A L  P U R C H A S E ", " D I S C O U N T ", " T O T A L  D U E ", " C A S H  P A Y M E N T ", " C H A N G E ");



            foreach (var cust in db.getCUstomerList())
            {
                table.AddRow(cust.ID, cust.CustName, cust.totalPurch, cust.disc, cust.totalDue, cust.cpay, cust.change);
            }

            table.Write();
            Console.WriteLine();

            Console.CursorTop  = 1;
            Console.CursorLeft = 30;
            int id = int.Parse(Console.ReadLine());


            Message.TitleBox(" Are you sure you want to delete [Y]es/[N]o ", 5, 50, ConsoleColor.Red, ConsoleColor.White);

            ConsoleKey sel = Console.ReadKey().Key;

            if (sel.Equals(ConsoleKey.Y))
            {
                db.deleteCustomer(id);
                Message.TitleBox(" Do you want to delete another ? [Y]es/[N]o ", 5, 50, ConsoleColor.White, ConsoleColor.Black);
                ConsoleKey key = Console.ReadKey().Key;

                if (key.Equals(ConsoleKey.Y))
                {
                    Console.Clear();
                    deleteCustomer();
                }
                else
                {
                }
            }
            else
            {
                Intermidiate();
            }
        }
Ejemplo n.º 27
0
        public static int PrintMainMenu()
        {
            ColorAlternatorFactory alternatorFactory = new ColorAlternatorFactory();
            ColorAlternator        alternator        = alternatorFactory.GetAlternator(1, Color.Aqua, Color.Aquamarine);

            Console.Clear();
            //Console.WriteLine("SISTEMA RESERVA DE HOTEL BBKBOOTCAMP 2020 (6ta Edición)\n");
            HpVarious.WriteArt(APP_NAME);
            Console.WriteLineAlternating("\t(1) CLIENTES", alternator);
            Console.WriteLineAlternating("\t(2) HABITACIONES", alternator);
            Console.WriteLineAlternating("\t(3) RESERVACIONES", alternator);
            Console.WriteLineAlternating("\t(4) SALIR", alternator);
            Console.Write("\nOpcion: ");
            return(Convert.ToInt32(Console.ReadLine()));
        }
Ejemplo n.º 28
0
        public Race()
        {
            Console.Clear();

            int maxParticipants = CalculateMaxParticipants();

            Console.WriteLine();
            Console.Write("Enter the number of race participants (max {0}): ", Color.White, maxParticipants);

            int nParticipants = Convert.ToInt32(Console.ReadLine());

            RacingLines = new List <Line>();

            CreateLines(nParticipants);
        }
Ejemplo n.º 29
0
        public static int PrintClientMenu()
        {
            ColorAlternatorFactory alternatorFactory = new ColorAlternatorFactory();
            ColorAlternator        alternator        = alternatorFactory.GetAlternator(1, Color.Aqua, Color.Aquamarine);

            Console.Clear();
            HpVarious.WriteArt(APP_NAME);
            WriteArea("AREA CLIENTES\n");
            Console.WriteLineAlternating("\t(1) REGISTRAR CLIENTE (NUEVO CLIENTE)", alternator);
            Console.WriteLineAlternating("\t(2) ACTUALIZAR CLIENTE", alternator);
            Console.WriteLineAlternating("\t(3) CONSULTAR CLIENTES", alternator);
            Console.WriteLineAlternating("\t(4) VOLVER", alternator);
            Console.Write("\nOpcion: ");
            return(Convert.ToInt32(Console.ReadLine()));
        }
Ejemplo n.º 30
0
 public void exit()
 {
     for (int i = 3; i >= 0; i--)
     {
         Console.BackgroundColor = Color.Red;
         Console.Clear();
         Console.CursorTop = 7;
         Message.TitleBox(" S Y S T E M    E X I T ", 6, 60, ConsoleColor.Red, ConsoleColor.White);
         Console.CursorTop  = 11;
         Console.CursorLeft = (Console.WindowWidth / 2) - 8;
         Console.WriteLine("E X I T T I N G  I N  {0}", i);
         Thread.Sleep(1000);
     }
     System.Environment.Exit(0);
 }