/// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="dataBaseSent"></param>
        /// <param name="formAuthenticationSent"></param>
        /// <param name="usernameSent"></param>
        public frmHome(DataBase dataBaseSent, frmAuthentication formAuthenticationSent, string usernameSent)
        {
            InitializeComponent();

            ChangeInterfaceLanguage();

            this.dataBase           = dataBaseSent;
            this.formAuthentication = formAuthenticationSent;

            this.username  = usernameSent;
            this.idTeacher = dataBaseSent.ElementSearchedFromReference("idTeacher", "Teacher", "Username", usernameSent);

            TeacherFullNameOnLabel();
            DisciplineNameOnButton();
        }
예제 #2
0
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="dataBaseSent"></param>
        /// <param name="formAuthenticationSent"></param>
        /// <param name="formHomeSent"></param>
        /// <param name="idCourseSent"></param>
        public frmClassManager(DataBase dataBaseSent, frmAuthentication formAuthenticationSent, frmHome formHomeSent, int idCourseSent)
        {
            InitializeComponent();

            ChangeInterfaceLanguage();

            List <Label> studentsLabels = new List <Label>();

            this.dataBase           = dataBaseSent;
            this.formAuthentication = formAuthenticationSent;
            this.formHome           = formHomeSent;

            this.idCourse = idCourseSent;

            ClassNameOnLabel();
            DisciplineNameOnLabel();

            foreach (Control c in this.Controls)
            {
                if ((c is Label) && (c.Name.StartsWith("lblStudent")))
                {
                    studentsLabels.Add((Label)c);
                }
                if (c is PictureBox)
                {
                    studentsPictures.Add((PictureBox)c);
                    idStudentsPictures.Add(-1);
                }
            }

            for (int index = 0; index < studentsPictures.Count; index++)
            {
                if (index.Equals(0) || idStudentsPictures.Count.Equals(0))
                {
                    StudentFullNameAndPicture(studentsLabels, studentsPictures, idStudentsPictures, index);
                }
                else
                {
                    StudentFullNameAndPicture(studentsLabels, studentsPictures, idStudentsPictures, index, " AND idStudent='" + ((idStudentsPictures[index - 1]) + 1).ToString() + "'");
                }
            }
        }