Exemple #1
0
        public static List <TeacherDTO> searchTeacher(string textToSearch, string schoolYear, string position)
        {
            List <TeacherDTO> result = AcademicAffairsOfficeDAO.searchTeacher(textToSearch, schoolYear, position);

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    string birthDay = result[i].DateofBith;
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;

                    if (position == "System.Windows.Controls.ComboBoxItem: All")
                    {
                        if (result[i].Type == "PDT")
                        {
                            result[i].NamePosition = "Academic Affair Offfice Staff";
                        }
                        else if (AcademicAffairsOfficeDAO.isMaster(result[i].Id, Global.schoolYear))
                        {
                            result[i].NamePosition = "Homeroom Teacher";
                        }
                        else
                        {
                            result[i].NamePosition = "Subject Teacher";
                        }
                    }
                }
                return(result);
            }
            return(null);
        }
Exemple #2
0
        public static List <TeacherDTO> loadListTeacher()
        {
            List <TeacherDTO> result = AcademicAffairsOfficeDAO.loadListTeacher();

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    if (result[i].Type == "PDT")
                    {
                        result[i].NamePosition = "Academic Affair Offfice Staff";
                    }
                    else if (AcademicAffairsOfficeDAO.isMaster(result[i].Id, Global.schoolYear))
                    {
                        result[i].NamePosition = "Homeroom Teacher";
                    }
                    else
                    {
                        result[i].NamePosition = "Subject Teacher";
                    }

                    string birthDay = result[i].DateofBith;
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;
                }
                return(result);
            }
            return(null);
        }
Exemple #3
0
        public static List <StudentDTO> loadListStudent(string nameClass, string SchoolYear)
        {
            var result = AcademicAffairsOfficeDAO.LoadStudent(nameClass, SchoolYear);
            int n      = result.Count;

            for (int i = 0; i < n; i++)
            {
                string temp = result[i].DateofBith;
                TeacherBUS.StandalizedBirthDayToUI(ref temp);
                result[i].DateofBith = temp;
            }
            return(result);
        }
Exemple #4
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));
        }
Exemple #5
0
 public static List <string> loadListSubjectToComboBoxInSearch(string idTeacher, string nameClass, string schoolYear)
 {
     if (TeacherBUS.isMaster(idTeacher, nameClass, schoolYear))
     {
         List <string> temp   = SubjectBUS.loadListNameSubject();
         List <string> result = new List <string>();
         result.Add("All");
         for (int i = 0; i < temp.Count; i++)
         {
             result.Add(temp[i]);
         }
         return(result);
     }
     return(TeacherDAO.loadListSubjectToComboBox(idTeacher, nameClass, schoolYear));
 }
Exemple #6
0
        public static List <TeacherDTO> loadListSubjectTeacher(string schoolYear)
        {
            List <TeacherDTO> result = AcademicAffairsOfficeDAO.loadListSubjectTeacher(schoolYear);

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    string birthDay = result[i].DateofBith;
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;
                }
                return(result);
            }
            return(null);
        }
Exemple #7
0
        public static List <StudentDTO> LoadStudent(string nameClass, string schoolYear, string status)
        {
            List <StudentDTO> result = AcademicAffairsOfficeDAO.LoadStudent(nameClass, schoolYear, status);

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    string birthDay = result[i].DateofBith;
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;
                }
                return(result);
            }
            return(null);
        }
Exemple #8
0
        public static List <PeopleDTO> loadListTeacher(string status)
        {
            List <PeopleDTO> result = AdminDAO.loadListTeacher(status);

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    string birthDay = result[i].DateofBith.ToString();
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;
                }
                return(result);
            }
            return(null);
        }
Exemple #9
0
        public static List <PeopleDTO> searchUser(string authories, string status, string textToSearch)
        {
            List <PeopleDTO> result = AdminDAO.searchUser(authories, status, textToSearch);

            if (result != null)
            {
                int n = result.Count;
                for (int i = 0; i < n; i++)
                {
                    string birthDay = result[i].DateofBith.ToString();
                    TeacherBUS.StandalizedBirthDayToUI(ref birthDay);
                    result[i].DateofBith = birthDay;
                }
                return(result);
            }
            return(null);
        }
Exemple #10
0
        public static List <StudentDTO> searchStudent(string textToSearch, string nameClass, string schoolYear)
        {
            var result = AcademicAffairsOfficeDAO.searchStudent(textToSearch, nameClass, schoolYear);

            if (result == null)
            {
                return(null);
            }
            int n = result.Count;

            for (int i = 0; i < n; i++)
            {
                string temp = result[i].DateofBith;
                TeacherBUS.StandalizedBirthDayToUI(ref temp);
                result[i].DateofBith = temp;
            }
            return(result);
        }
Exemple #11
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));
        }
Exemple #12
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));
        }