public Boolean EnrolStudent(StudentEnrollment studentEnr)
        {
            GradeSectionLogic gsl = new GradeSectionLogic();
            StudentService ss = new StudentService();
            StudentEnrollmentBDO studentBDO = new StudentEnrollmentBDO();

            string message = string.Empty;

            List<GradeSectionBDO> sections = new List<GradeSectionBDO>();
            string grade = studentEnr.GradeLevel;
            sections = (gsl.GetAllSectionsofGrade(grade));

            int div = studentEnr.Rank / 20;
            div++;
            int index = sections.FindIndex(item => item.Class == div);
            studentEnr.GradeSectionCode = (int?)sections[index].GradeSectionCode;
            TranslatEnrolToEnrolBDO(studentEnr, studentBDO);
            if (sel.RegisterStudent(studentBDO, ref message))
            {
                string section = String.Empty;
                studentBDO.GradeSectionCode = studentEnr.GradeSectionCode;
                index = sections.FindIndex(item => item.GradeSectionCode == studentEnr.GradeSectionCode);
                section = sections[index].Section;
                ss.UpdateStudent(studentEnr.StudentId, studentEnr.GradeLevel, studentEnr.Rank, section);
                ControlStudentCharacters(studentBDO);
                return true;

            }
            else return false;
        }
Exemple #2
0
 private bool chkStudentID()
 {
     Student student = new Student();
     string msg = string.Empty;
     IStudentService studentService = new StudentService();
     
     student = studentService.GetStudent(txtIDNumber.Text, ref msg);
     if (student.StudentId != null)
     {               
         return true;
     }
     else
         return false;
 }
Exemple #3
0
        public void TranslatEnrolBDOToEnrol(StudentEnrollmentBDO seb, StudentEnrollment se)
        {
            StudentService ss  = new StudentService();
            Student        stu = new Student();

            ss.TranslateStudentBDOToStudentDTO(seb.Student, stu);
            se.StudentSY            = seb.StudentSY;
            se.StudentId            = seb.StudentId;
            se.SY                   = seb.SY;
            se.GradeLevel           = seb.GradeLevel;
            se.GradeSectionCode     = seb.GradeSectionCode;
            se.Dismissed            = seb.Dismissed;
            se.Stat                 = seb.Stat;
            se.DiscountId           = (int)seb.DiscountId;
            se.StudentName          = stu.LastName + ", " + stu.FirstName + " " + stu.MiddleName;
            se.StudentEnrollmentsID = seb.StudentEnrollmentsID;
            se.student              = stu;
        }
        public bool EnrolIrregStudent(StudentEnrollment studentEnr)
        {
            GradeSectionLogic gsl = new GradeSectionLogic();
            StudentService ss = new StudentService();
            StudentEnrollmentBDO studentBDO = new StudentEnrollmentBDO();
            TranslatEnrolToEnrolBDO(studentEnr, studentBDO);
            string message = string.Empty;
            if (sel.RegisterStudent(studentBDO, ref message))
            {
                string section = String.Empty;
                int gsc = (int)studentEnr.GradeSectionCode;
                section = gsl.GetSection(gsc);
                ss.UpdateStudent(studentEnr.StudentId, studentEnr.GradeLevel, studentEnr.Rank, section);
                ControlStudentCharacters(studentBDO);
                return true;
            }

            else return false;
        }
        public void LoadStudents()
        {
            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());
            }

        }
Exemple #6
0
        public bool EnrolIrregStudent(StudentEnrollment studentEnr)
        {
            GradeSectionLogic    gsl        = new GradeSectionLogic();
            StudentService       ss         = new StudentService();
            StudentEnrollmentBDO studentBDO = new StudentEnrollmentBDO();

            TranslatEnrolToEnrolBDO(studentEnr, studentBDO);
            string message = string.Empty;

            if (sel.RegisterStudent(studentBDO, ref message))
            {
                string section = String.Empty;
                int    gsc     = (int)studentEnr.GradeSectionCode;
                section = gsl.GetSection(gsc);
                ss.UpdateStudent(studentEnr.StudentId, studentEnr.GradeLevel, studentEnr.Rank, section);
                ControlStudentCharacters(studentBDO);
                return(true);
            }

            else
            {
                return(false);
            }
        }
Exemple #7
0
        public bool UpdateStudent(ref Student student, ref string message)
        {
            StudentService ss = new StudentService();

            return(ss.UpdateStudent(ref student, ref message));
        }
Exemple #8
0
        public Student GetStudent(string StudentId, ref string message)
        {
            StudentService ss = new StudentService();

            return(ss.GetStudent(StudentId, ref message));
        }
Exemple #9
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());
            }

        }
Exemple #10
0
        private void txtStudentId_Leave(object sender, EventArgs e)
        {
            Student student = new Student();
            string msg = string.Empty;
            IStudentService studentService = new StudentService();

            if (txtStudentId.Text == string.Empty) txtStudentId.Text = szStudentID;


            student = studentService.GetStudent(txtStudentId.Text, ref msg);
            if (student.StudentId != null)
            {
                MessageBox.Show("Student ID already exist!");
                txtStudentId.Text = szStudentID;
                txtStudentId.Focus();
                return;
            }
        }
Exemple #11
0
 public bool UpdateStudent(ref Student student, ref string message)
 {
     StudentService ss = new StudentService();
     return ss.UpdateStudent(ref student, ref message);
 }
Exemple #12
0
 public Student GetStudent(string StudentId, ref string message)
 {
     StudentService ss = new StudentService();
     return ss.GetStudent(StudentId, ref message);
 }
Exemple #13
0
        public void TranslatEnrolBDOToEnrol(StudentEnrollmentBDO seb, StudentEnrollment se)
        {
            StudentService ss = new StudentService();
            Student stu = new Student();

            ss.TranslateStudentBDOToStudentDTO(seb.Student, stu);
            se.StudentSY = seb.StudentSY;
            se.StudentId = seb.StudentId;
            se.SY = seb.SY;
            se.GradeLevel = seb.GradeLevel;
            se.GradeSectionCode = seb.GradeSectionCode;
            se.Dismissed = seb.Dismissed;
            se.Stat = seb.Stat;
            se.DiscountId = (int)seb.DiscountId;
            se.StudentName = stu.LastName + ", " + stu.FirstName + " " + stu.MiddleName;
            se.StudentEnrollmentsID = seb.StudentEnrollmentsID;
            se.student = stu;

        }
Exemple #14
0
 public Student StudentInfoWithRank(string IDnum, string gradelevel, string gender)
 {
     StudentService ss = new StudentService();
     return ss.StudentInfoWithRank(IDnum, gradelevel, gender);
 }
Exemple #15
0
 public bool UpdateStudentBalance(string studentSy, string studentID, float assessmentfee)
 {
     string message = "";
     StudentService ss = new StudentService();
     Student stu = new Student();
     stu = ss.GetStudent(studentID, ref message);
     stu.RunningBalance = stu.RunningBalance + assessmentfee;            
     return ss.UpdateStudent(ref stu, ref message);
 }
Exemple #16
0
 public bool UpdateStudentSection(string studentSy, int gradeSectionCode, string section)
 {
     ssl.UpdateStudentSection(studentSy, gradeSectionCode);
     StudentService ss = new StudentService();
     ss.UpdateStudent(studentSy.Substring(0,8), section);
     return true;
 }
Exemple #17
0
 private void GenerateStudentID()
 {
     IStudentService studentService = new StudentService();
     szStudentID = studentService.GenerateStudentId();
     txtStudentId.Text = szStudentID;
 }
Exemple #18
0
        public Student StudentInfoWithRank(string IDnum, string gradelevel, string gender)
        {
            StudentService ss = new StudentService();

            return(ss.StudentInfoWithRank(IDnum, gradelevel, gender));
        }
Exemple #19
0
        private void Save()
        {
            string szGender = string.Empty;
            if (cmbGender.Text == "Female") szGender = "F";
            if (cmbGender.Text == "Male") szGender = "M";
            Boolean ret = false;
            string message = String.Empty;

            byte[] bImage = null;
            if (pbImage.BackgroundImage != null) bImage = imageToByteArray(pbImage.BackgroundImage, ImageFormat.Png);
            var convertDecimal = Convert.ToDecimal(txtFail.Text);
            IStudentService studentService = new StudentService();
            int schoId= studentService.GetScholarshipDiscountId("none");
            Student student = new Student();

            student.StudentId = txtStudentId.Text;
            student.FirstName = txtFirstName.Text;
            student.MiddleName = txtMiddleName.Text;
            student.LastName = txtLastName.Text;
            student.Average = double.Parse(txtPrevGPA.Text);
            student.Image = bImage;
            student.SchoolLastAttended = txtSchoolLastAttended.Text;
            student.GradeBeforeDC = cmbGradeLevel.SelectedValue.ToString();
            student.DOB = dtDOB.Value;
            student.MadrasahEnrolled = chkMadrasah.Checked;
            student.Card = chkReportCard.Checked;
            student.GoodMoral = chkGoodMoral.Checked;
            student.Gender = szGender;
            student.BirthCertificate = chkBirthCertificate.Checked;
            student.POBAddress = txtPOB_Street.Text;
            student.POBBarangay = txtPOB_Brgy.Text;
            student.POBProvince = txtPOB_Province.Text;
            student.POBTownCity = txtPOB_Town.Text;
            student.HomeAddress = txtHA_Street.Text;
            student.HomeProvince = txtHA_Province.Text;
            student.HomeBarangay = txtHA_Brgy.Text;
            student.HomeTownCity = txtHA_Town.Text;
            student.FathersName = txtFather_FullName.Text;
            student.FathersOccupation = txtFather_Occupation.Text;
            student.FathersAverageYearlyIncome = double.Parse(txtFather_Income.Text);
            student.FathersEducation = txtFather_EducAttainment.Text;
            student.MothersMaidenName = txtMother_FullName.Text;
            student.MothersEducation = txtMother_EducAttainment.Text;
            student.MothersOccupation = txtMother_Occupation.Text;
            student.MothersAverageYearlyIncome = double.Parse(txtMother_Income.Text);
            student.GuardiansName = txtGuardian_FullName.Text;
            student.GuardiansOccupation = txtGuardian_Occupation.Text;
            student.GuardiansAverageYearlyIncome = double.Parse(txtGuardian_Income.Text);
            student.ScholarshipDiscountId = schoId;
            student.UnitsFailedLastYear = convertDecimal;
            student.DateAdmitted = System.DateTime.Now;
            student.Religion = cbReligion.Text;
            student.StudentLRN = txtLRN.Text;


            if (Op.Equals("edit"))
            {
                student.GradeLevel = SelectedStudent.GradeLevel;
                student.Section = SelectedStudent.Section;
                ret = studentService.UpdateStudent(ref student, ref message);
                Log("U", "Students", student);
                
            }
            else
            {
                ret = studentService.CreateStudent(ref student, ref message);
                Log("C", "Students", student);
              
            }
            if (ret)
                MessageBox.Show("Saved Successfully");
            else
                MessageBox.Show("Error Saving");

            Close();
        }
Exemple #20
0
        private void btnDelete_Click_1(object sender, EventArgs e)
        {
            if (gvStudent.CurrentRow == null)
                return;

            string message = String.Empty;
            IStudentService studentService = new StudentService();
            if (studentService.DismissStudent(studentSelected.StudentId, ref message)) {
                ILogService logService = new LogService();
                studentSelected.Dismissed = true;
                string json = JsonConvert.SerializeObject(studentSelected);
                Log log = new Log
                {
                    CLUD = "D",
                    LogDate = DateTime.Now,
                    TableName = "Students",
                    UserId = GlobalClass.user.UserId,
                    UserName = GlobalClass.user.UserName,
                    PassedData = json
                };
                logService.AddLogs(log);

            }

            MessageBox.Show(this, "Student Dismissed");
                        
        }