コード例 #1
0
ファイル: InvoiceDetailsTest.cs プロジェクト: skgtrx/CMS
        public void GetInvoiceDetailsExistingTest()
        {
            // Act
            var result = invoiceDetails.GetInvoiceDetails(0);//Non-Existing appointment

            // Assert
            Assert.IsNull(result);
        }
コード例 #2
0
ファイル: InvoiceViewModel.cs プロジェクト: skgtrx/CMS
        public InvoiceViewModel(int AppointmentId)
        {
            InvoiceDetails invoiceDetails = new InvoiceDetails();

            Diagnosis = invoiceDetails.GetDiagnosis(AppointmentId);
            Invoice   = invoiceDetails.GetInvoiceDetails(AppointmentId);
            if (Invoice == null)
            {
                invoiceDetails.GenerateInvoice(AppointmentId);
                Invoice = invoiceDetails.GetInvoiceDetails(AppointmentId);
            }
            Medicines = invoiceDetails.GetMedicineListForInvoice(Diagnosis.Id);
            Tests     = invoiceDetails.GetTestListForInvoice(Diagnosis.Id);

            this.DoctorFee = Invoice.TotalCost - (Medicines.Sum(t => t.Medicines.Cost * t.Quantity) + Tests.Sum(t => t.Tests.Cost));

            Age = invoiceDetails.GetAge(Invoice.Appointment.Patient.DateOfBirth);
        }