Esempio n. 1
0
 public string NewStudent(StudentSummary studentSummary)
 {
     if (Summaries.Count > 0)
     {
         studentSummary.ID = Summaries.Max(x => x.ID) + StudentConsts.IDStep;
     }
     else
     {
         studentSummary.ID = StudentConsts.IDStep;
     }
     Add(studentSummary);
     WriteSummariesToFile();
     return(StudentConsts.ResultOK);
 }
Esempio n. 2
0
        public string StudentOut(StudentSummary DeleteSummary)
        {
            StudentSummary CurrentSummary = GetStudentSummaryByID(DeleteSummary.ID);

            if (CurrentSummary != null)
            {
                Delete(CurrentSummary);
                WriteSummariesToFile();
                return(StudentConsts.ResultOK);
            }
            else
            {
                return(StudentConsts.NotFound);
            }
        }
Esempio n. 3
0
        public string ChangeStudentInfo(StudentSummary NewSummary)
        {
            StudentSummary CurrentSummary = GetStudentSummaryByID(NewSummary.ID);

            if (CurrentSummary != null)
            {
                Update(NewSummary);
                WriteSummariesToFile();
                return(StudentConsts.ResultOK);
            }
            else
            {
                return(StudentConsts.NotFound);
            }
        }
Esempio n. 4
0
        public StudentSummary StudentInfo(int ID)
        {
            StudentSummary CurrentSummary = GetStudentSummaryByID(ID);

            return(CurrentSummary);
        }