Пример #1
0
        public void LoadGradeSections()
        {
            String message = String.Empty;
            IGradeSectionService gService = new GradeSectionService();
            gradeSectionList = new List<GradeSection>(gService.GetAllGradeSections());
            try
            {
                if (GlobalClass.userTypeCode == "admin" || GlobalClass.user.UserType == "reg")
                {
                    gvGradeSection.DataSource = gradeSectionList;

                }
                else if (GlobalClass.user.UserType == "teach")
                {
                   var advisoryClass= gradeSectionList.FindAll(item => item.HomeRoomTeacherId == teacher.TeacherId);
                    gvGradeSection.DataSource = advisoryClass;
                    
                }
                gvGradeSection.Refresh();
            }
            catch (Exception ex)
            {
                message = "Error Loading Teachers Load";
                MessageBox.Show(ex.ToString());
            }

        }
Пример #2
0
        private void SetComboBoxes() {
            IGradeSectionService gService = new GradeSectionService();
            gLevels= new List<GradeLevel>(gService.GetAllGradeLevels());
            teachers = new List<Teacher>(gService.GetAllTeachers());
            
            sys = new List<SchoolYear>(gService.GetAllSchoolYears());
            rooms = new List<Room>(gService.GetAllRooms());
            List<int> classNum = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            cmbClass.DataSource = classNum;

            cmbGradeLevel.DataSource = gLevels;
            cmbGradeLevel.ValueMember = "GradeLev";
            cmbGradeLevel.DisplayMember = "Description";
            cmbRoom.DataSource = rooms;
            cmbRoom.ValueMember = "RoomId";
            cmbRoom.DisplayMember = "RoomCode";
            cmbSchoolYear.DataSource = sys;
            cmbSchoolYear.ValueMember = "SY";
            cmbSchoolYear.DisplayMember = "SY";

            cmbTeacher.DataSource = teachers;
            cmbTeacher.ValueMember = "TeacherID";
            cmbTeacher.DisplayMember = "TeacherName";

        }
Пример #3
0
        private void frmAdvisersLoad_Load(object sender, EventArgs e)
        {
            IGradeSectionService gService = new GradeSectionService();
            sy = GlobalClass.currentsy;

            string fname = GlobalClass.user.FirstName;
            string lname = GlobalClass.user.LastName;
            string mname = GlobalClass.user.MiddleName;
            teacher = new Teacher() {
                FirstName = fname
            };
           teacher = gService.GetTeacher(lname, mname, fname);
           LoadGradeSections();
        }
Пример #4
0
        private void LoadMe(object sender, EventArgs e)
        {
            //FeeServiceClient feeService = new FeeServiceClient();
            //gradeLevels = new List<GradeLevel>(feeService.GetAllGradeLevels());
            //schoolYears = new List<SchoolYear>(feeService.GetLastFiveSY());

            //cmbGradeLevel.DataSource = gradeLevels;
            //cmbGradeLevel.ValueMember = "GradeLev";
            //cmbGradeLevel.DisplayMember = "Description";

            //cmbSY.DataSource = schoolYears;
            //cmbSY.ValueMember = "SY";
            //cmbSY.DisplayMember = "SY";
           IGradeSectionService gService = new GradeSectionService();
            teachers = new List<Teacher>(gService.GetAllTeachers());

            cmbTeacher.DataSource = teachers;
            cmbTeacher.ValueMember = "TeacherID";
            cmbTeacher.DisplayMember = "TeacherName";
        }
Пример #5
0
        public List <GradeSection> GetAllSectionsOfGradeLevel(string gradeLevel)
        {
            GradeSectionService gs = new GradeSectionService();

            return(gs.GetAllSectionsForGrade(gradeLevel));
        }
Пример #6
0
        public List <GradeSection> GetAllSections()
        {
            GradeSectionService gs = new GradeSectionService();

            return(gs.GetAllGradeSections());
        }
Пример #7
0
        public void TranslateScheduleBDOToSchedule(SubjectAssignmentBDO sabdo, SubjectAssignment sched)
        {
            GradeSectionService gs = new GradeSectionService();
            GradeSection        g  = new GradeSection();

            gs.TranslateGradeSectionBDOToGradeSection(sabdo.GradeSection, g);
            sched.GradeSection = g;
            sched.Section      = g.Section;
            sched.GradeLevel   = g.GradeLevel;
            sched.Class        = (int)g.Class;

            RoomService rs = new RoomService();
            Room        r  = new Room();

            rs.TranslateRoomBDOtoRoomDTO(sabdo.Room, r);
            sched.Room     = r;
            sched.RoomCode = r.RoomCode;

            SubjectService ss = new SubjectService();
            Subject        s  = new Subject();

            ss.TranslateSubjectBDOToSubject(sabdo.Subject, s);
            sched.Subject = s;

            TeacherService ts = new TeacherService();
            Teacher        t  = new Teacher();

            ts.TranslateTeacherBDOToTeacherDTO(sabdo.Teacher, t);
            sched.Teacher = t;
            if (t.MiddleName == String.Empty)
            {
                sched.TeacherName = t.LastName + ", " + t.FirstName;
            }
            else
            {
                sched.TeacherName = t.LastName + ", " + t.FirstName + " " + t.MiddleName.Substring(0, 1) + ".";
            }

            TimeslotService times = new TimeslotService();
            Timeslot        time  = new Timeslot();

            times.TranslateTimeslotBDOToTimeslotDTo(sabdo.Timeslot, time);
            sched.Timeslot  = time;
            sched.Timestart = time.TimeStart;
            sched.TimeEnd   = time.TimeEnd;
            sched.Days      = time.Days;

            sched.Deactivated          = sabdo.Deactivated;
            sched.GradeSectionCode     = sabdo.GradeSectionCode;
            sched.RoomId               = sabdo.RoomId;
            sched.SubjectAssignmentsID = sabdo.SubjectAssignmentsID;
            sched.SubjectCode          = sabdo.SubjectCode;

            sched.SY           = sabdo.SY;
            sched.TeacherId    = sabdo.TeacherId;
            sched.TimeSlotCode = sabdo.TimeSlotCode;

            sched.TimeslotInfo = time.Days + " " + time.TimeStart + "-" + time.TimeEnd;
            sched.SubjectInfo  = sabdo.SubjectCode + " " + sched.Section + " " + sched.TimeslotInfo;

            sched.SubjectDescription = s.Description;
        }
Пример #8
0
        private void frmStudentRegister_Load(object sender, EventArgs e)
        {
            IRegistrationService registrationService = new RegistrationService();
            IGradeSectionService gsService = new GradeSectionService();
            
            if (String.IsNullOrEmpty(RegisterStudent.GradeLevel))
            {
                chkRetain.Checked = false;
                chkPromote.Checked = true;
                chkIrreg.Checked = false;
                Promote();
                EnrolMe.Stat = "a";
            }
            else
            {
                
                RegisterStudent =registrationService.StudentInfoWithRank(StudentId,GradeLevel,Gender);
               
                decimal cri = 3.50M;
          
                if (RegisterStudent.UnitsFailedLastYear.CompareTo(0.0M) == 0)
                {
                    chkRetain.Checked = false;
                    chkPromote.Checked = true;
                    chkIrreg.Checked = false;
                    Promote();
                    EnrolMe.Stat = "a";
                }
                else if (RegisterStudent.UnitsFailedLastYear.CompareTo(cri) > 0)
                {
                    chkRetain.Checked = true;
                    chkPromote.Checked = false;
                    chkIrreg.Checked = false;
                    EnrolMe.Stat = "c";
                    GradeLevel = RegisterStudent.GradeLevel;
                }
                else if (RegisterStudent.UnitsFailedLastYear.CompareTo(cri) <= 0)
                {
                    chkRetain.Checked = false;
                    chkPromote.Checked = false;
                    chkIrreg.Checked = true;
                    Promote();
                    EnrolMe.Stat = "b";
                }
            }
            SY = GlobalClass.currentsy;
            Discounts = new List<ScholarshipDiscount>(registrationService.GetScholarshipDiscounts());

            txtSY.Text = SY;
            txtStudentId.Text = RegisterStudent.StudentId;
            txtName.Text = RegisterStudent.LastName + "," + RegisterStudent.FirstName + " " + RegisterStudent.MiddleName;
            txtGpa.Text = RegisterStudent.Average.ToString();
            txtFailed.Text = RegisterStudent.UnitsFailedLastYear.ToString();
            txtranking.Text = RegisterStudent.ranking.ToString();
            txtPrevGradeLevel.Text = RegisterStudent.GradeLevel;
            cmbScholarship.DataSource = Discounts;
            cmbScholarship.ValueMember = "ScholarshipDiscountId";
            cmbScholarship.DisplayMember = "Scholarship";
            cmbScholarship.SelectedValue = RegisterStudent.ScholarshipDiscountId;
            sectionsForGradeLevel = gsService.GetAllSectionsForGrade(GradeLevel);
        }
Пример #9
0
 public void LoadGradeSections()
 {
     IGradeSectionService gService = new GradeSectionService();
     gradeSectionList = new List<GradeSection>(gService.GetAllGradeSections());
     gvGradeSection.DataSource = gradeSectionList;
 }
Пример #10
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            GradeSection gs = new GradeSection();
          
            gs.GradeLevel = cmbGradeLevel.SelectedValue.ToString();
            gs.HomeRoomNumber = Int32.Parse(cmbRoom.SelectedValue.ToString());
            gs.HomeRoomTeacherId = cmbTeacher.SelectedValue.ToString();
            gs.Section = txtSection.Text.ToString();
            gs.SY = cmbSchoolYear.SelectedValue.ToString();
            gs.Class = Int32.Parse(cmbClass.Text.ToString());

            string message=String.Empty;
            bool ret = false;
            IGradeSectionService gservice = new GradeSectionService();
            if (Op == "edit")
            {
                gs.GradeSectionCode = SelectedGradeSection.GradeSectionCode;
                ret = gservice.UpdateGradeSection(ref gs, ref message);
                Log("U", "GradeSections", gs);
                
            }
            else
            {
               ret = gservice.CreateGradeSection(ref gs, ref message);
                Log("C", "GradeSections", gs);
                
            }

            if (ret)
            {
                MessageBox.Show(this, "Saved Successfully");
                this.Close();
            }
            else
                MessageBox.Show(this, "Error in saving");
        }
Пример #11
0
        public List <GradeLevel> GetAllGradeLevel()
        {
            GradeSectionService gss = new GradeSectionService();

            return(gss.GetAllGradeLevels());
        }
Пример #12
0
 public List<GradeSection> GetAllSectionsOfGradeLevel(string gradeLevel)
 {
     GradeSectionService gs = new GradeSectionService();
     return gs.GetAllSectionsForGrade(gradeLevel);
 }
Пример #13
0
 public List<GradeSection> GetAllSections()
 {
     GradeSectionService gs = new GradeSectionService();
     return gs.GetAllGradeSections();
 }
Пример #14
0
        public void TranslateScheduleBDOToSchedule(SubjectAssignmentBDO sabdo, SubjectAssignment sched)
        {
            GradeSectionService gs = new GradeSectionService();
            GradeSection g = new GradeSection();
            gs.TranslateGradeSectionBDOToGradeSection(sabdo.GradeSection, g);
            sched.GradeSection = g;
            sched.Section = g.Section;
            sched.GradeLevel = g.GradeLevel;
            sched.Class = (int)g.Class;

            RoomService rs = new RoomService();
            Room r = new Room();
            rs.TranslateRoomBDOtoRoomDTO(sabdo.Room, r);
            sched.Room = r;
            sched.RoomCode = r.RoomCode;

            SubjectService ss = new SubjectService();
            Subject s = new Subject();
            ss.TranslateSubjectBDOToSubject(sabdo.Subject, s);
            sched.Subject = s;

            TeacherService ts = new TeacherService();
            Teacher t = new Teacher();
            ts.TranslateTeacherBDOToTeacherDTO(sabdo.Teacher, t);
            sched.Teacher = t;
            if (t.MiddleName == String.Empty)
                sched.TeacherName = t.LastName + ", " + t.FirstName;
            else
                sched.TeacherName = t.LastName + ", " + t.FirstName + " " + t.MiddleName.Substring(0, 1) + ".";

            TimeslotService times = new TimeslotService();
            Timeslot time = new Timeslot();
            times.TranslateTimeslotBDOToTimeslotDTo(sabdo.Timeslot, time);
            sched.Timeslot = time;
            sched.Timestart = time.TimeStart;
            sched.TimeEnd = time.TimeEnd;
            sched.Days = time.Days;

            sched.Deactivated = sabdo.Deactivated;
            sched.GradeSectionCode = sabdo.GradeSectionCode;
            sched.RoomId = sabdo.RoomId;
            sched.SubjectAssignmentsID = sabdo.SubjectAssignmentsID;
            sched.SubjectCode = sabdo.SubjectCode;

            sched.SY = sabdo.SY;
            sched.TeacherId = sabdo.TeacherId;
            sched.TimeSlotCode = sabdo.TimeSlotCode;

            sched.TimeslotInfo = time.Days + " " + time.TimeStart + "-" + time.TimeEnd;
            sched.SubjectInfo = sabdo.SubjectCode + " " + sched.Section + " " + sched.TimeslotInfo;

            sched.SubjectDescription = s.Description;

        }
Пример #15
0
 public List<GradeLevel> GetAllGradeLevel()
 {
     GradeSectionService gss = new GradeSectionService();
     return gss.GetAllGradeLevels();
 }
Пример #16
0
        public void LoadStudents()
        {
            IGradeLevelService glService = new GradeLevelService();
            gradeLevel = new List<GradeLevel>(glService.GetAllGradeLevels());
            if (gradeLevel.Count > 0)
                gradeLevel[0].Description = "None";

            IGradeSectionService sectionService = new GradeSectionService();
            sections = new List<GradeSection>(sectionService.GetAllGradeSections());

            IRegistrationService registrationService = new RegistrationService();
            RegisteredStudents= new List<string>(registrationService.GetEnrolledStudents(GlobalClass.currentsy));
            IStudentService studentService = new StudentService();
            string message = String.Empty;
            try
            {
                var students = studentService.GetAllStudents();
                studentList = new List<Student>(students);
                gvStudent.DataSource = students;
                gvStudent.Refresh();

                if (gvStudent.RowCount != 0)
                    gvStudent.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading Student List";
                MessageBox.Show(ex.ToString());
            }

        }