예제 #1
0
        public static bool changeMyInfomation(string id, string Name, string Gender, string Email, string Phone, string BirthDay)
        {
            if (!TeacherBUS.marchEmail(Email))
            {
                return(false);
            }
            if (!TeacherBUS.marchBirthDay(BirthDay))
            {
                return(false);
            }
            TeacherBUS.StandalizedBirthDayToDatabase(ref BirthDay);

            return(AdminDAO.changeMyInfomation(id, Name, Gender, Email, Phone, BirthDay));
        }
예제 #2
0
        public static bool updateInfoStudent(StudentDTO student)
        {
            string birthDay = student.DateofBith;

            if (!TeacherBUS.marchBirthDay(student.DateofBith))
            {
                return(false);
            }

            if (!TeacherBUS.marchEmail(student.Email))
            {
                return(false);
            }

            TeacherBUS.StandalizedBirthDayToDatabase(ref birthDay);
            student.DateofBith = birthDay;
            return(AcademicAffairsOfficeDAO.updateInfoStudent(student));
        }
예제 #3
0
        public static bool addNewStudent(StudentDTO student)
        {
            // kiểm tra định dạng IDStudent
            if (student.Id.Length <= 4)
            {
                return(false);
            }
            if (student.Id[0] != 'H')
            {
                return(false);
            }
            if (student.Id[1] != 'S')
            {
                return(false);
            }

            if (!TeacherBUS.marchBirthDay(student.DateofBith))
            {
                return(false);
            }

            if (!TeacherBUS.marchEmail(student.Email))
            {
                return(false);
            }



            string birthDay = student.DateofBith;

            TeacherBUS.StandalizedBirthDayToDatabase(ref birthDay);
            student.DateofBith = birthDay;

            string currentYear = DateTime.Now.Year.ToString();
            string year        = getYear(birthDay);
            int    age         = int.Parse(currentYear) - int.Parse(year);

            if (age < getMinAge() || age > getMaxAge())
            {
                return(false);
            }

            return(AcademicAffairsOfficeDAO.AddNewStudent(student));
        }