private void createbutton_Click(object sender, EventArgs e)
        {
            CourseRegistration           c     = new CourseRegistration();
            CourseRepository             cRepo = new CourseRepository();
            CourseRegistrationRepository d     = new CourseRegistrationRepository();
            CourseResultsRepository      rr    = new CourseResultsRepository();

            c.CourseId   = this.courseidtextBox.Text;
            c.CourseName = d.GetCourse2(this.courseidtextBox.Text).CourseName;

            c.Section   = d.GetCourse2(this.courseidtextBox.Text).Section;
            c.Semester  = d.GetCourse2(this.courseidtextBox.Text).Semester;
            c.AccountId = this.accountidtextBox.Text;
            c.Status    = "Confirmed";
            CourseRegistrationRepository cr    = new CourseRegistrationRepository();
            CourseRepository             r     = new CourseRepository();
            AccountRepository            ar    = new AccountRepository();
            StudentBalanceRepository     sRepo = new StudentBalanceRepository();
            StudentBalance sb = new StudentBalance();

            sb.AccountId = this.accountidtextBox.Text;

            try
            {
                s = ar.GetAccountTypeShovon2(c.AccountId).AccountType;
            }
            catch
            {
            }

            if (cr.CourseVerification2(c.CourseId) == this.courseidtextBox.Text && s == "Student" && cRepo.GetCourse2(this.courseidtextBox.Text).MaxStudent != cRepo.GetCourse2(this.courseidtextBox.Text).CurrentStudent)
            {
                if (cr.DoubleIDRegistrationVerify(this.accountidtextBox.Text, this.courseidtextBox.Text).Contains(this.accountidtextBox.Text))
                {
                    MessageBox.Show("Student Already In the Course ");
                }
                else
                {
                    if (cr.Insert2(c) && rr.DoReg(c.AccountId, c.CourseId, c.Semester, c.Section, c.CourseName) && sRepo.UpdateStudentBalance(sb))
                    {
                        if (r.Increase2(c.CourseId))
                        {
                            MessageBox.Show("Successful");
                        }
                        else
                        {
                            MessageBox.Show("Error Current Student Not Increased");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error Inserting");
                    }
                }
            }
            else
            {
                MessageBox.Show("Error Course Or Student Verification");
            }
        }
示例#2
0
        public ValidPayment()
        {
            InitializeComponent();
            StudentBalanceRepository sRepo = new StudentBalanceRepository();

            this.comboBoxAccountId.DataSource = sRepo.GetAccountIdsInvalid2();
        }
        public HandleScholarship()
        {
            InitializeComponent();
            StudentBalanceRepository sRepo = new StudentBalanceRepository();

            this.comboBoxAccountId.DataSource = sRepo.GetAccountIdsScholarshipApprove2();
        }
        private void EligibleClicked(object sender, EventArgs e)
        {
            StudentBalanceRepository sRepo = new StudentBalanceRepository();
            StudentBalance           s     = new StudentBalance();

            s.AccountId   = this.comboBoxAccountId.Text;
            s.Scholarship = "Eligible For Scholarship";
            if (sRepo.UpdateScholarshipEligible2(s))
            {
                MessageBox.Show("Scholarship Is Eligible Now", "Successful");
            }
            else
            {
                MessageBox.Show("Error", "Failed");
            }
        }
示例#5
0
        private void ValidClicked(object sender, EventArgs e)
        {
            StudentBalance s = new StudentBalance();

            s.AccountId = this.comboBoxAccountId.Text;
            s.Balance   = 0;
            StudentBalanceRepository sRepo = new StudentBalanceRepository();

            if (sRepo.UpdateInvalide2(s))
            {
                MessageBox.Show("Validation Updated", "Successful");
            }
            else
            {
                MessageBox.Show("Error", "Failed");
            }
        }
        private void ApproveClicked(object sender, EventArgs e)
        {
            StudentBalanceRepository sRepo = new StudentBalanceRepository();
            StudentBalance           s     = new StudentBalance();

            s.AccountId   = this.comboBoxAccountId.Text;
            s.Scholarship = this.textBoxScholarshipPercentage.Text;

            if (sRepo.UpdateScholarshipPercentage2(s))
            {
                MessageBox.Show("Scholarship Updated", "Successful");
            }
            else
            {
                MessageBox.Show("Error", "Failed");
            }
        }
示例#7
0
        private void createbutton_MouseClick(object sender, MouseEventArgs e)
        {
            Account t = new Account();

            t.AccountId   = this.idtextBox.Text;
            t.Password    = this.passsettextBox.Text;
            t.Gender      = this.gendercomboBox.Text;
            t.Address     = this.addresstextBox.Text;
            t.Name        = this.nametextBox.Text;
            t.AccountType = "Student";
            t.BloodGroup  = this.bloodgrouptextbox.Text;
            t.DOB         = this.dobtextbox.Text;
            StudentBalance q = new StudentBalance();

            q.AccountId   = this.idtextBox.Text;
            q.Semester    = "none";
            q.Scholarship = "none";
            q.Balance     = 0;
            q.Validation  = "invalid";


            AccountRepository        aRepo = new AccountRepository();
            StudentBalanceRepository sRepo = new StudentBalanceRepository();

            if (aRepo.DoubleAccountIDRegistrationVerify().Contains(this.idtextBox.Text))
            {
                MessageBox.Show("Account Exixists");
            }
            else
            {
                if (aRepo.Insert2(t))
                {
                    if (sRepo.Insert2(q))
                    {
                        MessageBox.Show("Successful Creation");
                    }
                }
                else
                {
                    MessageBox.Show("Creation Failed ", "Failed");
                }
            }
        }
        private void button5_Click(object sender, EventArgs e)
        {
            CourseRegistrationRepository r  = new CourseRegistrationRepository();
            AccountRepository            ar = new AccountRepository();
            StudentBalanceRepository     sr = new StudentBalanceRepository();

            if (r.RoutineVerification2(this.accountidtextBox.Text, this.semestertextBox.Text))
            {
                List <Course> aList  = r.GetAllCourse2(this.accountidtextBox.Text, this.semestertextBox.Text);
                string        q      = this.accountidtextBox.Text + this.semestertextBox.Text + "payment.pdf";
                FileStream    fs     = new FileStream(q, FileMode.Create, FileAccess.Write, FileShare.None);
                Document      doc    = new Document();
                PdfWriter     writer = PdfWriter.GetInstance(doc, fs);
                doc.Open();
                Paragraph p = new Paragraph(this.accountidtextBox.Text);
                p.Alignment = Element.ALIGN_CENTER;
                doc.Add(p);
                Paragraph s = new Paragraph(this.semestertextBox.Text);
                s.Alignment = Element.ALIGN_CENTER;
                doc.Add(s);
                Paragraph n = new Paragraph(ar.GetAccountTypeShovon2(this.accountidtextBox.Text).Name);
                n.Alignment = Element.ALIGN_RIGHT;
                doc.Add(n);
                foreach (Course c in aList)
                {
                    Paragraph c1 = new Paragraph(c.Name + "    " + c.Schedule);
                    doc.Add(c1);
                }
                Paragraph p1 = new Paragraph("Pay:" + sr.GetBalance(this.accountidtextBox.Text).ToString() + "Taka");
                doc.Add(p1);


                MessageBox.Show("Payment Created");

                doc.Close();
            }
            else
            {
                MessageBox.Show("Student Is Not Registered For This Semester");
            }
        }