Ejemplo n.º 1
0
        public ChangeDosage(ChangeDosageViewModel viewModel)
        {
            InitializeComponent();

            this.DataContext = viewModel;
        }
Ejemplo n.º 2
0
        private void ChangeDosage(string medicineName)
        {
            var medicine = new Medicine(medicineName);

            var viewModel = new ChangeDosageViewModel
            {
                Name = medicineName,
                NewDosage = ((CountPerDayDosage) this.supplies.CurrentDosage(medicine, this.asOfDate)).CountPerDay
            };

            var window = new ChangeDosage(viewModel);

            if (window.ShowDialog() == true)
            {
                this.supplies.AddDosage(medicine, viewModel.Since, new CountPerDayDosage(viewModel.NewDosage));

                this.OnSuppliesChanged();

                this.DumpSuppliesStatus();
            }
        }