Exemplo n.º 1
0
        public static void Init(MySqlConnection conn, string role, string username, string password)
        {
            int line;

            switch (role)
            {
            case "doctor":
                Doctor doctor = new Doctor(username, password);
                doctor.ActivCommands();
                line = Convert.ToInt16(Console.ReadLine());
                switch (line)
                {
                case 2:
                    doctor.MyRequest(conn, doctor);
                    Start(true);
                    break;

                case 3:
                    doctor.PatientHistory(conn, doctor);
                    Console.WriteLine();
                    Start(true);
                    break;
                }
                break;

            case "patient":
                Patient patient = new Patient(username, password);
                patient.ActivCommands();
                line = Convert.ToInt16(Console.ReadLine());
                switch (line)
                {
                case 1:
                    patient.RequestForConsultation(conn, patient);
                    break;

                case 2:
                    patient.MyRequest(conn, patient);
                    Start(true);
                    break;

                case 3:
                    patient.PatientHistory(conn, patient);
                    break;
                }
                break;

            case "admin":
                Admin admin = new Admin(username, password);
                admin.ActivCommands();
                line = Convert.ToInt16(Console.ReadLine());
                switch (line)
                {
                case 1:
                    Console.Write("Username: "******"Username: "******"");
                    Console.Write("Password: "******"Password: "******"");
                    Console.Write("Proffesion: ");
                    string profession = Console.ReadLine().Replace("Proffesion: ", "");
                    admin.AddDoctor(conn, username, password, profession);
                    Start(true);
                    break;

                case 2:
                    //admin.MyRequest(conn, patient);
                    break;
                }
                break;
            }

            Console.ReadLine();
        }