Exemplo n.º 1
0
 public List <InvoiceViewModel> FetchInvoicesByAppointmentId(List <Appointment> appointments)
 {
     foreach (var appointment in appointments)
     {
         Invoice invoice = patientBusinessLayer.GetInvoice(appointment.Id);
         if (invoice != null)
         {
             invoicelist                 = new InvoiceViewModel();
             invoicelist.InvoiceId       = invoice.Id;
             invoicelist.PatientName     = patientBusinessLayer.GetPatientNameByAppointmentId(appointment.Id);
             invoicelist.AppointmentDate = Convert.ToDateTime(patientBusinessLayer.GetAppointmentDate(appointment.Id));
             invoicelist.Total           = patientBusinessLayer.GetTotalBill(appointment.Id);
             invoiceListViewModel.Add(invoicelist);
         }
     }
     return(invoiceListViewModel);
 }