private void picSearchStudents_Click(object sender, EventArgs e)
        {
            frmStudentSearchForStudent frmSearchStudent = new frmStudentSearchForStudent();

            frmSearchStudent.StudentCourseEnrollmentForm = this;
            frmSearchStudent.ShowDialog();

            //once student selected load student enrollment Application
            if (StudentID != 0)
            {
                this.refreshCurrentEnrollments();
                this.refreshAvailableCurriculumCourses();
                this.refreshLinkedCurriculumCourses();
                this.showEditStudentButton();
                this.txtdateScheduled.Text = DateTime.Now.ToString("D");
            }
            else
            {
                this.disableStudentEnrollmentApplications();
                this.disableProcessCourseEnrollment();
                this.hideEditStudnetButton();
            }

            //this.LoadStudentDetails();
        }
        private void picSearchStudents_Click(object sender, EventArgs e)
        {
            frmStudentSearchForStudent frm = new frmStudentSearchForStudent();

            frm.ShowDialog();
            if (frm.CurrentSelectedStudent != null)
            {
                txtStudentFullName.Text         = frm.CurrentSelectedStudent.Individual.IndividualFirstName + " " + frm.CurrentSelectedStudent.Individual.IndividualLastname;
                txtStudentIdNumber.Text         = frm.CurrentSelectedStudent.StudentIDNumber;
                txtStudentNember.Text           = frm.CurrentSelectedStudent.StudentID.ToString();
                CurrentEnrollments.Student      = frm.CurrentSelectedStudent;
                CurrentEnrollments.IndividualID = frm.CurrentSelectedStudent.StudentID;
            }
            ////if (StudentID != 0)
            ////{
            ////    this.refreshCurrentEnrollments();
            ////    this.showEditStudentButton();
            ////}
            ////else
            ////{
            ////    //this.disableStudentEnrollmentApplications();
            ////    //this.disableProcessCourseEnrollment();
            ////    //this.hideEditStudnetButton();
            ////}
        }
Пример #3
0
        private void picSearchStudents_Click(object sender, EventArgs e)
        {
            List <Student> StudentExcemptionList = new List <Student>();

            using (var Dbconnection = new MCDEntities())
            {
                //Loadds the associated Collections in this case the Enrollment with their associated Students that are enrolled.
                Dbconnection.CurriculumEnquiries.Attach(CurrentCurriculumEnquiry);
                //Load all enrollments that linked to the Enquiry Item.
                Dbconnection.Entry(CurrentCurriculumEnquiry).Collection(a => a.Enrollments).Load();
                foreach (Enrollment EnrollmentObj in CurrentCurriculumEnquiry.Enrollments)
                {
                    //Load the student linked to the enrollment
                    Dbconnection.Entry(EnrollmentObj).Reference(a => a.Student).Load();
                    StudentExcemptionList.Add(EnrollmentObj.Student);
                }
            };
            using (frmStudentSearchForStudent frm = new frmStudentSearchForStudent())
            {
                //Set the list of student that are already Enrolled for this Enquiry Item.
                frm.StudentExpceptionList = StudentExcemptionList;
                frm.ShowDialog();
                if (frm.CurrentSelectedStudent != null)
                {
                    txtStudentFullName.Text = frm.CurrentSelectedStudent.Individual.FullName;
                    txtStudentIdNumber.Text = frm.CurrentSelectedStudent.StudentIDNumber;
                    txtStudentNember.Text   = frm.CurrentSelectedStudent.StudentID.ToString();
                    CurrentSelectedStudent  = frm.CurrentSelectedStudent;
                    //Summary Fields
                    txtSummaryFullName.Text          = txtStudentFullName.Text;
                    txtSummaryIDNumber.Text          = txtStudentIdNumber.Text;
                    txtSummaryStudentNumber.Text     = txtStudentNember.Text;
                    picbtnEditCurrentStudent.Visible = true;
                }
                else
                {
                    picbtnEditCurrentStudent.Visible = false;
                    txtStudentFullName.Clear();
                    txtStudentIdNumber.Clear();
                    txtStudentNember.Clear();
                    //Summary Fields
                    txtSummaryFullName.Clear();
                    txtSummaryIDNumber.Clear();
                    txtSummaryStudentNumber.Clear();
                    CurrentSelectedStudent = null;
                }
            };
        }
        private void picSearchStudents_Click(object sender, EventArgs e)
        {
            List <Student> StudentExcemptionList = new List <Student>();

            using (var Dbconnection = new MCDEntities())
            {
                //Loadds the associated Collections in this case the Enrollment with their associated Students that are enrolled.
                //Dbconnection.CurriculumEnquiries.Attach(CurrentEnquiry);
                ////Load all enrollments that linked to the Enquiry Item.
                //Dbconnection.Entry(CurrentEnquiry).Collection(a => a.Enrollments).Load();
                //foreach (Data.Models.Enrollment EnrollmentObj in CurrentEnquiry.Enrollments)
                //{
                //    //Load the student linked to the enrollment
                //    // Dbconnection.Entry(EnrollmentObj).Reference(a => a.StudentEnrollment.Student).Load();
                //    StudentExcemptionList.Add(EnrollmentObj.StudentEnrollment.Student);
                //}
            };
            using (frmStudentSearchForStudent frm = new frmStudentSearchForStudent(true))
            {
                //Set the list of student that are already Enrolled for this Enquiry Item.
                frm.StudentExpceptionList = StudentExcemptionList;
                frm.ShowDialog();
                if (frm.CurrentSelectedStudent != null)
                {
                    if (CurrentEnrollment.StudentEnrollment == null)
                    {
                        CurrentEnrollment.StudentEnrollment = new StudentEnrollment()
                        {
                            StudentID   = frm.CurrentSelectedStudent.StudentID,
                            DateUpdated = DateTime.Now.Date,
                            Student     = frm.CurrentSelectedStudent
                        };
                    }
                    else
                    {
                        CurrentEnrollment.StudentEnrollment.StudentID = frm.CurrentSelectedStudent.StudentID;
                        CurrentEnrollment.StudentEnrollment.Student   = frm.CurrentSelectedStudent;
                    }
                    picbtnEditCurrentStudent.Visible = true;
                }
                else
                {
                    CurrentEnrollment.StudentEnrollment = null;
                    picbtnEditCurrentStudent.Visible    = false;
                }
                refreshStudentSelection();
            };
        }
Пример #5
0
        private void btnAdminStudent_Click(object sender, EventArgs e)
        {
            foreach (Form f in this.MdiChildren)
            {
                if (f.GetType() == typeof(frmStudentSearchForStudent))
                {
                    f.Activate();
                    f.WindowState = FormWindowState.Maximized;
                    return;
                }
            }

            frmStudentSearchForStudent frm = new frmStudentSearchForStudent();

            //frm.frmParentForm = this;

            frm.MdiParent = this;
            frm.Show();
        }
Пример #6
0
        private void btnAdminStudent_Click(object sender, EventArgs e)
        {
            foreach (Form f in this.MdiChildren)
            {
                if (f.GetType() == typeof(frmStudentSearchForStudent))
                {
                    f.Activate();
                    f.WindowState = FormWindowState.Maximized;
                    return;
                }
            }

            using (frmStudentSearchForStudent frm = new frmStudentSearchForStudent(true))
            {
                //frm.MdiParent = this;
                frm.ShowDialog();
                using (frmStudentAddUpdate frmInner = new frmStudentAddUpdate(frm.CurrentSelectedStudent.StudentID))
                {
                    frmInner.ShowDialog();
                }
            };

            //frm.frmParentForm = this;
        }