コード例 #1
0
        public ViewStudentInformation GetStudentInformation(string regNo)
        {
            aStudentGateway = new StudentGateway();

            return aStudentGateway.GetStudentInfo(regNo);
        }
コード例 #2
0
        public string GetStudentRegistationNO(Student aStudent)
        {
            string regNo = "";
            int id;
            aStudentGateway = new StudentGateway();
            id = aStudentGateway.GetStudentRegistationNO(aStudent);
            if (id < 10)
                regNo = "000" + id;
            if (id >= 10 && id < 100)
                regNo = "00" + id;
            if (id >= 100 && id < 1000)
                regNo = "0" + id;
            if (id >= 1000)
                regNo = id.ToString();

            return regNo;
        }
コード例 #3
0
 public Student GetStudentInformation(string regNo, int depeartmentId)
 {
     aStudentGateway = new StudentGateway();
     return aStudentGateway.GetStudentInformation(regNo, depeartmentId);
 }
コード例 #4
0
 public List<Course> GetStudentCourses(string regNo)
 {
     aStudentGateway = new StudentGateway();
     return aStudentGateway.GetStudentCourses(regNo);
 }
コード例 #5
0
 private bool DoesThisEmailExist(Student aStudent)
 {
     aStudentGateway = new StudentGateway();
     List<string> emails = new List<string>();
     emails = aStudentGateway.GetStudentEmails();
     foreach (string email in emails)
     {
         if (email == aStudent.Email)
             return true;
     }
     return false;
 }
コード例 #6
0
 public string SaveStudentCourse(StudentCourse aStudentCourse)
 {
     aStudentGateway = new StudentGateway();
     return aStudentGateway.SaveStudentCourse(aStudentCourse);
 }
コード例 #7
0
 public string SaveStudent(Student aStudent)
 {
     aStudentGateway = new StudentGateway();
     if (!DoesThisEmailExist(aStudent))
         return aStudentGateway.SaveStudent(aStudent);
     else
         return "This Email Already Exist";
 }