Example #1
0
        private void barButtonItem22_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();
            }
            var reasonDe = new frmSubmitText("Learner Number", "Please enter reason for deactivation");
            reasonDe.ShowDialog();
            var reasonRe = new frmSubmitText("Learner Number", "Please enter reason for reactivation");
            reasonRe.ShowDialog();
            var report = new rptReactivation();
            var data =
                Database.Row("learner_details a, enrollments b, enrollmentscourses c, courses d",
                               "a.Division = '" + GlobalProperties.loggedOnUserDivison + "' AND a.LearnerNumber = '" +
                               number.Selection + "' AND b.LearnerKey = a.LearnerKey AND c.idEnrollments = b.idEnrollments AND" +
                               " d.idCourses = c.idCourses");
            report.DataDefinition.FormulaFields["date"].Text = "\"" + DateTime.Now.ToLongDateString() + "\"";
            report.DataDefinition.FormulaFields["college"].Text = "\"" + GlobalProperties.LoggedOnUserDivision + "\"";
            report.DataDefinition.FormulaFields["learnerNumber"].Text = "\"" + number.Selection + "\"";
            report.DataDefinition.FormulaFields["principle"].Text = "\"" + GlobalProperties.DivisionPrinciple + "\"";
            report.DataDefinition.FormulaFields["learnerName"].Text = "\"" + Convert.ToString(data["Name"]) + " " +
                                                                      Convert.ToString(data["Surname"]) + "\"";
            report.DataDefinition.FormulaFields["regDate"].Text = "\"" + (Convert.ToDateTime(data["regDate1"])).ToLongDateString() + "\"";
            report.DataDefinition.FormulaFields["reasonDe"].Text = "\"" + reasonDe.Selection + "\"";
            report.DataDefinition.FormulaFields["reasonRe"].Text = "\"" + reasonRe.Selection + "\"";

            //report.DataDefinition.FormulaFields["course"].Text = "\"" + Convert.ToString(data["Name1"]) + "\"";

            //logs.WriteXml(@"C:\tmpXml.xml");
            var frmReport = new frmReport(report) { Text = "Cancellation Request" };
            frmReport.ShowDialog();
        }
Example #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptReactivation rpt = new rptReactivation();
     rpt.Site = this.Site;
     return rpt;
 }