Ejemplo n.º 1
0
        private void PrintPreviewInjection(bool preview, InjectionLabTest pr)
        {
            string BranchName    = ConfigurationManager.AppSettings["Name"].ToString();
            string BranchAddress = ConfigurationManager.AppSettings["Address"].ToString();
            string CompNo        = ConfigurationManager.AppSettings["ComplaintNo"].ToString();

            prt = new DsPatientRegistration.PatientRegistrationDataTable();
            if (pr.Injections.Count == 0)
            {
                object[] values = { 0, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName + ' ' + pr.Patient.LastName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Age, pr.Patient.Mobile, "", pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };
                prt.LoadDataRow(values, true);
            }
            else
            {
                foreach (LabTest item in pr.Injections)
                {
                    object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName + ' ' + pr.Patient.LastName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Age, pr.Patient.Mobile, item.TestName, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, this.txtExistingToken.Text, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };
                    prt.LoadDataRow(values, true);
                }
            }



            rptInectionToken crp = new rptInectionToken();

            crp.SetDataSource((DataTable)prt);
            FrmReportViewer frmViewer = new FrmReportViewer();

            frmViewer.crystalReportViewer1.ReportSource = crp;
            crp.SetParameterValue("Duplicate", PrintDuplicate);
            crp.SetParameterValue("Name", BranchName);
            crp.SetParameterValue("Address", BranchAddress);
            crp.SetParameterValue("ComplaintNo", "Complaint #: " + CompNo);
            if (preview)
            {
                frmViewer.ShowDialog();
            }
            else
            {
                //frmViewer.crystalReportViewer1.RefreshReport();
                frmViewer.crystalReportViewer1.PrintReport();
            }
            PrintDuplicate = false;
        }
Ejemplo n.º 2
0
        private void PrintPreviewInjection(bool preview, InjectionLabTest pr)
        {
            prt = new DsPatientRegistration.PatientRegistrationDataTable();
            object[] values = { 0, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Address, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, this.txtExistingToken.Text, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };
            prt.LoadDataRow(values, true);
            rptInectionToken crp = new rptInectionToken();

            crp.SetDataSource((DataTable)prt);
            FrmReportViewer frmViewer = new FrmReportViewer();

            frmViewer.crystalReportViewer1.ReportSource = crp;
            if (preview)
            {
                frmViewer.ShowDialog();
            }
            else
            {
                frmViewer.crystalReportViewer1.RefreshReport();
                frmViewer.crystalReportViewer1.PrintReport();
            }
        }