public string SaveASubjectGrade(StudentResult aStudentResult)
        {
            aResultGateway = new ResultGateway();

            if (DoesThisSubjectExist(aStudentResult))
                if (DoesThisSubjectResultExist(aStudentResult))
                {
                    if (aStudentResult.GradeLetter == "F")
                        aStudentResult.Status = 1;
                    else
                        aStudentResult.Status = 0;
                    return aResultGateway.SaveASubjectGrade(aStudentResult);
                }

                else
                    return "You already completed this subject";
            else
                return "You Does not Get this Subject";
        }
        private bool DoesThisSubjectResultExist(StudentResult aStudentResult)
        {
            List<StudentResult> studentResults = new List<StudentResult>();
            aResultGateway = new ResultGateway();
            studentResults = aResultGateway.GetSubjectResult(aStudentResult);
            if (studentResults.Count == 0)
                return true;
            foreach (StudentResult studentResult in studentResults)
            {
                if (studentResult.CourseId == aStudentResult.CourseId && studentResult.Status == 1)
                {
                    aResultGateway = new ResultGateway();
                    if (aResultGateway.DeletePreviousReselt(aStudentResult))
                        return true;
                }

            }

            return false;
        }
 public List<ViewCourseGradeAndCredit> GetCourseResult(string regNo)
 {
     aResultGateway = new ResultGateway();
     return aResultGateway.GetCourseResult(regNo);
 }