private void PrintPreviewLab(bool preview, InjectionLabTest pr)
        {
            prt = new DsPatientRegistration.PatientRegistrationDataTable();
            foreach (var item in pr.Tests)
            {
                object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, item.TestName + " Qty : " + (item.TimesADay * item.TotalDays), pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };
                prt.LoadDataRow(values, true);
            }
            rptLabTestToken crp = new rptLabTestToken();

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

            frmViewer.crystalReportViewer1.ReportSource = crp;
            string BranchName    = ConfigurationManager.AppSettings["Name"].ToString();
            string BranchAddress = ConfigurationManager.AppSettings["Address"].ToString();

            crp.SetParameterValue("Duplicate", PrintDuplicate);
            crp.SetParameterValue("Name", BranchName);
            crp.SetParameterValue("Address", BranchAddress);

            if (preview)
            {
                frmViewer.ShowDialog();
            }
            else
            {
                //frmViewer.crystalReportViewer1.RefreshReport();
                frmViewer.crystalReportViewer1.PrintReport();
            }
            PrintDuplicate = false;
        }
Exemple #2
0
        private void PrintPreviewLabandInj(bool preview, InjectionLabTest pr)
        {
            prt = new DsPatientRegistration.PatientRegistrationDataTable();
            foreach (var item in pr.Tests)
            {
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " Qty : " + item.TimesADay + "*" + item.TotalDays + "=" + (item.TimesADay * item.TotalDays) + " " + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.CashReceivedByUser };                              ------- Asif -- 02-04-19
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " " + item.TimesADayNumber, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.CashReceivedByUser };                                                                                                                          ------- Asif -- 08-04-19
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.ExistingTokenNo, item.TestName + " \n" + item.TimesADayNumber, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.CashReceivedByUser, pr.TokenBy };                                                                                                                 ------- Asif -- 20-04-19
                //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.ExistingTokenNo, item.TestName + " (" + (item.TimesADay * item.TotalDays) + ")\n" + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.CashReceivedByUser, pr.TokenBy };  ------- Asif -- 01-06-19
                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.ExistingTokenNo, item.TestName + " (" + (item.TimesADay * item.TotalDays) + ")\n" + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, item.TotalDays, pr.TokenBy };
                prt.LoadDataRow(values, true);
            }
            foreach (var item in pr.Injections)
            {
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " Qty : " + item.TimesADay + "*" + item.TotalDays + "=" + (item.TimesADay * item.TotalDays) + " " + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };                              ------- Asif -- 02-04-19
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " " + item.TimesADayNumber, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };                                                                                                                          ------- Asif -- 08-04-19
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.ExistingTokenNo, item.TestName + " \n" + item.TimesADayNumber, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.TokenBy };                                                                                                                 ------- Asif -- 20-04-19
                //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.ExistingTokenNo, item.TestName + " (" + (item.TimesADay * item.TotalDays) + ")\n" + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.TokenBy };  ------- Asif -- 01-06-19
                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.ExistingTokenNo, item.TestName + " (" + (item.TimesADay * item.TotalDays) + ")\n" + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, item.TotalDays, pr.TokenBy };
                prt.LoadDataRow(values, true);
            }
            foreach (var item in pr.AssignedLabTest)
            {
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " Qty : " + item.TimesADay + "*" + item.TotalDays + "=" + (item.TimesADay * item.TotalDays) + " " + item.TimesADayUrdu, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };     ------- Asif -- 02-04-19
                //object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, pr.Patient.Mobile, item.TestName + " " + item.TimesADayNumber, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };                                                                                                 ------- Asif -- 11-04-19
                //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.ExistingTokenNo, item.TestName, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, pr.CashReceivedByUser, pr.TokenBy };                          ------- Asif -- 01-06-19
                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.ExistingTokenNo, item.TestName, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.Room.Name + '-' + pr.Room.LabelName, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate, item.TotalDays, pr.TokenBy };
                prt.LoadDataRow(values, true);
            }
            rptLabTestToken crp = new rptLabTestToken();

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

            frmViewer.crystalReportViewer1.ReportSource = crp;
            string BranchName    = ConfigurationManager.AppSettings["Name"].ToString();
            string BranchAddress = ConfigurationManager.AppSettings["Address"].ToString();
            string CompNo        = ConfigurationManager.AppSettings["ComplaintNo"].ToString();

            crp.SetParameterValue("Duplicate", PrintDuplicate);
            crp.SetParameterValue("Name", BranchName);
            crp.SetParameterValue("Address", BranchAddress);
            crp.SetParameterValue("CashRecievedByUser", pr.CashReceivedByUser);
            crp.SetParameterValue("ComplaintNo", "Complaint #: " + CompNo);

            if (preview)
            {
                frmViewer.ShowDialog();
            }
            else
            {
                //frmViewer.crystalReportViewer1.RefreshReport();
                crp.PrintToPrinter(1, false, 0, 0);                 ////    -------- Asif -- 02-06-19   ----- Print Without Showing Print Dialog (Disallow Multiple Copies)
                //frmViewer.crystalReportViewer1.PrintReport();     ////    -------- Asif -- 02-06-19
            }
            PrintDuplicate = false;
        }
Exemple #3
0
        private void PrintPreviewLab(bool preview, InjectionLabTest pr)
        {
            prt = new DsPatientRegistration.PatientRegistrationDataTable();
            foreach (var item in pr.Tests)
            {
                object[] values = { item.LabTestId, pr.TokenDate, pr.TokenMonthYear, pr.TokenNumber, pr.Patient.FirstName, pr.Patient.LastName, pr.Patient.NIC, item.TestName, pr.IsInjectionToken ? "Injection" : "Lab Test", pr.CashReceived, pr.ExistingTokenNo, pr.Patient.RegistrationNumber, pr.Patient.RegistrationDate };
                prt.LoadDataRow(values, true);
            }
            rptLabTestToken crp = new rptLabTestToken();

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

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