Пример #1
0
        private void DeleteMedicineCommandHandler(object obj)
        {
            var medicine = obj as Medicine;

            if (medicine != null)
            {
                var result = Medicines.Remove(medicine);
            }
        }
Пример #2
0
        public void Delete(object med)
        {
            var medicine = med as MedicineModel;

            if (medicine == null)
            {
                return;
            }
            medicineService.Delete(medicine);
            Medicines.Remove(medicine);
            AddNewMedicine();
        }
Пример #3
0
        public void SaveMedicine()
        {
            var obj = medicineService.Save(SelectedMedicine);

            if (SelectedMedicine.Id == 0)
            {
                Medicines.Add(obj);
            }
            else
            {
                Medicines.Remove(Medicines.First(x => x.Code == obj.Code));
                Medicines.Add(obj);
            }
            AddNewMedicine();
        }