示例#1
0
        private void barButtonItem25_ItemClick(object sender, ItemClickEventArgs e)
        {
            var number = new frmSubmitText("Learner Number", "Please enter learner number");
            number.ShowDialog();
            while (Database.Count("learner_details", "LearnerNumber = '" + number.Selection + "' AND Division = '" +
                GlobalProperties.loggedOnUserDivison + "'") == 0)
            {
                if (number.Selection == "***")
                    return;
                MessageBox.Show("Invalid Learner Number", "Error");
                number.ShowDialog();
            }
            string reactivate =
                MessageBox.Show("Would you like to request a re-activation?", "Re-Activation Request",
                                MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes
                    ? "Yes"
                    : "No";
            var Data = Database.Row("learner_details", "LearnerNumber = '" + number.Selection + "' AND Division = '" +
                                                       GlobalProperties.loggedOnUserDivison + "'");
            var report = new rptEnquiry();
            report.DataDefinition.FormulaFields["college"].Text = "\"" + GlobalProperties.LoggedOnUserDivision + "\"";
            report.DataDefinition.FormulaFields["clerk"].Text = "\"" + GlobalProperties.loggedOnUser + "\"";
            report.DataDefinition.FormulaFields["learnerName"].Text = "\"" + Data["Name"] + " " + Data["Surname"] + "\"";
            report.DataDefinition.FormulaFields["learnerNumber"].Text = "\"" + number.Selection + "\"";
            report.DataDefinition.FormulaFields["reactivate"].Text = "\"" + reactivate + "\"";

            var frmReport = new frmReport(report) { Text = "Enquiry on Handover / Re-Activation" };
            frmReport.ShowDialog();
        }
示例#2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptEnquiry rpt = new rptEnquiry();
     rpt.Site = this.Site;
     return rpt;
 }