private void MeetingAppointmentFunction()
        {
            Station.StartTimeThread();

            Console.CursorVisible = false;
            ConsoleKeyInfo key;

            key = Console.ReadKey(true);

            if (key.Key == ConsoleKey.A)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topA, textA);
                AddAppointments ap = new AddAppointments();
                ap.Start();
            }
            else if (key.Key == ConsoleKey.E)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topE, textE);
                EditAppointments ea = new EditAppointments();
                ea.Start();
            }
            else if (key.Key == ConsoleKey.V)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topV, textV);
                ViewAppointments va = new ViewAppointments();
                va.Start();
            }
            else if (key.Key == ConsoleKey.S)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topS, textS);
                SearchAppointments sa = new SearchAppointments();
                sa.Start();
            }
            else if (key.Key == ConsoleKey.D)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topD, textD);
                DeleteAppointments da = new DeleteAppointments();
                da.Start();
            }
            else if (key.Key == ConsoleKey.R)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, topR, textR);
                PersonalAssistant pa = new PersonalAssistant();
                pa.Start();
            }
            else
            {
                top += 4;
                Station.StopTimeThread();
                Station.BeepError();
                Console.SetCursorPosition(39, top);
                Console.WriteLine("Invalid Key.");
                Thread.Sleep(200);
                Console.Clear();
                top = 14;
                Start();
            }
        }
示例#2
0
        public void Start()
        {
            Console.Title = "BlueMoon - Contacts Application";

            Console.Clear();
            AsciiClass ac = new AsciiClass();

            ac.BlueMoon(3);

            int left = 37;
            int top  = 14;

            Console.SetCursorPosition(left, top);
            Console.WriteLine("PERSONAL ASSISTANT APPLICATION");

            top++;
            Console.SetCursorPosition(37, top);
            Console.WriteLine("Contact Details Page.");

            top += 3;
            int topA = top;

            Console.SetCursorPosition(39, top);
            String textA = "(A). Add contacts";

            Console.WriteLine(textA);

            top += 2;
            int topE = top;

            Console.SetCursorPosition(39, top);
            string textE = "(E). Edit Contacts";

            Console.WriteLine(textE);

            top += 2;
            int topV = top;

            Console.SetCursorPosition(39, top);
            string textV = "(V). View Contacts ";

            Console.WriteLine(textV);

            top += 2;
            int topS = top;

            Console.SetCursorPosition(39, top);
            string textS = "(S). Search Contacts ";

            Console.WriteLine(textS);

            top += 2;
            int topD = top;

            Console.SetCursorPosition(39, top);
            string textD = "(D). Delete Contacts ";

            Console.WriteLine(textD);

            top += 2;
            int topR = top;

            Console.SetCursorPosition(39, top);
            string textR = "(R). Return to Main Page ";

            Console.WriteLine(textR);


            Station.StartTimeThread();

            Console.CursorVisible = false;
            ConsoleKeyInfo key;

            key = Console.ReadKey(true);

            if (key.Key == ConsoleKey.A)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topA, textA);
                AddContacts ad = new AddContacts();
                ad.Start();
            }
            else if (key.Key == ConsoleKey.E)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topE, textE);
                EditContacts ec = new EditContacts();
                ec.Start();
            }
            else if (key.Key == ConsoleKey.V)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topV, textV);
                ViewContacts vc = new ViewContacts();
                vc.Start();
            }
            else if (key.Key == ConsoleKey.S)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topS, textS);
                SearchContacts sc = new SearchContacts();
                sc.Start();
            }
            else if (key.Key == ConsoleKey.D)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topD, textD);
                DeleteContacts dc = new DeleteContacts();
                dc.Start();
            }
            else if (key.Key == ConsoleKey.R)
            {
                Station.StopTimeThread();
                Station.BeepClick();
                Station.Highlight(39, topR, textR);
                PersonalAssistant pa = new PersonalAssistant();
                pa.Start();
            }
            else
            {
                Station.StopTimeThread();
                top += 4;
                Station.BeepError();
                Console.SetCursorPosition(39, top);
                Console.WriteLine("Invalid Key.");
                Thread.Sleep(200);
                Console.Clear();
                Start();
            }
        }
示例#3
0
        private void DisplayMainMenu()
        {
            Console.Clear();
            AsciiClass ac = new AsciiClass();

            ac.BlueMoon(3);

            Console.SetCursorPosition(37, 14);
            Console.WriteLine("press the letter in the bracket to select option.");

            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Example : press 'p' for personal assistant.");

            Console.SetCursorPosition(39, 18);
            string textP = "(P). Personal Assistant Application";

            Console.WriteLine(textP);

            Console.SetCursorPosition(39, 20);
            string textS = "(S). Settings";

            Console.WriteLine(textS);

            Console.SetCursorPosition(39, 22);
            string textL = "(L). Log out";

            Console.WriteLine(textL);

            Console.SetCursorPosition(39, 24);
            Console.WriteLine("(X). Exit");


            Station.StartTimeThread();


            Console.CursorVisible = false;
            ConsoleKeyInfo key;

            key = Console.ReadKey(true);

            if (key.Key == ConsoleKey.P)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, 18, textP);
                PersonalAssistant pa = new PersonalAssistant();
                pa.Start();
            }
            else if (key.Key == ConsoleKey.S)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, 20, textS);
                SettingsMenu sm = new SettingsMenu();
                sm.Start();
            }
            else if (key.Key == ConsoleKey.L)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, 22, textL);
                Login l = new Login();
                l.DisplayPassword();
            }
            else if (key.Key == ConsoleKey.X)
            {
                Station.StopTimeThread();
                Environment.Exit(0);
                Application.Exit();
            }
            else
            {
                Station.StopTimeThread();
                Station.BeepError();
                Console.SetCursorPosition(39, 26);
                Console.WriteLine("Invalid Key.");
                Thread.Sleep(200);
                Console.Clear();
                DisplayMainMenu();
            }
        }