public string Execute(IList <string> parameters, ISchoolSystemEngine engine) { var idToRemove = int.Parse(parameters[0]); engine.RemoveStudent(idToRemove); return($"Student with ID {idToRemove} was sucessfully removed."); }
public string Execute(IList <string> parameters, ISchoolSystemEngine engine) { var teacher = SchoolSystemFactory.CreateTeacher(parameters); var id = engine.AddTeacher(teacher); var result = $"A new teacher with name {teacher.FirstName} {teacher.LastName}, subject {teacher.SchoolSubjectType} and ID {id} was created."; return(result); }
public string Execute(IList <string> parameters, ISchoolSystemEngine engine) { var student = SchoolSystemFactory.CreateStudent(parameters); var id = engine.AddStudent(student); var result = $"A new student with name {student.FirstName} {student.LastName}, grade {student.Grade} and ID {id} was created."; return(result); }
public string Execute(IList <string> parameters, ISchoolSystemEngine engine) { var idToFind = int.Parse(parameters[0]); var student = engine.GetStudentWithId(idToFind); var listedMarks = student.ListMarks(); return(listedMarks); }
public string Execute(IList <string> parameters, ISchoolSystemEngine engine) { var teecherid = int.Parse(parameters[0]); var studentid = int.Parse(parameters[1]); var student = engine.GetStudentWithId(studentid); var teacher = engine.GetTeacherWithId(teecherid); var markValue = float.Parse(parameters[2]); var mark = SchoolSystemFactory.CreateMark(markValue); teacher.AddMark(student, mark); var result = $"Teacher {teacher.FirstName} {teacher.LastName} added mark {markValue} to student {student.FirstName} {student.LastName} in {teacher.SchoolSubjectType}."; return(result); }