Ejemplo n.º 1
0
        public void list_doctor()
        {
            Console.WriteLine("\nDoctor accounts listing...");


            CheckFile checkDoctor = new CheckFile();

            if (checkDoctor.checkDoctor())
            {
                return;
            }
            string[] doctorname      = System.IO.File.ReadAllLines("doctorname.txt");
            string[] doctorsurname   = System.IO.File.ReadAllLines("doctorsurname.txt");
            string[] doctorspecialty = System.IO.File.ReadAllLines("doctorspecialty.txt");



            for (int i = 0; i < doctorname.Length; i++)
            {
                Console.WriteLine($"Doctor-{i} --->> Name: {doctorname[i]} --- Surname: {doctorsurname[i]} --- Specialty: {doctorspecialty[i]}");
            }

            if (!File.Exists("doctorschedule.txt"))
            {
                return;
            }
            string[] doctorschedule = System.IO.File.ReadAllLines("doctorschedule.txt");
            Console.WriteLine("\nSchedule Listing for Doctors...");
            for (int i = 0; i < doctorschedule.Length; i++)
            {
                Console.WriteLine(doctorschedule[i]);
            }
            return;
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            CheckFile checkAdmin = new CheckFile();

            checkAdmin.checkAdmin();
            checkAdmin.checkDoctor();
            checkAdmin.checkNurse();

            Console.WriteLine("LOG-IN TO SYSTEM");
            Console.Write("Username:"******"Password:"******"Username or password is not correct !");
        }
Ejemplo n.º 3
0
        public void list_nurse()
        {
            Console.WriteLine("\nNurse accounts listing...");

            CheckFile checkNurse = new CheckFile();

            if (checkNurse.checkNurse())
            {
                return;
            }
            string[] nursename    = System.IO.File.ReadAllLines("nursename.txt");
            string[] nursesurname = System.IO.File.ReadAllLines("nursesurname.txt");

            for (int i = 0; i < nursename.Length; i++)
            {
                Console.WriteLine($"Nurse-{i} --->> Name: {nursename[i]} --- Surname: {nursesurname[i]}");
            }

            if (!File.Exists("nurseschedule.txt"))
            {
                return;
            }
            string[] nurseschedule = System.IO.File.ReadAllLines("nurseschedule.txt");
            Console.WriteLine("\nSchedule Listing for Nurses...");
            for (int i = 0; i < nurseschedule.Length; i++)
            {
                Console.WriteLine(nurseschedule[i]);
            }
            return;
        }
Ejemplo n.º 4
0
        public void nuse_login()
        {
            CheckFile checkNurse = new CheckFile();

            if (checkNurse.checkNurse())
            {
                return;
            }

            int i = 1;
            int k = 1;

            string[] nurseusernames = System.IO.File.ReadAllLines("nurseusername.txt");
            foreach (string username in nurseusernames)
            {
                if (temp_username == username)
                {
                    string[] passwords = System.IO.File.ReadAllLines("nursepassword.txt");

                    foreach (string password in passwords)
                    {
                        if (i == k)
                        {
                            if (temp_password == password)
                            {
                                Console.WriteLine("successfully logged in as a nurse");
                            }
                            AdminClass admin = new AdminClass();
                            admin.list_nurse();
                            admin.list_doctor();
                            Environment.Exit(0);
                        }
                        k++;
                    }
                }
                i++;
            }

            return;
        }