Exemple #1
0
        public PrescriptionEditViewModel(PrescriptionListViewModel prescriptionListViewModel,
                                         PrescriptionListWindow prescriptionListView,
                                         Prescription prescription)
        {
            PrescriptionListViewModel = prescriptionListViewModel;
            PrescriptionListView      = prescriptionListView;

            if (prescription != null)
            {
                PrescriptionExists = true;
                Prescription       = prescription;
            }
            else
            {
                //Add prescription
                PrescriptionExists = false;
                Prescription       = new Prescription()
                {
                    Date = DateTime.Now.Date
                };
            }

            ShowPrescriptionEditView();
        }
Exemple #2
0
 public void PrescriptionList(Medicine medicine)
 {
     _ = new PrescriptionListViewModel(MainView, medicine);
     MainView.DataContext = null;
     MainView.DataContext = this;
 }