Ejemplo n.º 1
0
 private void cmbSchoolSubject_SelectedIndexChanged(object sender, EventArgs e)
 {
     currentQuestion.IdSchoolSubject = ((SchoolSubject)cmbSchoolSubject.SelectedItem).IdSchoolSubject;
     currentSubject = db.GetSchoolSubject(currentQuestion.IdSchoolSubject);
     ////////Color bgColor;
     ////////if (currentSubject != null)
     ////////{
     ////////    int col = currentSubject.Color;
     ////////    bgColor = Color.FromArgb((col & 0xFF0000) >> 16, (col & 0xFF00) >> 8, col & 0xFF);
     ////////}
     ////////else
     ////////{
     ////////    bgColor = Color.PowderBlue;
     ////////}
     this.BackColor = Commons.ColorFromNumber(currentSubject);
 }
Ejemplo n.º 2
0
        private void frmImages_Load(object sender, EventArgs e)
        {
            txtLessonDate.Text = currentLesson.Date.ToString();
            txtSchoolYear.Text = currentClass.SchoolYear;
            txtClass.Text      = currentClass.Abbreviation;

            txtSchoolSubject.Text = currentLesson.IdSchoolSubject;
            txtLessonCode.Text    = currentLesson.IdLesson.ToString();;
            txtLessonDesc.Text    = currentLesson.Note;

            DgwLessonsImages.DataSource = listImages;

            if (type == ImagesFormType.ShowImage)
            {
                picImage.Location = new System.Drawing.Point(0, 0);
                picImage.Size     = this.Size;
                currentImage      = listImages[0];
                LoadImage();
                //picImage.Load(Commons.PathImages + "\\"+ listImages[0].RelativePathAndFilename);
            }
            else if (type == ImagesFormType.NormalManagement)
            {
                DgwLessonsImages.DataSource = listImages;
            }
            if (listImages.Count > 0)
            {
                currentImage = listImages[0];
                LoadImage();
            }
            else
            {
                currentImage = new DbClasses.Image();
            }

            if (currentSubject != null)
            {
                int col = (int)currentSubject.Color;
                this.BackColor = Commons.ColorFromNumber(currentSubject);
                rdbAutoRename_CheckedChanged(null, null);
            }
        }
Ejemplo n.º 3
0
 private void cmbSchoolSubject_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.BackColor = Commons.ColorFromNumber(currentSubject);
 }