private void setupReportData(int docID, int value, int unit, bool inactive)
        {
            DateTime date;
            switch (unit)
            {
                case 0:
                    date = DateTime.Now.AddDays(-(7 * value));
                    break;
                case 1:
                    date = DateTime.Now.AddMonths(-value);
                    break;
                case 2:
                    date = DateTime.Now.AddYears(-value);
                    break;
                default:
                    // This code, really, should never execute.
                    date = DateTime.Now;
                    break;
            }

            List<Database.Reporting.PatientActivityReportModel> data;
            if (inactive)
            {
                data = Database.Reporting.PatientActivityReportModel.getInactivePatientActivityModel(date, docID);
            }
            else
            {
                data = null;
            }

            // Set the datasource to the report list
            patientActivityBindingSource.DataSource = data;
            patientActivityReport.SetDataSource(patientActivityBindingSource);

            // Setup report params
            if (inactive)
            {
                patientActivityReport.SetParameterValue("ReportDesc", "Inactive Since");
            }
            else
            {
                patientActivityReport.SetParameterValue("ReportDesc", "Active up to");
            }
            String docName;
            if(docID != 0)
            {
                Database.DoctorMgr docMgr = new Database.DoctorMgr();
                docName = docMgr.getDoctor(docID).docFullName;

            }
            else
            {
                docName = "Clinic"; // Shows for all doctors
            }
            patientActivityReport.SetParameterValue("DoctorName", docName);
            patientActivityReport.SetParameterValue("Date", date);
        }
        public DailyBillingReportForm(DateTime date, int docID)
        {
            InitializeComponent();

            Database.DoctorMgr docMgr = new Database.DoctorMgr();
            String doctorName = (docID > 0) ? "Dr. " + docMgr.getDoctor(docID).docFullName : "All Doctors";

            dailyBillingBindingSource.DataSource = Database.Reporting.DailyBillingsViewModel.getDailyBillingsViewModel(date, docID);
            DailyBillingsReport1.SetDataSource(dailyBillingBindingSource);
            DailyBillingsReport1.SetParameterValue("StartDate", date);
            DailyBillingsReport1.SetParameterValue("DocName", doctorName);
        }
        public void loadData()
        {
            BindingSource accRecBindingSource = new BindingSource();
            accRecBindingSource.DataSource = Database.Reporting.AccountsReceivableModel.getAccountsReceiveableModel(startDate, endDate, callBack, docID);
            AccountsReceivable1.SetDataSource(accRecBindingSource);

            if (docID > 0)
            {
                Database.DoctorMgr docMgr = new Database.DoctorMgr();
                AccountsReceivable1.SetParameterValue("DoctorName", docMgr.getDoctor(docID).docFullName);
            }
        }