Exemple #1
0
        public AutentificareClass(string aut,string numeFacultate,string numeAutentificator, Universitate Poli)
        {
            switch (aut)
            {
                case "profesor":
                                bool LogInSucccesfull = false;
            List<Facultate> listaFacultati=new List<Facultate>();
            listaFacultati = Poli.getFacultiesList;
            foreach (Facultate fac in listaFacultati)
            {
                if (fac._getNume == numeFacultate)
                {
                    var Secretariat = fac._getSecr;
                    var listaProfesori = Secretariat.getProfList;
                    var listaMaterii = Secretariat.getMateriiList;
                    var listaStudentiFacultate = Secretariat.getStudentsList;

                    foreach (Profesor prof in listaProfesori)
                    {
                        if (prof.getNumeProf == numeAutentificator)
                        {
                            LogInSucccesfull = true;
                            appProf a = new appProf();
                            fileNameProf = a.cautaStudentiiDeLaMateriaPredata(listaStudentiFacultate,prof.getMateriePredata);
                            Process.Start(fileNameProf);
                        }
                    }
                }

            }
            if (LogInSucccesfull == false)
            {

            }
                    break;
                case "secretara":

            List<Facultate> listaFacultati1=new List<Facultate>();
            listaFacultati = Poli.getFacultiesList;
            foreach (Facultate fac in listaFacultati1)
            {
                if (fac._getNume == numeFacultate)
                {
                  /*  var Secretariat = fac._getSecr;
                    VerificareSituatie ver = new VerificareSituatie();
                    ver.verificaDacaProfesoriiAuIncheiatSituatia(fac._getNume, fac);
                    SecretariatPtSecretara = Secretariat; */
                }
            }

                    break;
                case "administrator":
                    if (numeAutentificator != null)
                    {
                        ;
                    }

                    break;
            }
        }
Exemple #2
0
        public CalculeazaMedia1(Universitate Poli, string NumeFac)
        {
            List<Facultate> lista = Poli.getFacultiesList;
            foreach (Facultate fac in lista)
            {
                if (fac._getNume == NumeFac)
                {
                    Secretariat secr = fac._getSecr;
                    var listaStudenti = secr.getStudentsList;
                    foreach (StudentFacultate stud in listaStudenti)
                    {
                        double medieTotala = 0;
                        int nr_materii = 0;
                        var listaMaterii = stud.getListaMaterii;
                        foreach (MaterieStudent mat in listaMaterii)
                        {
                            medieTotala += mat._media;
                            nr_materii++;
                        }
                        medieTotala = medieTotala / nr_materii;
                        stud._medie = medieTotala;
                    }

                }
            }
            Politehnica = Poli;
        }
Exemple #3
0
 public Form1()
 {
     InitializeComponent();
     Poli = null;
     FacultatePtSecretara = null;
     validate_invalidate_prof_app(false);
     validate_invalidate_secretara_app(false);
     validate_invalidate_administrator_app(false);
     button5.Enabled = false;
 }
Exemple #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     //Init Button
     FactoryClass Init = new FactoryClass();
     Universitate Univ = Init.GetInfoFromFilesAndCreatUniversitate();
     Poli = Univ;
 }
Exemple #5
0
 private void button6_Click(object sender, EventArgs e)
 {
     Centralizare central = new Centralizare(Poli, textBox4.Text);
     Poli=central.Repository;
 }
Exemple #6
0
 private void button5_Click(object sender, EventArgs e)
 {
     CalculeazaMedia1 c = new CalculeazaMedia1(Poli, textBox4.Text);
     Poli = c.repository;
 }
Exemple #7
0
        /*     public List<Profesor> getListFacultati()
        {

            GetInfoFromFiles();
           CitesteFisier readFile = new CitesteFisier();
           //         var lista = readFile.ReadFac();
            var listaProf = readFile.ReadProf("ARH");
            return listaProf;
        }  */
        public Universitate GetInfoFromFilesAndCreatUniversitate( )
        {
            CitesteFisier file=new CitesteFisier();
            List<string> listaNumeFacultati = file.ReadFac();
            List<Student> listaStudUniv = file.ReadStudentUniv();
            List<Facultate> listaFacultati = new List<Facultate>();

            foreach(string numeFac in listaNumeFacultati)
            {
                List<Profesor> listaProfi = file.ReadProf(numeFac);
                List<StudentFacultate> listaStudFacultate = file.ReadStudentFac(numeFac);
                List<Materie> listaMaterii = file.ReadMaterii(numeFac);
                Secretariat sec = new Secretariat(listaStudFacultate, listaProfi, listaMaterii);
                Facultate fac = new Facultate(numeFac, sec);
                listaFacultati.Add(fac);
            }

            Universitate univ = new Universitate("Politehnica Timisoara", listaFacultati, listaStudUniv);

            return univ;
        }