Пример #1
0
        public ActionResult InvoiceList(int AppointmentId)
        {
            ViewData["fees"]     = patientBusinessLayer.GetDoctorFeesByAppointmentId(AppointmentId);
            invoiceListViewModel = new List <InvoiceViewModel>();
            List <MedicinesQuantity> medicinelist = patientBusinessLayer.GetPatientMedicines(AppointmentId);

            foreach (var medlist in medicinelist)
            {
                invoicelist = new InvoiceViewModel();
                invoicelist.MedicineName    = patientBusinessLayer.GetMedicineName(medlist.Medicine_Id);
                invoicelist.Rate            = Convert.ToInt32(medlist.MedicineRate);
                invoicelist.Quantity        = medlist.quantity;
                invoicelist.PatientName     = patientBusinessLayer.GetPatientNameByAppointmentId(medlist.Appointment_Id);
                invoicelist.AppointmentDate = Convert.ToDateTime(patientBusinessLayer.GetAppointmentDate(medlist.Appointment_Id));
                invoicelist.Phone_number    = patientBusinessLayer.GetPhoneNumber(medlist.Appointment_Id);
                invoicelist.Price           = Convert.ToInt32(medlist.MedicineRate) * medlist.quantity;
                invoiceListViewModel.Add(invoicelist);
            }

            ViewData["TotalBill"] = patientBusinessLayer.GetTotalBill(AppointmentId);
            return(View(invoiceListViewModel));
        }