Example #1
0
        static void Main(string[] args)
        {
            string choice = null;

            string msg = "";

            do
            {
                choice = UserInterface();

                switch (choice.ToUpper())
                {
                case "C":

                    _personView.CreatePerson();
                    msg = "\n----------------------------> \nPaina Enter jatkaaksesi!";
                    break;

                case "R":
                    _personView.ReadAllData();
                    msg = "\n----------------------------> \nPaina Enter jatkaaksesi!";
                    break;

                case "U":
                    _personView.UpdatePerson();
                    msg = "\n---------------------------->! \nPaina Enter jatkaaksesi!";
                    break;

                case "D":
                    _personView.DeletePerson();
                    msg = "\n---------------------------->! \nPaina Enter jatkaaksesi!";
                    break;

                case "R1":
                    _personView.ReadById();
                    msg = "\n----------------------------> \nPaina Enter jatkaaksesi!";
                    break;

                case "X":
                    msg = "\nOhjelman suoritus päättyy!";
                    break;

                default:
                    msg = "Nyt tuli huti yritä uudestaan - Paina Enter ja aloita alusta!";
                    break;
                }

                Console.WriteLine(msg);
                Console.ReadLine();
                Console.Clear();
            }while (choice.ToUpper() != "X");
        }
Example #2
0
        static void Main(string[] args)
        {
            string choice = null;

            do
            {
                choice = UserInterface();

                switch (choice.ToUpper())
                {
                case "C":
                    _personView.CreatePerson();
                    break;

                case "R":
                    _personView.PrintAllPeople();
                    break;

                case "U":
                    _personView.UpdatePerson();
                    break;

                case "D":
                    _personView.DeletePerson();
                    break;

                case "R1":
                    _personView.PrintSinglePerson();
                    break;

                case "R2":
                    _personView.PrintByCity();
                    break;
                }
                Console.WriteLine();
                Console.WriteLine("PAINA ENTERIÄ JATKAAKSESI!");
                Console.ReadLine();
            }while (choice.ToUpper() != "X");
        }