<repo_name>TaniaVarduca/Lucrari-licenta<file_sep>/ContinutTabel.java
package View;

import Controller.*;
import Domain.*;
import Repository.*;

import java.text.DecimalFormat;

import java.lang.reflect.Array;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

public class ContinutTabel {
    
    public static void afisStudenti(List<Student> studentList){
        for (int i = 0; i < studentList.size(); i++)
            System.out.format("|%11d|%-10s|%-10s|%-26s|%10d|\n",studentList.get(i).getIDstudent(), studentList.get(i).getNume(), studentList.get(i).getPrenume(), studentList.get(i).getTitluLucrare(), studentList.get(i).getSustinut());

    }

    public static void afisProfesori(List<Profesor> profList){
        for (int i = 0; i < profList.size(); i++)
            System.out.format("|%12d|%10s \n",profList.get(i).getIDprofesor(), profList.get(i).getNume());
    }
    
    public static void afisTeme(List<Tema> temaList){
        for (int i = 0; i < temaList.size(); i++)
            System.out.format("|%8s|%-22s|%-10s|%-15s\n",temaList.get(i).getIDtema(), temaList.get(i).getTitlu(), temaList.get(i).getTip(), temaList.get(i).getNumeProf());
    }
    
    public static void afisTemeProf(List<Tema> temaList, String numeProf){
        for (int i = 0; i < temaList.size(); i++)
        	if(numeProf.equals(temaList.get(i).getNumeProf()))
        		System.out.format("|%8s|%-22s|%-10s|%-15s\n",temaList.get(i).getIDtema(), temaList.get(i).getTitlu(), temaList.get(i).getTip(), temaList.get(i).getNumeProf());
    }
    
    public static void afisStudentiProf(List<Student> studentList, List<Tema> temaList, String numeProf){
    	for (int i = 0; i < temaList.size(); i++)
        	if(numeProf.equals(temaList.get(i).getNumeProf()))
        		for(int j = 0;j < studentList.size(); j++)
        			if(studentList.get(j).getTitluLucrare().equals(temaList.get(i).getTitlu()))
        				System.out.format("|%11d|%-10s|%-10s|%-26s|%10d|\n",studentList.get(j).getIDstudent(), studentList.get(j).getNume(), studentList.get(j).getPrenume(), studentList.get(j).getTitluLucrare(), studentList.get(j).getSustinut());
    }
}<file_sep>/Student.java
package Domain;

public class Student {
	private int IDstudent = 0;				//initializare cod student
	private String nume = null;				//initializare nume
	private String prenume = null;			//initializare prenume
	private String titluLucrare = null;		//initializare titluLucrare
	private int sustinut = 0;				//initializare sustinut
  
	public Student(){	//constructor implicit
	}

	public Student(int IDstudent, String nume, String prenume, String titluLucrare, int sustinut){ //constr. cu parametri
		this.IDstudent = IDstudent;
		this.nume = nume;
		this.prenume = prenume;
		this.titluLucrare = titluLucrare;
		this.sustinut = sustinut;
	}
 
	public int getIDstudent() {		//get IDstudent
		return IDstudent;
	}
	
	public void setIDstudent(int IDstudent) {	//set IDstudent
		this.IDstudent = IDstudent;
	}
	
	public String getNume() {	//get nume
		return nume;
	}
	
	public void setNume(String nume) {	//set nume
		this.nume = nume;
	}
	
	public String getPrenume() {	//get prenume
		return prenume;
	}
	
	public void setPrenume(String prenume) {	//set prenume
		this.prenume = prenume;
	}
	
	public String getTitluLucrare() {	//get titluLucrare
		return titluLucrare;
	}
	
	public void setTitluLucrare(String titluLucrare) {	//set titluLucrare
		this.titluLucrare = titluLucrare;
	}
	
	public int getSustinut() {		//get sustinut
		return sustinut;
	}
	
	public void setSustinut(int sustinut) {	//set IDstudent
		this.sustinut = sustinut;
	}
	
	public String toString() {		//afisare string
		return IDstudent + "," + nume + "," + prenume + "," + titluLucrare + ","+ sustinut;
	}
}
<file_sep>/UpdateStudent.java
package UI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import Controller.ControllerStudent;
import Repository.RepoStudent;

import javax.swing.JTextPane;
import java.awt.Font;
import java.awt.Image;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.awt.Color;

import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class UpdateStudent extends JFrame {
	
	RepoStudent repo_stud = new RepoStudent("C:\\Users\\TANIA\\eclipse-workspace\\lab5\\src\\Studenti.txt");
    private  ControllerStudent ctrl_stud = new ControllerStudent(repo_stud);

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	Image image = null;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UpdateStudent frame = new UpdateStudent();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public UpdateStudent() {
		ctrl_stud.readFromFile_Student();
		
		setTitle("Adaugare student");
		//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 470, 605);
		contentPane = new JPanel();
		contentPane.setBackground(new Color(245, 245, 220));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JTextPane txtpnIntroducetiDatelePentru = new JTextPane();
		txtpnIntroducetiDatelePentru.setBackground(new Color(224, 255, 255));
		txtpnIntroducetiDatelePentru.setFont(new Font("Sitka Small", Font.PLAIN, 19));
		txtpnIntroducetiDatelePentru.setBounds(41, 41, 377, 44);
		txtpnIntroducetiDatelePentru.setText("Introduceti datele pentru modificare:");
		txtpnIntroducetiDatelePentru.setEditable(false);
		contentPane.add(txtpnIntroducetiDatelePentru);
		
		JTextPane txtpnId = new JTextPane();
		txtpnId.setFont(new Font("Sitka Small", Font.BOLD, 17));
		txtpnId.setText("ID:");
		txtpnId.setBounds(55, 134, 40, 28);
		contentPane.add(txtpnId);
		
		JTextPane txtpnNume = new JTextPane();
		txtpnNume.setFont(new Font("Sitka Text", Font.BOLD, 17));
		txtpnNume.setText("Nume:");
		txtpnNume.setBounds(55, 192, 61, 28);
		contentPane.add(txtpnNume);
		
		JTextPane txtpnPrenume = new JTextPane();
		txtpnPrenume.setFont(new Font("Sitka Text", Font.BOLD, 17));
		txtpnPrenume.setText("Prenume:");
		txtpnPrenume.setBounds(55, 247, 87, 28);
		contentPane.add(txtpnPrenume);
		
		JTextPane txtpnTitluLucrare = new JTextPane();
		txtpnTitluLucrare.setFont(new Font("Sitka Text", Font.BOLD, 17));
		txtpnTitluLucrare.setText("Titlu lucrare:");
		txtpnTitluLucrare.setBounds(55, 309, 124, 28);
		contentPane.add(txtpnTitluLucrare);
		
		JTextPane txtpnSustinut = new JTextPane();
		txtpnSustinut.setFont(new Font("Sitka Text", Font.BOLD, 17));
		txtpnSustinut.setText("   Sustinut \r\n(1=da/0=nu):");
		txtpnSustinut.setBounds(55, 366, 122, 54);
		contentPane.add(txtpnSustinut);
		
		textField = new JTextField();
		textField.setColumns(10);
		textField.setBounds(243, 134, 108, 28);
		contentPane.add(textField);
		
		textField_1 = new JTextField();
		textField_1.setColumns(10);
		textField_1.setBounds(243, 192, 108, 28);
		contentPane.add(textField_1);
		
		textField_2 = new JTextField();
		textField_2.setColumns(10);
		textField_2.setBounds(243, 247, 108, 28);
		contentPane.add(textField_2);
		
		textField_3 = new JTextField();
		textField_3.setColumns(10);
		textField_3.setBounds(243, 309, 108, 28);
		contentPane.add(textField_3);
		
		textField_4 = new JTextField();
		textField_4.setColumns(10);
		textField_4.setBounds(243, 372, 108, 28);
		contentPane.add(textField_4);
		
		JButton btnNewButton = new JButton("Update student");
		btnNewButton.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				JOptionPane.showMessageDialog(null, "Studentul a fost updatat!");
			}
		});
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {

				int id = Integer.parseInt(textField.getText());
		        String nume = textField_1.getText();
		        String prenume = textField_2.getText();
		        String titlu = textField_3.getText();
		        int sustinut = Integer.parseInt(textField_4.getText());
		        if (nume.equals("")) {
                	nume = ctrl_stud.searchByCodStudent_Obiect(id).getNume();
                }
		        if (prenume.equals("")) {
                	prenume = ctrl_stud.searchByCodStudent_Obiect(id).getPrenume();
                }
		        if (titlu.equals("")) {
		        	titlu = ctrl_stud.searchByCodStudent_Obiect(id).getTitluLucrare();
                }
                try {                	
                    ctrl_stud.updateStudent(id, nume, prenume, titlu, sustinut);
                } catch (Exception e) {
                	e.getMessage();
                }
                
			}
		});
		btnNewButton.setFont(new Font("Tw Cen MT Condensed", Font.BOLD, 20));
		btnNewButton.setBounds(142, 475, 152, 44);
		contentPane.add(btnNewButton);
		
		
	}
	
	/*
    Descriere: citeste un numar natural
    Input: String sir
    Output: int
     */



	public int ReadNaturalNumber(String sir) {
        System.out.println(sir);
        int n = -1;
        while (n < 0) {
            InputStreamReader reader = new InputStreamReader(System.in);
            BufferedReader buff = new BufferedReader(reader);
            try {
                String text = buff.readLine();
                n = Integer.parseInt(text);
                if (n < 0)
                    System.out.println("Introduceti un numar mai mare ca 0!");
            } catch (IOException e) {

                System.out.println("Introduceti un numar pozitiv" + e.getMessage());
            } catch (NumberFormatException ex) {

                System.out.println("Introduceti un numar pozitiv" + ex.getMessage());
            }
        }
        return n;
    }

    /*
    Descriere: citeste un string
    Input: String sir
    Output: String
     */

    public String ReadString(String sir) {
        System.out.println(sir);
        InputStreamReader reader = new InputStreamReader(System.in);
        BufferedReader buff = new BufferedReader(reader);
        String text = "";
        try {
            text = buff.readLine();
        } catch (IOException e) {

            System.out.println("Eroare la citire!" + e.getMessage());
        }
        return text;
    }
}
<file_sep>/ShowProfesori.java
package UI;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;

import Domain.Profesor;
import Controller.ControllerProfesor;
import Repository.RepoProfesor;
import javax.swing.UIManager;

public class ShowProfesori extends JFrame {

	RepoProfesor repo_prof = new RepoProfesor("C:\\Users\\TANIA\\eclipse-workspace\\lab5\\src\\Profesori.txt");
    private  ControllerProfesor ctrl_prof = new ControllerProfesor(repo_prof);
    
    
	private JPanel contentPane;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ShowStudenti frame = new ShowStudenti();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public ShowProfesori() {
		setTitle("<NAME>");
		setBounds(100, 100, 820, 287);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		ctrl_prof.readFromFile_Profesor();
        List<Profesor> listProfesor = new ArrayList<>();
        listProfesor = ctrl_prof.getAll();
		
		String[] columnNames = 
				{"ID",
                "NUME SI PRENUME"};
		
		Object[][] data = new Object[listProfesor.size()+1][2];
		
		data[0][0] = "ID";
		data[0][1] = "NUME SI PRENUME";
		
		for (int i = 1; i < listProfesor.size()+1; i++) {
				data[i][0] = listProfesor.get(i-1).getIDprofesor();
				data[i][1] = listProfesor.get(i-1).getNume();
		}
		
		table = new JTable(data,columnNames);
		table.setFont(new Font("Arial",3, 15));
		table.setBackground(UIManager.getColor("info"));
		contentPane.add(table, BorderLayout.CENTER);
		}
}
<file_sep>/Profesor.java
package Domain;

public class Profesor {
	private int IDprofesor = 0;
	private String nume = null;	
  
	public Profesor(){	//constructor implicit
	}

	public Profesor(int IDprofesor, String nume){ //constr. cu parametri
		this.IDprofesor = IDprofesor;
		this.nume = nume;
	}
 
	public int getIDprofesor() {	//get IDprofesor
		return IDprofesor;
	}
	
	public void setIDprofesor(int IDprofesor) {	//set IDprofesor
		this.IDprofesor = IDprofesor;
	}
	
	public String getNume() {	//get nume
		return nume;
	}
	
	public void setNume(String nume) {	//set nume
		this.nume = nume;
	}
	
	
	public String toString() {		//afisare string
		return IDprofesor + "," + nume;
	}
}
<file_sep>/README.md
# Lucrari-licenta
Gestionarea lucrarilor de licenta si master
<file_sep>/CapTabel.java
package View;

import Domain.Student;
import Domain.Profesor;

import java.util.List;

public class CapTabel {
    
    public static void afisStudenti1() {
        System.out.println();
        System.out.println("=========================================================================");
        System.out.format("|%10s|%7s   |%8s  |%20s      |%9s |\n", "Cod student", "Nume", "Prenume", "Titlu lucrare", "Sustinut");

        System.out.println("=========================================================================");
    }

    public static void afisStudenti2() {
        System.out.println("=========================================================================");
        System.out.println();
    }
   
    public static void afisProfesori1() {
        System.out.println();
        System.out.println("==================================");
        System.out.format("|%10s|  %10s  |\n", "Cod profesor", "Nume si prenume");

        System.out.println("==================================");
    }

    public static void afisProfesori2() {
        System.out.println("==================================");
        System.out.println();
    }
    
    public static void afisTeme1() {
        System.out.println();
        System.out.println("=============================================================");
        System.out.format("|%8s|%14s        |%7s   |%15s  |\n", "Cod tema", "Titlu", "Tip", "Nume Profesor");

        System.out.println("=============================================================");
    }

    public static void afisTeme2() {
        System.out.println("=============================================================");
        System.out.println();
    }
}
<file_sep>/UI.java
package UI;

import Controller.*;
import Domain.Student;
import Domain.Profesor;

import java.io.*;
import java.util.ArrayList;
import java.time.LocalDate;
import java.util.List;

import View.*;

public class UI {
	
    private ControllerStudent ctrl_stud;
    private ControllerProfesor ctrl_prof;
    private ControllerTema ctrl_tema;

    public UI(ControllerStudent ctrl_stud, ControllerProfesor ctrl_prof, ControllerTema ctrl_tema) {
        this.ctrl_stud = ctrl_stud;
        this.ctrl_prof = ctrl_prof;
        this.ctrl_tema = ctrl_tema;
    }

    public int ReadNaturalNumber(String sir) {
        System.out.println(sir);
        int n = -1;
        while (n < 0) {
            InputStreamReader reader = new InputStreamReader(System.in);
            BufferedReader buff = new BufferedReader(reader);
            try {
                String text = buff.readLine();
                n = Integer.parseInt(text);
                if (n < 0)
                    System.out.println("Introduceti un numar mai mare ca 0!");
            } catch (IOException e) {

                System.out.println("Introduceti un numar pozitiv" + e.getMessage());
            } catch (NumberFormatException ex) {

                System.out.println("Introduceti un numar pozitiv" + ex.getMessage());
            }
        }
        return n;
    }

    public String ReadString(String sir) {
        System.out.println(sir);
        InputStreamReader reader = new InputStreamReader(System.in);
        BufferedReader buff = new BufferedReader(reader);
        String text = "";
        try {
            text = buff.readLine();
        } catch (IOException e) {

            System.out.println("Eroare la citire!" + e.getMessage());
        }
        return text;
    }

    public void MeniuPrincipal() {
        System.out.println("---------- MENIU PRINCIPAL ----------");
        System.out.println("            a. Studenti");
        System.out.println("            b. Profesori");
        System.out.println("            c. Teme");
        System.out.println("            x. Iesire");
        System.out.println("-------------------------------------");
    }

    public void MeniuStudent() {
        System.out.println("--------------- MENIU ----------------");
        System.out.println("            1. Adaugare Student");
        System.out.println("            2. Update Student");
        System.out.println("            3. Stergere Student");
        System.out.println("            4. Afisare lista Studenti");
        System.out.println("            5. Afisare lista Studenti care si-au sustinut lucrarea");
        System.out.println("            6. Afisare lista Studenti care nu si-au sustinut lucrarea");
        System.out.println("            7. Afisare lista Studenti care nu s-au inscris pe liste");
        System.out.println("            0. Inapoi");
        System.out.println("-------------------------------------");
    }

    public void MeniuProfesor() {
        System.out.println("--------------- MENIU ----------------");
        System.out.println("            1. Adaugare Profesor");
        System.out.println("            2. Afisare lista Profesori");
        System.out.println("            3. Afisare lista teme pentru un Profesor");
        System.out.println("            4. Afisare lista studenti asignati la un Profesor");
        System.out.println("            0. Inapoi");
        System.out.println("-------------------------------------");
    }
    
    public void MeniuTema() {
        System.out.println("--------------- MENIU ----------------");
        System.out.println("            1. Adaugare Tema");
        System.out.println("            2. Afisare lista Teme");
        System.out.println("            0. Inapoi");
        System.out.println("-------------------------------------");
    }
    
    public void runStudent() {
        MeniuStudent();
        int option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        ctrl_stud.readFromFile_Student();
        ctrl_prof.readFromFile_Profesor();
        ctrl_tema.readFromFile_Tema();
        while (option != 0) {
            switch (option) {
                case 1:
                	int IDstudent = ReadNaturalNumber("Introduceti codul studentului: ");
                    String nume = ReadString("Introduceti numele studentului: ");
                    String prenume = ReadString("Introduceti prenumele studentului: ");
                    String titluLucrare = ReadString("Introduceti titlul lucrarii: ");  
                    int sustinut = ReadNaturalNumber("Lucrare sustinuta=1/nesustinuta=0: ");
                    try {
                        ctrl_stud.addStudent(IDstudent, nume, prenume, titluLucrare, sustinut);
                    } catch (Exception e) {
                        e.getMessage();
                    }
                    break;
                case 2:
                    int codStudent = ReadNaturalNumber("Introduceti codul studentului: ");
                    if (ctrl_stud.searchByCodStudent(codStudent)) {
                        String nume1 = ReadString("Introduceti numele studentului: ");
                        String prenume1 = ReadString("Introduceti prenumele studentului: ");
                        String titluLucrare1 = ReadString("Introduceti titlul lucrarii: ");
                        int sustinut1 = ReadNaturalNumber("Lucrare sustinuta=1/nesustinuta=0: ");
                        if (nume1.equals("")) {
                        	nume1 = ctrl_stud.searchByCodStudent_Obiect(codStudent).getNume();
                        }
                        if (prenume1.equals("")) {
                        	prenume1 = ctrl_stud.searchByCodStudent_Obiect(codStudent).getPrenume();
                        }
                        if (titluLucrare1.equals("")) {
                        	titluLucrare1 = ctrl_stud.searchByCodStudent_Obiect(codStudent).getTitluLucrare();
                        }
                        if (String.valueOf(sustinut1).equals("")) {
                        	sustinut1 = ctrl_stud.searchByCodStudent_Obiect(codStudent).getSustinut();
                        }
                        ctrl_stud.updateStudent(codStudent, nume1, prenume1, titluLucrare1, sustinut1);
                    } else {
                        System.out.println("Nu exista codul introdus! ");
                    }
                    break;
                case 3:
                    int codStudent1 = ReadNaturalNumber("Introduceti codul studentului: ");
                    try {

                        if (ctrl_stud.searchByCodStudent(codStudent1)) {
                            List<Student> lista_stud = ctrl_stud.getAllCod(codStudent1);
                            for (int i = 0; i < lista_stud.size(); i++) {
                                ctrl_stud.deleteStudent(codStudent1);
                            }
                            ctrl_stud.deleteStudent(codStudent1);
                        }
                    } catch (Exception e) {
                        System.out.println(e.getMessage());
                    }
                    break;
                case 4:
                    CapTabel.afisStudenti1();
                    ContinutTabel.afisStudenti(ctrl_stud.getAll());
                    CapTabel.afisStudenti2();
                    break;
                case 5:
                    CapTabel.afisStudenti1();
                    ContinutTabel.afisStudenti(ctrl_stud.getAllSustinut());
                    CapTabel.afisStudenti2();
                    break;
                case 6:
                    CapTabel.afisStudenti1();
                    ContinutTabel.afisStudenti(ctrl_stud.getAllNuSustinut());
                    CapTabel.afisStudenti2();
                    break;
                case 7:
                    CapTabel.afisStudenti1();
                    ContinutTabel.afisStudenti(ctrl_stud.getAllNeinscris());
                    CapTabel.afisStudenti2();
                    break;
                case 0:
                    break;
                default:
                    System.out.println("Optiune gresita!");
                    break;
            }
            MeniuStudent();
            option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        }
    }

    public void runProfesor() {
        MeniuProfesor();
        int option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        ctrl_stud.readFromFile_Student();
        ctrl_prof.readFromFile_Profesor();
        ctrl_tema.readFromFile_Tema();
        while (option != 0) {
            switch (option) {
                case 1:
                	int IDprofesor = ReadNaturalNumber("Introduceti codul profesorului: ");
                    String nume = ReadString("Introduceti numele profesorului: ");
                    try {
                        ctrl_prof.addProfesor(IDprofesor, nume);
                    } catch (Exception e) {
                        e.getMessage();
                    }
                    break;
                case 2:
                    CapTabel.afisProfesori1();
                    ContinutTabel.afisProfesori(ctrl_prof.getAll());
                    CapTabel.afisProfesori2();
                    break;
                case 3:
                	String nume1 = ReadString("Introduceti numele profesorului: ");
                    CapTabel.afisTeme1();
                    ContinutTabel.afisTemeProf(ctrl_tema.getAll(), nume1);
                    CapTabel.afisTeme2();
                    break;
                case 4:
                	String nume2 = ReadString("Introduceti numele profesorului: ");
                    CapTabel.afisStudenti1();
                    ContinutTabel.afisStudentiProf(ctrl_stud.getAll(), ctrl_tema.getAll(), nume2);
                    CapTabel.afisStudenti2();
                    break;
                case 0:
                    break;
                default:
                    System.out.println("Optiune gresita!");
                    break;
            }
            MeniuProfesor();
            option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        }
    }
     
    public void runTema() {
        MeniuTema();
        int option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        ctrl_stud.readFromFile_Student();
        ctrl_prof.readFromFile_Profesor();
        ctrl_tema.readFromFile_Tema();
        while (option != 0) {
            switch (option) {
                case 1:
                	int IDtema = ReadNaturalNumber("Introduceti codul temei: ");
                    String titlu = ReadString("Introduceti titlul temei: ");
                    String tip = ReadString("Introduceti tipul temei (licenta/dizertatie): ");
                    String numeProf = ReadString("Introduceti numele profesorului: ");
                    try {
                        ctrl_tema.addTema(IDtema, titlu, tip, numeProf);
                    } catch (Exception e) {
                        e.getMessage();
                    }
                    break;
                case 2:
                    CapTabel.afisTeme1();
                    ContinutTabel.afisTeme(ctrl_tema.getAll());
                    CapTabel.afisTeme2();
                    break;
                case 0:
                    break;
                default:
                    System.out.println("Optiune gresita!");
                    break;
            }
            MeniuTema();
            option = ReadNaturalNumber("Introduceti optiunea dorita: ");
        }
    }
    
    public void runApp() {
        MeniuPrincipal();
        String option_principal = ReadString("Introduceti optiunea dorita: ");
        String out_option = new String("x");
        while (!(option_principal.equals(out_option))) {
            switch (option_principal) {
                case "a":
                    runStudent();
                    break;
                case "b":
                	runProfesor();
                	break;
                case "c":
                	runTema();
                	break;
                case "x":
                    break;
                default:
                    System.out.println("Optiune gresita!");
                    break;
            }
            MeniuPrincipal();
            option_principal = ReadString("Introduceti optiunea dorita: ");
        }
        System.out.println("Program terminat!");
    }
}