Exemplo n.º 1
0
        private void PersonalAssistantFunction()
        {
            Station.StartTimeThread();

            Console.CursorVisible = false;
            ConsoleKeyInfo key;

            key = Console.ReadKey(true);


            if (key.Key == ConsoleKey.C)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, topC, textC);
                ContactDetails cd = new ContactDetails();
                cd.Start();
            }


            else if (key.Key == ConsoleKey.M)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, topM, textM);
                MeetingAppointment ma = new MeetingAppointment();
                ma.Start();
            }


            else if (key.Key == ConsoleKey.R)
            {
                Station.BeepClick();
                Station.StopTimeThread();
                Station.Highlight(39, topR, textR);
                MainMenu mm = new MainMenu();
                mm.Start();
            }


            else
            {
                Station.StopTimeThread();
                top += 4;
                Station.BeepError();
                Console.SetCursorPosition(39, top);
                Console.WriteLine("Invalid Key.");
                Thread.Sleep(200);
                top = 14;
                Console.Clear();
                Start();
            }
        }
Exemplo n.º 2
0
        public void Start()
        {
            Console.Title = "BlueMoon - Add Appointments";

            AddAppointmentHeader();

            OpenStream();

            InputAppointment();

            WriteStream();

            CloseStream();

            MeetingAppointment ma = new MeetingAppointment();

            ma.Start();
        }
Exemplo n.º 3
0
        public void Start()
        {
            Console.Title = "BlueMoon - Delete Appointment";

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

            ac.BlueMoon(3);


            Console.SetCursorPosition(37, 13);
            Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION==========");


            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Press BackSpace to go to previous menu or any key to start delete....");

            Console.CursorVisible = false;
            ConsoleKeyInfo key1;

            key1 = Console.ReadKey(true);

            if (key1.Key == ConsoleKey.Backspace)
            {
                ContactDetails cd2 = new ContactDetails();
                cd2.Start();
                return;
            }

            Console.SetCursorPosition(37, 15);
            Console.WriteLine("                                                                           ");


            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Delete Appointment Menu");



            Console.SetCursorPosition(39, 17);
            Console.WriteLine("       ======Appointment Details======");


            bool writeRow;



            string curPath = Directory.GetCurrentDirectory();

            string path = curPath + "\\Schedule.ebase";

            string tempPath = curPath + "\\temp.txt";

            string[] EbRows = File.ReadAllLines(path);



            Console.SetCursorPosition(39, 19);
            Console.WriteLine("enter the name of the Appointment to delete");

            Console.SetCursorPosition(39, 20);
            // Start add
            string name = Station.MeteredInput(12, 39, 20);


            name = name.ToLower();


            bool editer = true;
            bool found  = false;

            // end add

            string[] fieldName = { "Name", "Year", "Month", "Day", "Hour", "Minute", "Location" };

            List <string> newData = new List <string>();



            while (editer)
            {
                newData = new List <string>();
                //add
                found = false;

                for (int i = 0; i < EbRows.Length; i++)
                {
                    string[] EbCol = EbRows[i].Split('~');
                    writeRow = true;

                    for (int j = 0; j < EbCol.Length; j++)
                    {
                        //Start add
                        if (editer)
                        {
                            string EbColtemp = EbCol[0].ToLower();

                            if (name == EbColtemp || EbColtemp.Contains(name))
                            {
                                found = true;
                                // End add make sure to complete }

                                Console.SetCursorPosition(39, 22);
                                Console.WriteLine("=======Appointment Found=======");

                                EditContactsClear();

                                Console.SetCursorPosition(39, 24);
                                Console.WriteLine("{0,-12} : {1}", fieldName[0], EbCol[0]);

                                Console.SetCursorPosition(39, 25);
                                Console.WriteLine("{0,-12} : {1}", fieldName[1], EbCol[1]);

                                Console.SetCursorPosition(39, 26);
                                Console.WriteLine("{0,-12} : {1}", fieldName[2], EbCol[2]);

                                Console.SetCursorPosition(39, 27);
                                Console.WriteLine("{0,-12} : {1}", fieldName[3], EbCol[3]);

                                Console.SetCursorPosition(39, 28);
                                Console.WriteLine("{0,-12} : {1}", fieldName[4], EbCol[4]);

                                Console.SetCursorPosition(39, 29);
                                Console.WriteLine("{0,-12} : {1}", fieldName[5], EbCol[5]);

                                Console.SetCursorPosition(39, 30);
                                Console.WriteLine("{0,-12} : {1}", fieldName[6], EbCol[6]);



                                Console.SetCursorPosition(15, 32);
                                Console.WriteLine("(Y) Delete Appointment  --  (N) Next Search  --  (AnyKey) Start Again -- (BackSpace) to Return to Menu");


                                Console.CursorVisible = false;
                                ConsoleKeyInfo key;
                                key = Console.ReadKey(true);

                                if (key.Key == ConsoleKey.Y)
                                {
                                    Station.clearRow(15, 32, 105);
                                    Console.SetCursorPosition(30, 32);
                                    Console.WriteLine("Are you sure you want to delete Appointment !! (Y). Yes or anykey to Cancel ?");

                                    Console.CursorVisible = false;
                                    ConsoleKeyInfo key2;
                                    key2 = Console.ReadKey(true);

                                    if (key2.Key == ConsoleKey.Y)
                                    {
                                        writeRow = false;
                                        editer   = false;
                                        Station.clearRow(30, 32, 90);
                                    }
                                    else if (key2.Key != ConsoleKey.Y)
                                    {
                                        MainMenu ddc = new MainMenu();
                                        ddc.Start();
                                    }
                                }
                                else if (key.Key == ConsoleKey.N)
                                {
                                    break;
                                }
                                else if (key.Key == ConsoleKey.Backspace)
                                {
                                    MeetingAppointment ma1 = new MeetingAppointment();
                                    ma1.Start();
                                }
                                else
                                {
                                    DeleteAppointments da1 = new DeleteAppointments();
                                    da1.Start();
                                }
                            }
                        }
                    }

                    if (writeRow)
                    {
                        newData.Add(EbRows[i]);
                    }
                }

                if (!found)
                {
                    Console.SetCursorPosition(48, 27);
                    Console.Write("Appointment Not Found");
                    Thread.Sleep(500);
                    Start();
                }
            }

            string[] newDataarr = newData.ToArray();



            File.WriteAllLines(tempPath, newDataarr);

            File.Delete("Schedule.ebase");
            Station.Blink("Deleting Appointment Information.............", 5000, 39, 33);
            File.Move("temp.txt", "Schedule.ebase");


            MeetingAppointment ma2 = new MeetingAppointment();

            ma2.Start();
        }
Exemplo n.º 4
0
        public void Start()
        {
            Console.Title = "BlueMoon - View Appointments";

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

            ac.BlueMoon(3);


            Console.SetCursorPosition(37, 13);
            Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION==========");


            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Press any Key to View Appointments....");
            Console.ReadKey(true);



            Console.SetCursorPosition(39, 17);
            Console.WriteLine("       ======Appointment Details======");



            string curPath = Directory.GetCurrentDirectory();

            string path = curPath + "\\Schedule.ebase";


            string[] EbRows = File.ReadAllLines(path);

            string[] fieldName = { "Name of appointment", "Year", "Month", "Day", "Hour", "Minute", "Location" };

            int topDisplay   = 20;
            int leftDisplay  = 0;
            int countingLeft = 1;
            //int countingtop = 0;
            int displaySet = 0;

            // Move logged in to upper left
            Console.MoveBufferArea(0, 38, 40, 2, 1, 2);

            Station.StopTimeThread();

            int initial = EbRows.Length - 1;

            for (int q = initial; q >= 0; q--)
            {
                string[] EbCol = EbRows[q].Split('~');


                countingLeft++;

                if (countingLeft % 2 == 0)
                {
                    leftDisplay = 5;
                }
                else
                {
                    leftDisplay = 62;
                    topDisplay  = displaySet;
                }

                displaySet = topDisplay;

                for (int i = 0; i < EbCol.Length; i++)
                {
                    Console.SetCursorPosition(leftDisplay, topDisplay);
                    Console.WriteLine("{0,-20} : {1}", fieldName[i], EbCol[i]);
                    topDisplay++;
                }



                topDisplay += 2;
            }

            int count = displaySet;

            Station.BorderThread(2, 18, 115, count, 10);
            Console.CursorVisible = false;

            int leftB = 60;
            int topB  = 18;

            for (int i = 0; i < count; i++)
            {
                Console.SetCursorPosition(leftB, topB);
                Console.Write("|");
                topB++;
            }

            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Press any Key to Return to previous Menu....");
            Console.ReadKey(true);


            MeetingAppointment ma = new MeetingAppointment();

            ma.Start();
        }
Exemplo n.º 5
0
        public void Start()
        {
            Console.Title = "BlueMoon - Search Appointments";

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

            ac.BlueMoon(3);


            Console.SetCursorPosition(37, 13);
            Console.WriteLine("==========PERSONAL ASSISTANT APPLICATION==========");


            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Press BackSpace to go to previous menu or any key to start Search....");

            Console.CursorVisible = false;
            ConsoleKeyInfo key1;

            key1 = Console.ReadKey(true);

            if (key1.Key == ConsoleKey.Backspace)
            {
                MeetingAppointment ma1 = new MeetingAppointment();
                ma1.Start();
                return;
            }

            Console.SetCursorPosition(37, 15);
            Console.WriteLine("                                                                           ");


            Console.SetCursorPosition(37, 15);
            Console.WriteLine("Search Appointments Menu");



            string curPath = Directory.GetCurrentDirectory();

            string path = curPath + "\\Schedule.ebase";

            string[] EbRows = File.ReadAllLines(path);



            Console.SetCursorPosition(39, 19);
            Console.WriteLine("enter the name of the Appointments to search");
            Console.SetCursorPosition(39, 20);
            // Start add
            string name = Station.MeteredInput(12, 39, 20);


            name = name.ToLower();


            bool editer = true;
            bool found  = false;

            // end add
            string[] fieldName = { "Name", "Year", "Month", "Day", "Hour", "Minute", "Location" };

            while (editer)
            {
                //add
                found = false;

                for (int i = 0; i < EbRows.Length; i++)
                {
                    string[] EbCol = EbRows[i].Split('~');


                    for (int j = 0; j < EbCol.Length; j++)
                    {
                        //Start add
                        if (editer)
                        {
                            string EbColtemp = EbCol[0].ToLower();

                            if (name == EbColtemp || EbColtemp.Contains(name))
                            {
                                found = true;
                                // End add make sure to complete }
                                Console.SetCursorPosition(39, 22);
                                Console.WriteLine("=======Appointments Found=======");

                                EditContactsClear();

                                Console.SetCursorPosition(39, 24);
                                Console.WriteLine("{0,-12} : {1}", fieldName[0], EbCol[0]);

                                Console.SetCursorPosition(39, 25);
                                Console.WriteLine("{0,-12} : {1}", fieldName[1], EbCol[1]);

                                Console.SetCursorPosition(39, 26);
                                Console.WriteLine("{0,-12} : {1}", fieldName[2], EbCol[2]);

                                Console.SetCursorPosition(39, 27);
                                Console.WriteLine("{0,-12} : {1}", fieldName[3], EbCol[3]);

                                Console.SetCursorPosition(39, 28);
                                Console.WriteLine("{0,-12} : {1}", fieldName[4], EbCol[4]);

                                Console.SetCursorPosition(39, 29);
                                Console.WriteLine("{0,-12} : {1}", fieldName[5], EbCol[5]);

                                Console.SetCursorPosition(39, 30);
                                Console.WriteLine("{0,-12} : {1}", fieldName[6], EbCol[6]);


                                Console.SetCursorPosition(25, 32);
                                Console.WriteLine("(Backspace) to return   --   (N) to Next Search    --   (any key) to start again");

                                Console.CursorVisible = false;
                                ConsoleKeyInfo key;
                                key = Console.ReadKey(true);

                                if (key.Key == ConsoleKey.Backspace)
                                {
                                    Station.clearRow(25, 32, 90);
                                    editer = false;
                                }
                                else if (key.Key == ConsoleKey.N)
                                {
                                    break;
                                }
                                else
                                {
                                    SearchAppointments sa2 = new SearchAppointments();
                                    sa2.Start();
                                }
                            }
                        }
                    }
                }

                if (!found)
                {
                    Console.SetCursorPosition(48, 27);
                    Console.Write("Contact Not Found");
                    Thread.Sleep(500);
                    Start();
                }
            }

            MeetingAppointment ma2 = new MeetingAppointment();

            ma2.Start();
        }