Exemple #1
0
        public void LoadTeacherSubjects()
        {
            IGradingService gradingService = new GradingService();
            String message = String.Empty;

            try
            {
                if (GlobalClass.userTypeCode == "admin" || GlobalClass.user.UserType == "reg" || GlobalClass.user.UserType == "princ")
                {
                    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());
            }

        }
        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;

            IGradingService gradingService = new GradingService();

            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();
        }
Exemple #3
0
        private void frmTeacherLoad_Load(object sender, EventArgs e)
        {
            IGradingService gradingService = new GradingService();
            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);
        }
        private void btnLock_Click(object sender, EventArgs e)
        {
            foreach (StudentSubject 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;
                }
            }

            IGradingService gradingService = new GradingService();
            if (gradingService.SaveClassGrades(classList))
            {
                foreach (StudentSubject ss in classList)
                   Log("U", "StudentSubjects", ss);
                    
                
                MessageBox.Show("Grades Locked Successfully");
                this.Close();
            }
            else
            {
                MessageBox.Show("Failed Locking Grades");

            }

        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            IGradingService gradingService = new GradingService();
            if (gradingService.SaveTraitsGrade(classList))
            {
                foreach (StudentTrait ss in classList)
                    Log("U", "StudentTraits", ss);

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

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

            }
        }
        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;

            IGradingService gradingService = new GradingService();

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


        }
Exemple #7
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            List<StudentSchedule> ss = new List<StudentSchedule>();
            gvAllSchedules.DataSource = ss;
            gvSchedule.DataSource = ss;

            Schedules.AddRange(AddFromAll);

            List<StudentSchedule> selControlledTrue = AddFromAll.FindAll(item => item.Selected == true);

            IGradingService gradingService = new GradingService();
            listStSub = gradingService.GetStudentGrades(controlStudentId, SY);
            
            foreach (StudentSchedule sche in selControlledTrue) {
                if (listStSub != null)
                    stSubj = listStSub.Find(item => item.StudentSY == controlStudentId + SY && item.SubjectCode == sche.SubjectCode);

                if (stSubj != null)
                {
                    if (stSubj.FirstPeriodicRating > 0 || stSubj.SecondPeriodicRating > 0 || stSubj.ThirdPeriodicRating > 0 || stSubj.FourthPeriodicRating > 0 || stSubj.FinalRating > 0)
                    {
                        MessageBox.Show("Cannot remove " + stSubj.Description + ", already has grade/s inputted", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        int i = ControlSchedule.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ControlSchedule[i].Selected = false;

                        int i3 = ExistingSchedRemove.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ExistingSchedRemove.RemoveAt(i3);
                    }
                    else
                    {
                        int i = ControlSchedule.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ControlSchedule.RemoveAt(i);

                        int i2 = Schedules.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        Schedules[i2].Selected = false;

                    }
                }
            }

                  
            gvAllSchedules.DataSource = Schedules;
            gvSchedule.DataSource = ControlSchedule;
            AddFromAll.Clear();
        }