public bool FindStudent(Student stud) { foreach (var s in student) { if (s.Equals(stud)) { return true; } } return false; }
public bool AddStudent(Student stud) { if (FindStudent(stud)) { return false; } else { student.Add(stud); return true; } }
public float ObtineMediaGeneralaAUnuiStudent(Student s) { float medie_generala = 0; foreach (var stud_ in student) { if (stud_.Equals(s)) { medie_generala = stud_.GetMedie_generala(); } } return medie_generala; }
public void AdaugaStudentinBD(Student stud) { //adauga studentul in BD }
public void UpdateStudentinBD(Student stud_) { //Se face update in BD pe studentul primit ca parametru }
public bool RemoveStudent(Student stud) { if (FindStudent(stud)) { student.Remove(stud); return true; } else return false; }
static void studenti() { int selector = 0; int maxItem = 6; Console.WriteLine("STUDENT"); Student student = new Student(); if (student.login() == true) { do { Console.WriteLine("Optiuni Student\n"); Console.WriteLine("1-Vizualizare nivel Secretariat"); Console.WriteLine("2-Vizualizare Nivel Secretariat intermediar"); Console.WriteLine("3-Find anything in Secretariat by Student "); Console.WriteLine("4-Find anything in Secretariat Intermediar by Student "); Console.WriteLine("5-Find anything in Secretariat by facultate "); Console.WriteLine("6-Find anything in Secretariat Intermediere by Facultate "); selector = Convert.ToInt32(Console.ReadLine()); switch (selector) { case 1: { Console.WriteLine("Vizualizare nivel Secretariat"); student.ViewDB(Globals.selectALLFromSecretariat); break; } case 2: Console.WriteLine("Vizualizare Nivel studenti"); break; case 3: break; case 4: break; case 5: break; case 6: break; default: break; } } while (selector != maxItem); } else { Console.WriteLine("Eroare la autentificare"); } }