コード例 #1
0
        public frmKnotsToTheComb(frmMicroAssessment GrandparentForm, int?IdStudent, SchoolSubject SchoolSubject, string Year)
        {
            InitializeComponent();

            currentStudent      = db.GetStudent(IdStudent);
            lblStudent.Text     = currentStudent.LastName + " " + currentStudent.FirstName;
            currentIdSchoolYear = Year;
            currentSubject      = SchoolSubject;
            grandparentForm     = GrandparentForm;

            // fills the lookup tables' combos
            cmbSchoolSubject.DisplayMember = "Name";
            cmbSchoolSubject.ValueMember   = "idSchoolSubject";
            cmbSchoolSubject.DataSource    = db.GetListSchoolSubjects(true);

            currentSubject = SchoolSubject;
            ChosenQuestion = null;
        }
コード例 #2
0
        internal frmQuestion(QuestionFormType Type, Question Question,
                             SchoolSubject Subject, Class Class, Topic Topic)
        {
            InitializeComponent();

            DbAndBusiness db     = new DbAndBusiness(Commons.PathAndFileDatabase);
            TreeMpttDb    dbMptt = new TreeMpttDb(db);

            // fills the lookup tables' combos
            List <QuestionType> listQuestions = db.GetListQuestionTypes(true);

            cmbQuestionType.DisplayMember = "Name";
            cmbQuestionType.ValueMember   = "idQuestionType";
            cmbQuestionType.DataSource    = listQuestions;

            List <SchoolSubject> listSubjects = db.GetListSchoolSubjects(true);

            cmbSchoolSubject.DisplayMember = "Name";
            cmbSchoolSubject.ValueMember   = "idSchoolSubject";
            cmbSchoolSubject.DataSource    = listSubjects;

            currentClass    = Class;
            currentSubject  = Subject;
            currentQuestion = Question;
            formType        = Type;
            if (formType == QuestionFormType.EditOneQuestion)
            {
                currentQuestion = db.GetQuestionById(Question.IdQuestion);
            }
            if (Topic != null)
            {
                currentTopic = db.GetTopicById(Topic.Id);
                if (currentTopic.Id != 0)
                {
                    txtTopic.Text = dbMptt.GetTopicPath(currentTopic.Id);
                }
            }

            //if (Subject != null)
            //    idSchoolSubject = Subject.IdSchoolSubject;
        }
コード例 #3
0
        public frmGradesClassSummary(Class Class, GradeType GradeType,
                                     SchoolSubject Subject)
        {
            InitializeComponent();

            db = new DbAndBusiness(Commons.PathAndFileDatabase);

            currentClass     = Class;
            currentGradeType = GradeType;
            currentSubject   = Subject;

            // fill the combos of lookup tables
            List <GradeType> listGradeTypes = db.GetListGradeTypes();

            cmbSummaryGradeType.DisplayMember = "Name";
            cmbSummaryGradeType.ValueMember   = "idGradeType";
            cmbSummaryGradeType.DataSource    = listGradeTypes;

            List <SchoolSubject> listSubjects = db.GetListSchoolSubjects(false);

            cmbSchoolSubjects.DisplayMember = "Name";
            cmbSchoolSubjects.ValueMember   = "idSchoolSubject";
            cmbSchoolSubjects.DataSource    = listSubjects;

            List <SchoolPeriod> listPeriods = db.GetSchoolPeriods(Class.SchoolYear);

            cmbSchoolPeriod.DataSource = listPeriods;
            // select the combo item of the partial period of the DateTime.Now
            foreach (SchoolPeriod sp in listPeriods)
            {
                if (sp.DateFinish > DateTime.Now && sp.DateStart < DateTime.Now &&
                    sp.IdSchoolPeriodType == "P")
                {
                    cmbSchoolPeriod.SelectedItem = sp;
                }
            }
            currentClass     = Class;
            currentGradeType = GradeType;
            currentSubject   = Subject;
        }
コード例 #4
0
        private void frmGradesStudentsSummary_Load(object sender, EventArgs e)
        {
            if (currentStudent == null)
            {
                MessageBox.Show("Non è stato passato nessun studente");
                this.Close();
            }

            // student's name label
            lblCurrentStudent.Text = currentStudent.ToString();
            TxtIdStudent.Text      = currentStudent.IdStudent.ToString();
            lblSum.Text            = "";

            // fill the combos of lookup tables
            List <GradeType> listGrades = db.GetListGradeTypes();

            cmbSummaryGradeType.DisplayMember = "Name";
            cmbSummaryGradeType.ValueMember   = "idGradeType";
            cmbSummaryGradeType.DataSource    = listGrades;
            cmbSummaryGradeType.SelectedValue = currentGradeType.IdGradeType;

            List <SchoolSubject> listSubjects = db.GetListSchoolSubjects(false);

            cmbSchoolSubjects.DisplayMember = "Name";
            cmbSchoolSubjects.ValueMember   = "idGradeType";
            cmbSchoolSubjects.DataSource    = listSubjects;
            cmbSchoolSubjects.SelectedValue = currentSchoolSubject.IdSchoolSubject;

            List <SchoolPeriod> listPeriods = db.GetSchoolPeriods(currentSchoolYear);

            cmbSchoolPeriod.DataSource = listPeriods;

            dgwNotes.DataSource = db.AnnotationsAboutThisStudent(currentStudent, currentSchoolYear,
                                                                 chkAnnotationsShowActive.Checked);

            RefreshData();
        }
コード例 #5
0
 private void frmSchoolSubjectManagement_Load(object sender, EventArgs e)
 {
     subjectList            = db.GetListSchoolSubjects(false);
     DgwSubjects.DataSource = subjectList;
 }