public string AddStudentMethod(Models.Student.Student student) { var repository = new Repositories.Deanship.RepositoryDeanship(); repository.AdaugaStudent(student); return("Success"); }
public Models.Student.Student FindStudentMethod(string studentName) { var repository = new Repositories.Deanship.RepositoryDeanship(); Models.Student.Student student = repository.GasesteStudentDupaNume(studentName); return(student); }
public string UpdateStudentMethod(Models.Student.Student student) { var repository = new Repositories.Deanship.RepositoryDeanship(); repository.ActualizeazaStudent(student); return("Success"); }
public void AdaugaStudent(Models.Student.Student student) { var result = _student.FirstOrDefault(d => d.Equals(student)); if (result != null) { throw new DuplicateWaitObjectException(); } _student.Add(student); Console.WriteLine("Un nou Student a fost adaugat."); }
public Models.Student.Student CreateStudent(string reg, string name, int credits) { Contract.Requires <ArgumentNullException>(name != null, "text"); Contract.Requires <ArgumentInvalidLengthException>( name.Length >= 2 && name.Length <= 20, "Numele Studentului trebuie sa contina intre 2 si 20 de caractere."); var student = new Models.Student.Student(new RegistrationNumber(reg), new PlainText(name), new Credits(credits)); return(student); }
public void ActualizeazaStudent(Models.Student.Student student) { Console.WriteLine("Modificarile au fost salvate."); }