예제 #1
0
 public Boolean UpdateStudent(ref Student student, ref string message)
 {
     message = String.Empty;
     StudentBDO studentBDO = new StudentBDO();
     TranslateStudentDTOToStudentBDO(student, studentBDO);
     return studentLogic.UpdateStudent(ref studentBDO, ref message);
 }
예제 #2
0
        private void gvStudent_SelectionChanged(object sender, EventArgs e)
        {
            int selectedIndex = gvStudent.CurrentRow.Index;

            if (selectedIndex >= 0)
            {
                string sID = gvStudent.Rows[selectedIndex].Cells["StudentId"].Value.ToString();
                studentSelected = studentList.Find(x => x.StudentId.ToString() == sID);
            }
        }
예제 #3
0
 public Boolean CreateStudent(ref Student student, ref string message)
 {
     Boolean ret = false;
     message = String.Empty;
     StudentBDO studentBDO = new StudentBDO();
     TranslateStudentDTOToStudentBDO(student, studentBDO);
     ret = studentLogic.CreateStudent(ref studentBDO, ref message);
     //if (student.Siblings.Count > 0)
     //    studentLogic.CreateSibling(studentBDO.Siblings,studentBDO.StudentId);
     return ret;
 }
예제 #4
0
        public List<Student> GetAllStudents()
        {

            List<StudentBDO> studentBDOList = studentLogic.GetAllStudents();
            List<Student> allStudents = new List<Student>();
            foreach (StudentBDO studentBDO in studentBDOList)
            {
                Student student = new Student();
                TranslateStudentBDOToStudentDTO(studentBDO, student);
                allStudents.Add(student);
            }
            return allStudents;
        }
예제 #5
0
        public Student GetStudent(string studentId, ref string message)
        {
            Student student = new Student();
            StudentBDO sbdo = studentLogic.GetStudent(studentId);

            if (sbdo != null)
            {
                TranslateStudentBDOToStudentDTO(sbdo, student);
            }
            else message = "Student Does Not Exists";

            return student;
        }
예제 #6
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;
 }
예제 #7
0
        private void Search()
        {

            string message = string.Empty;

            string StudentID = txtStudentID.Text.ToString();

            Student = registrationService.GetStudent(txtStudentID.Text, ref message);

            Studentv2 = studentService.GetStudent(txtStudentID.Text, ref message);

            if (StudentID == "")
            {
                MessageBox.Show("Please provide the ID Number");
                txtStudentID.Text = string.Empty;
                txtStudentID.Focus();
                return;
            }
            else if (Studentv2.StudentId == null)
            {
                MessageBox.Show("ID Number does not exist", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtStudentID.Text = string.Empty;
                txtStudentID.Focus();
                return;
            }
            else {
                
                SetFields();
                studentsv2.Add(Studentv2);
                if (studentsv2.Count == 2)
                {
                    studentsv2.RemoveAt(0);
                    this.gvStudentList.DataSource = null;
                    this.gvStudentList.Rows.Clear();
                    this.gvStudentList.DataSource = studentsv2;
                }
                else {
                    this.gvStudentList.DataSource = studentsv2;
                }
            }
        }
예제 #8
0
 public Student StudentInfoWithRank(string StudentId, string gradeLevel, string gender)
 {
     Student s = new Student();
     StudentBDO sbdo = new StudentBDO();
     sbdo = studentLogic.GetStudentWithRank(StudentId, gradeLevel, gender);
     TranslateStudentBDOToStudentDTO(sbdo, s);
     return s;
 }
예제 #9
0
        public void TranslateStudentBDOToStudentDTO(StudentBDO studentBDO, Student student)
        {
            List<Sibling> sibList = new List<Sibling>();
            foreach (SiblingBDO s in studentBDO.Siblings)
            {
                Sibling sib = new Sibling();
                TranslateSiblingBDOToSibling(s, sib);
                sibList.Add(sib);
            }

            student.StudentId = studentBDO.StudentId;
            student.LastName = studentBDO.LastName;
            student.FirstName = studentBDO.FirstName;
            student.MiddleName = studentBDO.MiddleName;
            student.DOB = studentBDO.DOB;
            student.POBAddress = studentBDO.POBAddress;
            student.POBBarangay = studentBDO.POBBarangay;
            student.POBTownCity = studentBDO.POBTownCity;
            student.POBProvince = studentBDO.POBProvince;
            student.HomeAddress = studentBDO.HomeAddress;
            student.HomeBarangay = studentBDO.HomeBarangay;
            student.HomeTownCity = studentBDO.HomeTownCity;
            student.HomeProvince = studentBDO.HomeProvince;
            student.SchoolLastAttended = studentBDO.SchoolLastAttended;
            student.FathersName = studentBDO.FathersName;
            student.FathersOccupation = studentBDO.FathersOccupation;
            student.FathersAverageYearlyIncome = studentBDO.FathersAverageYearlyIncome;
            student.FathersEducation = studentBDO.FathersEducation;
            student.MothersMaidenName = studentBDO.MothersMaidenName;
            student.MothersOccupation = studentBDO.MothersOccupation;
            student.MothersAverageYearlyIncome = studentBDO.MothersAverageYearlyIncome;
            student.MothersEducation = studentBDO.MothersEducation;
            student.GuardiansName = studentBDO.GuardiansName;
            student.GuardiansOccupation = studentBDO.GuardiansOccupation;
            student.GuardiansAverageYearlyIncome = studentBDO.GuardiansAverageYearlyIncome;
            student.MadrasahEnrolled = studentBDO.MadrasahEnrolled;
            student.DateAdmitted = studentBDO.DateAdmitted;
            student.GradeLevel = studentBDO.GradeLevel;
            student.Average = studentBDO.Average;
            student.Card = studentBDO.Card;
            student.GoodMoral = studentBDO.GoodMoral;
            student.BirthCertificate = studentBDO.BirthCertificate;
            if (studentBDO.ScholarshipDiscountId == null)
                student.ScholarshipDiscountId = null;
            else student.ScholarshipDiscountId = (int)studentBDO.ScholarshipDiscountId;
            student.LastSYAttendedDCFI = studentBDO.LastSYAttendedDCFI;
            student.Dismissed = studentBDO.Dismissed;
            student.Graduate = studentBDO.Dismissed;
            student.Religion = studentBDO.Religion;
            student.Image = studentBDO.Image;
            student.Gender = studentBDO.Gender;
            student.Siblings = sibList;
            student.UnitsFailedLastYear = (decimal)studentBDO.UnitsFailedLastYear;
            student.RunningBalance = (float)studentBDO.RunningBalance;
            student.ranking = studentBDO.ranking;
            student.Section = studentBDO.Section;
            student.StudentLRN = studentBDO.StudentLRN;
            student.GradeBeforeDC = studentBDO.GradeBeforeDC;

        }
예제 #10
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);
 }
예제 #11
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();
        }
예제 #12
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;
            }
        }
예제 #13
0
 private Boolean IsNew(Student student)
 {
     if (String.IsNullOrEmpty(student.GradeLevel))
         return true;
     else return false;
 }
예제 #14
0
 public bool UpdateStudent(ref Student student, ref string message)
 {
     StudentService ss = new StudentService();
     return ss.UpdateStudent(ref student, ref message);
 }
예제 #15
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;

        }
예제 #16
0
        private void btnPay_Click(object sender, EventArgs e)
        {
            if (gvStudentList.CurrentRow == null)
                return;

            if (txtPayment.Text == String.Empty)
                return;
            else
            {
                if (double.Parse(txtPayment.Text) == 0)
                    return;
            }


            if (Student.RunningBalance == 0)
                return;
            

            if (GlobalClass.receiptFrom == null)
            {
                MessageBox.Show("Set Receipt Number First");
            }
            else
            {
                PaymentReceiptDetails prd = new PaymentReceiptDetails();

                if (Int32.Parse(GlobalClass.receiptCurrent) <= Int32.Parse(GlobalClass.receiptTo))
                {
                    int tempReceipt;

                    tempReceipt = Int32.Parse(GlobalClass.receiptCurrent);
                    MessageBox.Show("Receipt Number From:                           " + GlobalClass.receiptFrom + "\n" + "Receipt Number To:                                " + GlobalClass.receiptTo + "\n" + "Receipt Number For This Transaction: " + GlobalClass.receiptCurrent);


                    Boolean ret = false;
                    string message = String.Empty;
                    string StudentId = txtStudentID.Text.ToString();
                    Student = registrationService.GetStudent(StudentId, ref message);
                    float runningBalanceProv = float.Parse(txtPayment.Text);
                    float runningBalanceNew;
                    float runningBalanceOld = Student.RunningBalance;
                    runningBalanceNew = runningBalanceOld - runningBalanceProv;

                    if (runningBalanceNew < 0)
                    {
                        
                        string balance = runningBalanceNew.ToString();
                        MessageBox.Show("Amount paid: " + runningBalanceProv + "\n" + "Change is: " + Math.Abs(runningBalanceNew));

                        prd.ORno = tempReceipt;
                        prd.StudentID = txtStudentID.Text;
                        prd.StudentName = Student.LastName + ", " + Student.FirstName + " " + Student.MiddleName.Substring(0, 1) + ".";
                        prd.Amount = runningBalanceOld;
                        prd.ShowDialog();

                        if (prd.btnPushed == "Generate Receipt")
                        {
                            //Payment Table
                            Payment.ORNo = tempReceipt;
                            Payment.StudentId = txtStudentID.Text;
                            Payment.ReceivedFrom = prd.ReceivedFrom;
                            Payment.TIN = prd.TIN;
                            Payment.BusinessStyle = prd.BusinessStyle;
                            Payment.SettlementFor = prd.PartialFull;
                            Payment.PaidTo = GlobalClass.user.UserId;
                            Payment.Cancelled = false;
                            Payment.Amount = prd.Amount;
                            Payment.PaidAt = DateTime.Now.ToString();


                            txtPayment.Clear();
                            gvStudentList.DataSource = null;

                            //Payment Transaction
                            paymentService.CreatePayment(ref Payment, ref message);

                            //Receipt
                            tempReceipt = tempReceipt + 1;
                            GlobalClass.receiptCurrent = tempReceipt.ToString();

                            Student.RunningBalance = 0;
                            ret = registrationService.UpdateStudent(ref Student, ref message);
                            students.Add(Student);

                            if (students.Count == 2)
                            {
                                students.RemoveAt(0);
                                this.gvStudentList.DataSource = null;
                                this.gvStudentList.Rows.Clear();
                                this.gvStudentList.DataSource = students;
                            }
                            else
                            {
                                this.gvStudentList.DataSource = students;
                            }

                            gvStudentList.Update();
                            gvStudentList.Refresh();

                        }
                        
                        
                    }
                    else if (runningBalanceNew == 0)
                    {
                         string balance = runningBalanceNew.ToString();
                        MessageBox.Show("Amount paid: " + runningBalanceProv + "\n" + "Change is: " + Math.Abs(runningBalanceNew));


                        prd.ORno = tempReceipt;
                        prd.StudentID = txtStudentID.Text;
                        prd.StudentName = Student.LastName + ", " + Student.FirstName + " " + Student.MiddleName.Substring(0, 1) + ".";
                        prd.Amount = float.Parse(txtPayment.Text);
                        prd.ShowDialog();

                        if (prd.btnPushed == "Generate Receipt")
                        {
                            //Payment Table
                            Payment.ORNo = tempReceipt;
                            Payment.StudentId = txtStudentID.Text;
                            Payment.ReceivedFrom = prd.ReceivedFrom;
                            Payment.TIN = prd.TIN;
                            Payment.BusinessStyle = prd.BusinessStyle;
                            Payment.SettlementFor = prd.PartialFull;
                            Payment.PaidTo = GlobalClass.user.UserId;
                            Payment.Cancelled = false;
                            Payment.Amount = prd.Amount;
                            Payment.PaidAt = DateTime.Now.ToString();

                           

                            txtPayment.Clear();
                            gvStudentList.DataSource = null;


                            //Payment Transaction
                            paymentService.CreatePayment(ref Payment, ref message);


                            //Receipt
                            tempReceipt = tempReceipt + 1;
                            GlobalClass.receiptCurrent = tempReceipt.ToString();

                            Student.RunningBalance = 0;
                            ret = registrationService.UpdateStudent(ref Student, ref message);
                            students.Add(Student);
                            if (students.Count == 2)
                            {
                                students.RemoveAt(0);
                                this.gvStudentList.DataSource = null;
                                this.gvStudentList.Rows.Clear();
                                this.gvStudentList.DataSource = students;
                            }
                            else
                            {
                                this.gvStudentList.DataSource = students;
                            }

                            gvStudentList.Update();
                            gvStudentList.Refresh();
                        }
                    }
                    else
                    {
                       string balance = runningBalanceNew.ToString();
                        MessageBox.Show("Amount paid: " + runningBalanceProv + "\n" + "Current Balance is: " + Math.Abs(runningBalanceNew));


                        prd.ORno = tempReceipt;
                        prd.StudentID = txtStudentID.Text;
                        prd.StudentName = Student.LastName + ", " + Student.FirstName + " " + Student.MiddleName.Substring(0, 1) + ".";
                        prd.Amount = float.Parse(txtPayment.Text);
                        prd.ShowDialog();

                        if (prd.btnPushed == "Generate Receipt")
                        {
                            //Payment Table
                            Payment.ORNo = tempReceipt;
                            Payment.StudentId = txtStudentID.Text;
                            Payment.ReceivedFrom = prd.ReceivedFrom;
                            Payment.TIN = prd.TIN;
                            Payment.BusinessStyle = prd.BusinessStyle;
                            Payment.SettlementFor = prd.PartialFull;
                            Payment.PaidTo = GlobalClass.user.UserId;
                            Payment.Cancelled = false;
                            Payment.Amount = prd.Amount;
                            Payment.PaidAt = DateTime.Now.ToString();

                            

                            txtPayment.Clear();
                            gvStudentList.DataSource = null;

                            //Payment Transaction
                            paymentService.CreatePayment(ref Payment, ref message);

                            //Receipt
                            tempReceipt = tempReceipt + 1;
                            GlobalClass.receiptCurrent = tempReceipt.ToString();

                            Student.RunningBalance = runningBalanceNew;
                            ret = registrationService.UpdateStudent(ref Student, ref message);
                            students.Add(Student);
                            if (students.Count == 2)
                            {
                                students.RemoveAt(0);
                                this.gvStudentList.DataSource = null;
                                this.gvStudentList.Rows.Clear();
                                this.gvStudentList.DataSource = students;
                            }
                            else
                            {
                                this.gvStudentList.DataSource = students;
                            }

                            gvStudentList.Update();
                            gvStudentList.Refresh();
                        }

                    }

                    if (prd.btnPushed == "Cancel")
                    {
                        if (ret)
                            MessageBox.Show("Saved Successfully");
                        else
                            MessageBox.Show("Error Saving");
                    }
                    GlobalClass.WindowStatusPaymentDetails = false;
                }
                else
                {
                    MessageBox.Show("No More Receipt");
                }
            }
        }
예제 #17
0
        public void TranslateStudentDTOToStudentBDO(Student student, StudentBDO studentBDO)
        {
            //ScholarshipBDO scho = new ScholarshipBDO();
            //TranslateScholarshipToScholarshipBDO(student.Scholarships, scho);
            studentBDO.ScholarshipDiscountId = student.ScholarshipDiscountId;
            //List<SiblingBDO> sibList = ToSiblingBDOList(student.Siblings);

            studentBDO.StudentId = student.StudentId;
            studentBDO.LastName = student.LastName;
            studentBDO.FirstName = student.FirstName;
            studentBDO.MiddleName = student.MiddleName;
            studentBDO.DOB = student.DOB;
            studentBDO.POBAddress = student.POBAddress;
            studentBDO.POBBarangay = student.POBBarangay;
            studentBDO.POBTownCity = student.POBTownCity;
            studentBDO.POBProvince = student.POBProvince;
            studentBDO.HomeAddress = student.HomeAddress;
            studentBDO.HomeBarangay = student.HomeBarangay;
            studentBDO.HomeTownCity = student.HomeTownCity;
            studentBDO.HomeProvince = student.HomeProvince;
            studentBDO.SchoolLastAttended = student.SchoolLastAttended;
            studentBDO.FathersName = student.FathersName;
            studentBDO.FathersOccupation = student.FathersOccupation;
            studentBDO.FathersAverageYearlyIncome = student.FathersAverageYearlyIncome;
            studentBDO.FathersEducation = student.FathersEducation;
            studentBDO.MothersMaidenName = student.MothersMaidenName;
            studentBDO.MothersOccupation = student.MothersOccupation;
            studentBDO.MothersAverageYearlyIncome = student.MothersAverageYearlyIncome;
            studentBDO.MothersEducation = student.MothersEducation;
            studentBDO.GuardiansName = student.GuardiansName;
            studentBDO.GuardiansOccupation = student.GuardiansOccupation;
            studentBDO.GuardiansAverageYearlyIncome = student.GuardiansAverageYearlyIncome;
            studentBDO.MadrasahEnrolled = student.MadrasahEnrolled;
            studentBDO.DateAdmitted = student.DateAdmitted;
            studentBDO.GradeLevel = student.GradeLevel;
            studentBDO.Average = student.Average;
            studentBDO.Card = student.Card;
            studentBDO.GoodMoral = student.GoodMoral;
            studentBDO.BirthCertificate = student.BirthCertificate;

            studentBDO.LastSYAttendedDCFI = student.LastSYAttendedDCFI;
            studentBDO.Dismissed = student.Dismissed;
            studentBDO.Graduated = student.Graduate;
            studentBDO.Religion = student.Religion;
            //studentBDO.Scholarship = scho;
            studentBDO.Gender = student.Gender;
            studentBDO.UnitsFailedLastYear = student.UnitsFailedLastYear;
            studentBDO.RunningBalance = student.RunningBalance;
            //studentBDO.Siblings = sibList;
            studentBDO.ranking = student.ranking;
            studentBDO.Image = student.Image;
            studentBDO.Section = student.Section;
            studentBDO.StudentLRN = student.StudentLRN;
            studentBDO.GradeBeforeDC = student.GradeBeforeDC;
        }
예제 #18
0
        private void gvStudent_SelectionChanged(object sender, EventArgs e)
        {
            int selectedIndex = gvStudent.CurrentRow.Index;
            
            if (selectedIndex >= 0)
            {
                string sID = gvStudent.Rows[selectedIndex].Cells["StudentId"].Value.ToString();
                List<Student> item = new List<Student>();
                item = studentList.FindAll(x => x.StudentId.ToString() == sID);

                studentSelected = new Student();
                studentSelected = (Student)item[0];

            }
        }