Example #1
0
    public override void Display()
    {
        Console.Clear();

        Console.SetCursorPosition
            (Console.WindowWidth / 2, Console.WindowHeight / 2);
        string[] credits = { "Creator of the project: Raul Gogna",
                             "Version: 2.0",                      "Data ot creation: 14/05/2018",
                             "Data of finalization: 01/06/2018",  "Project Boss: Nacho Cabanes" };
        while (!finished)
        {
            for (int i = credits.Length - 1; i > 0; i--)
            {
                config.WriteFore(20, (startY), credits[i], "green", true);

                Thread.Sleep(1000);
                if (startY < endY)
                {
                    finished = true;
                }
                startY -= 2;
                Console.Clear();
                if (startY < endY)
                {
                    finished = true;
                }
            }
        }
    }
Example #2
0
    public void DisplayActualNote(NotesList notes, int option)
    {
        string line      = new string('-', Console.WindowWidth);
        string helpLine1 = "1 - Add  2 - Modify  3 - Delete  4 - Category";
        string helpLine2 = "<-- --> - Change Note  Esc-Exit";


        if (notes.Count == 0)
        {
            SetConsoleEmpty();
            Console.WriteLine("Not dates");

            Console.Write("Do you want add first record(yes/no): ");
            string answer = Console.ReadLine();
            if (answer == "yes")
            {
                Add();
            }
            else if (answer == "no")
            {
                Console.WriteLine("Okey. See you!");
                Console.WriteLine("Pres ESC to return.");
            }
        }
        else
        {
            SetConsole(notes);
            config.WriteBack(0, 2, "Completed items: ", false);
            int x = 0, y = 4;
            for (int i = 0; i < notesList.Count; i++)
            {
                if (notesList.Notes[i].Title ==
                    notesList.Notes[noteActual].Title &&
                    notesList.Notes[i].Category ==
                    notesList.Notes[noteActual].Category &&
                    notesList.Notes[i].Done == true)
                {
                    Console.SetCursorPosition(x, y);
                    Console.WriteLine((i + 1) + "." +
                                      notesList.Notes[i].Description);
                    y++;
                }
            }
            config.WriteBack("blue");
            config.WriteFore("white");
            config.WriteBack(0, (Console.WindowHeight - 3), line, false);
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine1.Length / 2), Console.WindowHeight - 2, helpLine1, false);
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine2.Length / 2), Console.WindowHeight - 1, helpLine2, false);
        }
    }
Example #3
0
    private void Add()
    {
        Console.Clear();

        config.WriteFore("Name: ", "white", false);
        string name = Console.ReadLine();

        config.WriteFore("Email: ", "white", false);
        string email = Console.ReadLine();

        config.WriteFore("Age: ", "white", false);
        string answer = Console.ReadLine();
        int    age    = 0;

        if (answer != "")
        {
            age = Convert.ToInt32(answer);
        }

        config.WriteFore("Telephone: ", "white", false);
        string telephone = Console.ReadLine();

        config.WriteFore("Address: ", "white", false);
        string adress = Console.ReadLine();

        config.WriteFore("Country: ", "white", false);
        string country = Console.ReadLine();

        config.WriteFore("Observations: ", "white", false);
        string observations = Console.ReadLine();

        listContact.Add(new Contact(
                            name, email, age, telephone, adress, country, observations));
        listContact.Save();
    }
Example #4
0
    public void Add()
    {
        if (!GetLanguage)
            options = camps;
        else
            options = campos;

        Console.Clear();
        contCamps = 0;
        config.WriteFore(options[contCamps], "white", false);
        string description = Console.ReadLine();
        contCamps++;

        config.WriteFore(options[contCamps], "white", false);
        string dateStart = Console.ReadLine();
        contCamps++;

        config.WriteFore(options[contCamps], "white", false);
        string dateDue = Console.ReadLine();
        contCamps++;

        config.WriteFore(options[contCamps], "white", false);
        string category = Console.ReadLine();
        contCamps++;

        config.WriteFore(options[contCamps], "white", false);
        string answer = Console.ReadLine();
        int priority = 0;
        if (answer != "")
            priority = Convert.ToInt32(answer);
        contCamps++;

        config.WriteFore(options[contCamps], "white", false);
        answer = Console.ReadLine();
        bool confidential = false;
        if (answer == "yes")
            confidential = true;
        else if (answer == "no")
            confidential = false;
        contCamps = 0;

        tasks.Add(new Task(
           description, dateStart, dateDue, category, priority, confidential));
        tasks.Save();
    }
Example #5
0
    private void PrintMenu()
    {
        Console.ResetColor();
        SetConsole();

        string line        = new string('-', Console.WindowWidth);
        string lineaAyuda1 = "Esc-Salir V-Visualizacion  S-Buscar  " +
                             "Enter-Abrir dia";
        string helpLine1 = "Esc-Exit  V-Visualization  S-Search  " +
                           "Enter-Open Day";

        config.WriteBack("black");
        config.WriteFore("white");
        config.WriteBack(0, (Console.WindowHeight - 4), line, false);
        if (!GetLanguage)
        {
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine1.Length / 2), Console.WindowHeight - 3, helpLine1,
                             "black", true);
        }
        else
        {
            config.WriteBack(Console.WindowWidth / 2 -
                             (helpLine1.Length / 2), Console.WindowHeight - 3, lineaAyuda1,
                             "black", true);
        }

        /*config.WriteBack(Console.WindowWidth / 2 -
         * (helpLine2.Length / 2), Console.WindowHeight - 2, helpLine2, true);*/
    }