private void DeleteMedicineCommandHandler(object obj) { var medicine = obj as Medicine; if (medicine != null) { var result = Medicines.Remove(medicine); } }
public void Delete(object med) { var medicine = med as MedicineModel; if (medicine == null) { return; } medicineService.Delete(medicine); Medicines.Remove(medicine); AddNewMedicine(); }
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(); }