private void btnOK_Click(object sender, EventArgs e)
        {
            frmReportViewer statementOfAccountReport;

            statementOfAccountReport = new frmReportViewer("Statement Of Account Report", new rptStatementOfAccount()
                , new KeyValuePair<string, object>("Student No", txtStudentNo.Text));

            statementOfAccountReport.Show();

            this.Close();
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            frmReportViewer studentsPerSubjectReport;

            studentsPerSubjectReport = new frmReportViewer("Students Per Subject Report", new rptStudentsPerSubject()
                , new KeyValuePair<string, object>("Item Number", txtCourse.Text)
                , new KeyValuePair<string, object>("Date From", dtpFrom.Value)
                , new KeyValuePair<string, object>("Date To", dtpTo.Value));

            studentsPerSubjectReport.Show();

            this.Close();
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            frmReportViewer enrolledSubjectsReport;

            enrolledSubjectsReport = new frmReportViewer("Enrolled Subjects Report", new rptEnrolledSubjects()
                , new KeyValuePair<string, object>("Customer No", txtCustomerNo.Text)
                , new KeyValuePair<string, object>("Date From", dtpFrom.Value)
                , new KeyValuePair<string, object>("Date To", dtpTo.Value));

            enrolledSubjectsReport.Show();

            this.Close();
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //check detail windows
            if (!WindowOpen(discountDetails) && !WindowOpen(paymentDetails))
            {
                if (Required())
                {
                    try
                    {
                        transaction.DocumentNumber = txtAssessmentNo.Text;
                        if (transaction.TransactionType == Transaction_Type.Assessment)
                        {
                            transaction.ExpirationDate = transaction.DocumentDate.AddDays(Convert.ToInt32(config["Quote_Expiration"]));
                        }
                        transaction.StudentID    = txtStudentID.Text;
                        transaction.StudentName  = txtName.Text;
                        transaction.BatchID      = txtBatchID.Text;
                        transaction.DocumentDate = dtpDocumentDate.Value;
                        transaction.CurrencyID   = txtCurrencyID.Text;
                        transaction.Comments     = txtRemarks.Text;

                        //Added code 5/4/12
                        transaction.InstallmentFee = Convert.ToDecimal(txtInstallmentFee.Text);

                        //Added Code 5/7/12
                        transaction.RecalculatePaymentSchedules();
                        //transaction.totalMiscellaneousFees = Convert.ToDecimal(txtInstallmentFee.Text) + Convert.ToDecimal(txtMiscellaneousFees.Text);

                        TransactionAdapter.Instance.SaveTransaction(transaction
                                                                    , documentID
                                                                    , config["Default_Site_ID"].ToString());

                        //addedd 20101006 - clear first before printing the report
                        clearHeader();
                        clearItems();
                        clearTotals();

                        using (frmChooseForm chooseForm = new frmChooseForm())
                        {
                            if (chooseForm.ShowDialog() == DialogResult.OK)
                            {
                                //TODO: add code to choose report to show

                                frmReportViewer assessmentReport;

                                if (chooseForm.SelectedAssessmentForm == AssessmentForm.BasicEducation)
                                {
                                    assessmentReport = new frmReportViewer("Assessment Report", new rptAssessment()
                                                                           , new KeyValuePair <string, object>("Assessment No", transaction.DocumentNumber)
                                                                           , new KeyValuePair <string, object>("SOP Type", (int)transaction.TransactionType));

                                    assessmentReport.Show();
                                }
                                else if (chooseForm.SelectedAssessmentForm == AssessmentForm.College)
                                {
                                    assessmentReport = new frmReportViewer("Assessment Report", new rptCollegeAssessment()
                                                                           , new KeyValuePair <string, object>("Assessment No", transaction.DocumentNumber)
                                                                           , new KeyValuePair <string, object>("SOP Type", (int)transaction.TransactionType));

                                    assessmentReport.Show();
                                }
                            }
                        }

                        //show assessment report
                        //frmReportViewer assessmentReport = new frmReportViewer();//transaction.DocumentNumber, (int)transaction.TransactionType);

                        transaction = null;
                    }
                    catch (Exception ex)
                    {
                        log.Error(ex);
                        Prompt.ShowError(ex.Message);
                    }
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            using (frmChooseForm chooseForm = new frmChooseForm())
            {
                if (chooseForm.ShowDialog() == DialogResult.OK)
                {
                    frmReportViewer assessmentReport;

                    if (chooseForm.SelectedAssessmentForm == AssessmentForm.BasicEducation)
                    {
                        assessmentReport = new frmReportViewer("Assessment Report", new rptAssessment()
                        , new KeyValuePair<string, object>("Assessment No", transaction.DocumentNumber)
                        , new KeyValuePair<string, object>("SOP Type", (int)transaction.TransactionType));

                        assessmentReport.Show();
                    }
                    else if (chooseForm.SelectedAssessmentForm == AssessmentForm.College)
                    {
                        assessmentReport = new frmReportViewer("Assessment Report", new rptCollegeAssessment()
                        , new KeyValuePair<string, object>("Assessment No", transaction.DocumentNumber)
                        , new KeyValuePair<string, object>("SOP Type", (int)transaction.TransactionType));

                        assessmentReport.Show();
                    }

                }
            }
        }
Exemple #6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //check detail windows
            if (!WindowOpen(discountDetails) && !WindowOpen(paymentDetails))
            {
                if (Required())
                {
                    try
                    {
                        transaction.DocumentNumber = txtAssessmentNo.Text;
                        if (transaction.TransactionType == Transaction_Type.Assessment)
                        {
                            transaction.ExpirationDate = transaction.DocumentDate.AddDays(Convert.ToInt32(config["Quote_Expiration"]));
                        }
                        transaction.StudentID = txtStudentID.Text;
                        transaction.StudentName = txtName.Text;
                        transaction.BatchID = txtBatchID.Text;
                        transaction.DocumentDate = dtpDocumentDate.Value;
                        transaction.CurrencyID = txtCurrencyID.Text;
                        transaction.Comments = txtRemarks.Text;

                        //Added code 5/4/12
                        transaction.InstallmentFee = Convert.ToDecimal(txtInstallmentFee.Text);

                        //Added Code 5/7/12
                        transaction.RecalculatePaymentSchedules();
                        //transaction.totalMiscellaneousFees = Convert.ToDecimal(txtInstallmentFee.Text) + Convert.ToDecimal(txtMiscellaneousFees.Text);

                        TransactionAdapter.Instance.SaveTransaction(transaction
                            , documentID
                            , config["Default_Site_ID"].ToString());

                        //addedd 20101006 - clear first before printing the report
                        clearHeader();
                        clearItems();
                        clearTotals();

                        using (frmChooseForm chooseForm = new frmChooseForm())
                        {
                            if (chooseForm.ShowDialog() == DialogResult.OK)
                            {
                                //TODO: add code to choose report to show

                                frmReportViewer assessmentReport;

                                if (chooseForm.SelectedAssessmentForm == AssessmentForm.BasicEducation)
                                {
                                    assessmentReport = new frmReportViewer("Assessment Report", new rptAssessment()
                                    , new KeyValuePair<string, object>("Assessment No", transaction.DocumentNumber)
                                    , new KeyValuePair<string, object>("SOP Type", (int)transaction.TransactionType));

                                    assessmentReport.Show();
                                }
                                else if(chooseForm.SelectedAssessmentForm == AssessmentForm.College)
                                {
                                    assessmentReport = new frmReportViewer("Assessment Report", new rptCollegeAssessment()
                                    , new KeyValuePair<string, object>("Assessment No", transaction.DocumentNumber)
                                    , new KeyValuePair<string, object>("SOP Type", (int)transaction.TransactionType));

                                    assessmentReport.Show();
                                }
                            }
                        }

                        //show assessment report
                        //frmReportViewer assessmentReport = new frmReportViewer();//transaction.DocumentNumber, (int)transaction.TransactionType);

                        transaction = null;
                    }
                    catch (Exception ex)
                    {
                        log.Error(ex);
                        Prompt.ShowError(ex.Message);
                    }
                }
            }
        }