Beispiel #1
0
        public bool CazareStudentInCamin(Student stud)
        {
            bool confirmare = false;

            if (locuri_ocupate == null)
            {
                locuri_ocupate = 1;
                student.Add(stud);
                confirmare = true;
            }
            else
            {
                if (locuri_ocupate < nr_locuri)
                {
                    stud.stare = stareCamin.Cazat;
                    student.Add(stud);
                    locuri_ocupate++;
                    confirmare = true;
                }
                else
                {
                    confirmare = false;
                }
            }

            return confirmare;
        }
Beispiel #2
0
 public bool AddStudent(Student stud)
 {
     if (FindStudent(stud))
     {
         return false;
     }
     else
     {
         student.Add(stud);
         return true;
     }
 }
        internal void Cazare(Student stud)
        {
            foreach (var c in camin)
            {
                bool verifica_cazare = false;
                if (stud.stare == stareCamin.Interesat || stud.stare == stareCamin.Fara_loc)
                {
                    if (c.VerificareMedie(stud))
                    {
                        if (c.CazareStudentInCamin(stud))
                        {
                            verifica_cazare = true;
                        }
                    }
                }

                if (verifica_cazare == true)
                {
                    break;
                }
            }
        }
Beispiel #4
0
 public bool FindStudent(Student stud)
 {
     foreach (var s in student)
     {
         if (s.Equals(stud))
         {
             return true;
         }
     }
     return false;
 }
Beispiel #5
0
 public bool VerificareMedie(Student stud)
 {
     if (stud.medie > medie_de_intrare)
         return true;
     else
         return false;
 }
Beispiel #6
0
 public bool RemoveStudent(Student stud)
 {
     if (FindStudent(stud))
     {
         student.Remove(stud);
         return true;
     }
     else
         return false;
 }