예제 #1
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 !");
        }
        public void createadmin()
        {
            AdminClass admin = new AdminClass();

            Console.WriteLine("New Admin account creating");
            detector();
            admin.admin_username = username;
            admin.admin_password = password;
            admin.admin_name     = name;
            admin.admin_surname  = surname;
            admin.admin_pesel    = pesel;
            admin.writeAdmin();
        }
예제 #3
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;
        }