コード例 #1
0
ファイル: frmTeacherLoad.cs プロジェクト: dansalan/DCFIv5
        public void LoadTeacherSubjects()
        {
            GradingServiceClient gradingService = new GradingServiceClient();
            String message = String.Empty;

            try
            {
                if (GlobalClass.userTypeCode == "admin" || GlobalClass.user.UserType == "reg")
                {
                    var load = gradingService.GetAllTeachersLoad(sy);
                    teacherLoad = new List<TeacherLoad>(load);
                    gvSubjects.DataSource = teacherLoad;

                }
                else if (GlobalClass.user.UserType == "teach")
                {
                    var load = gradingService.GetTeacherLoad(teacher.TeacherId, sy);
                    teacherLoad = new List<TeacherLoad>(load);
                    gvSubjects.DataSource = teacherLoad;
                }
                gvSubjects.Refresh();
            }
            catch (Exception ex)
            {
                message = "Error Loading Teachers Load";
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #2
0
        private void btnLock_Click(object sender, EventArgs e)
        {
            foreach (StudentTrait ss in classList)
            {
                if (ss.FirstPeriodicRating > 0 && ss.FirstEntered.HasValue && ss.LockFirst == false && !ss.FirstLocked.HasValue)
                {
                    ss.FirstLocked = DateTime.Now;
                    ss.LockFirst = true;
                }
                if (ss.SecondPeriodicRating > 0 && ss.SecondEntered.HasValue && ss.LockSecond == false && !ss.SecondLocked.HasValue)
                {
                    ss.SecondLocked = DateTime.Now;
                    ss.LockSecond = true;
                }
                if (ss.ThirdPeriodicRating > 0 && ss.ThirdEntered.HasValue && ss.LockThird == false && !ss.ThirdLocked.HasValue)
                {
                    ss.ThirdLocked = DateTime.Now;
                    ss.LockThird = true;
                }
                if (ss.FourthPeriodicRating > 0 && ss.FourthEntered.HasValue && ss.LockFourth == false && !ss.FourthLocked.HasValue)
                {
                    ss.FourthLocked = DateTime.Now;
                    ss.LockFourth = true;
                }
            }
            GradingServiceClient gradingService = new GradingServiceClient();
            if (gradingService.SaveTraitsGrade(classList.ToArray()))
            {
                foreach (StudentTrait ss in classList)
                    Log("U", "StudentSubjects", ss);

                MessageBox.Show("Grades Locked Successfully");
                this.Close();
            }
            else
            {
                MessageBox.Show("Failed Locking Grades");

            }
        }
コード例 #3
0
        private void frmTraitsQuarterlyGrading_Load(object sender, EventArgs e)
        {
            if (GlobalClass.user.UserType == "teach")
                btnUnlock.Hide();

            sy = GlobalClass.currentsy;

            txtSy.Text = sy;
            txtTeacherId.Text = teacherId;
            txtTeacherName.Text = teacherName;

            txtGradeLevel.Text = gradeLevel;
            txtSection.Text = section;

            GradingServiceClient gradingService = new GradingServiceClient();

            classList = new List<StudentTrait>(gradingService.GetAdvisees(gradeSectionCode));
            gvTraitsGrades.DataSource = classList;

            GroupDescriptor descriptor5 = new GroupDescriptor();
            descriptor5.GroupNames.Add("StudentName", ListSortDirection.Ascending);
            this.gvTraitsGrades.GroupDescriptors.Add(descriptor5);

            gvTraitsGrades.Hide();
        }
コード例 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            GradingServiceClient gradingService = new GradingServiceClient();
            if (gradingService.SaveTraitsGrade(classList.ToArray()))
            {
                foreach (StudentTrait ss in classList)
                    Log("U", "StudentTraits", ss);

                MessageBox.Show("Grades Saved Successfully");
                this.Close();

            }
            else
            {
                MessageBox.Show("Failed Saving Grades");

            }
        }
コード例 #5
0
ファイル: frmTeacherLoad.cs プロジェクト: dansalan/DCFIv5
        private void frmTeacherLoad_Load(object sender, EventArgs e)
        {
            GradingServiceClient gradingService = new GradingServiceClient();
            sy = GlobalClass.currentsy;

            string fname = GlobalClass.user.FirstName;
            string lname = GlobalClass.user.LastName;
            string mname = GlobalClass.user.MiddleName;
            teacher = gradingService.GetTeacher(lname, mname, fname);

            LoadTeacherSubjects();
            GroupDescriptor descriptor5 = new GroupDescriptor();
            descriptor5.GroupNames.Add("TeacherName", ListSortDirection.Ascending);
            this.gvSubjects.GroupDescriptors.Add(descriptor5);
        }
コード例 #6
0
        private void frmQuarterlyGrading_Load(object sender, EventArgs e)
        {
            if (GlobalClass.user.UserType == "teach")
                btnUnlock.Hide();

            sy = GlobalClass.currentsy;

            SubjectAssignments = selectedSubject.SubjectAssignments;
            txtSy.Text = sy;
            txtTeacherId.Text = teacher.TeacherId;
            txtTeacherName.Text = teacher.TeacherName;

            txtSubjectCode.Text = selectedSubject.SubjectCode;
            txtDescription.Text = selectedSubject.SubjectDescription;
            txtTimeslotInfo.Text = selectedSubject.TimeslotInfo;

            GradingServiceClient gradingService = new GradingServiceClient();

            classList = new List<StudentSubject>(gradingService.GetClassList(SubjectAssignments));
            gvGrades.DataSource = classList;

            gvGrades.Hide();
        }