Last change
on this file since 4e72684 was 4e72684, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Add services
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[e42f61a] | 1 | using FarmatikoData.FarmatikoRepo;
|
---|
| 2 | using FarmatikoData.Models;
|
---|
| 3 | using FarmatikoServices.FarmatikoServiceInterfaces;
|
---|
| 4 | using System.Collections.Generic;
|
---|
| 5 |
|
---|
| 6 | namespace FarmatikoServices.Services
|
---|
| 7 | {
|
---|
| 8 | public class MedicineListService : IMedicineListService
|
---|
| 9 | {
|
---|
| 10 | private IMedicineListRepository _medicineListRepository;
|
---|
| 11 | public MedicineListService(IMedicineListRepository medicineListRepository)
|
---|
| 12 | {
|
---|
| 13 | _medicineListRepository = medicineListRepository;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
[4e72684] | 16 | public IEnumerable<MedicineList> GetAll()
|
---|
[e42f61a] | 17 | {
|
---|
| 18 | return _medicineListRepository.GetAll();
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public ICollection<MedicineList> GetByManufacturer(string Manufacturer)
|
---|
| 22 | {
|
---|
| 23 | return _medicineListRepository.GetByManufacturer(Manufacturer);
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public ICollection<MedicineList> GetByName(string Name)
|
---|
| 27 | {
|
---|
[4e72684] | 28 | if(Name != null)
|
---|
| 29 | {
|
---|
| 30 | return _medicineListRepository.GetByName(Name);
|
---|
| 31 | }
|
---|
| 32 | return null;
|
---|
[e42f61a] | 33 | }
|
---|
| 34 |
|
---|
[4e72684] | 35 | public bool SetHasMedicine(MedicineList medicineList, bool HasMedicine)
|
---|
[e42f61a] | 36 | {
|
---|
[4e72684] | 37 | if (medicineList != null)
|
---|
| 38 | {
|
---|
| 39 | _medicineListRepository.SetHasMedicine(medicineList, HasMedicine);
|
---|
| 40 | return true;
|
---|
| 41 | }
|
---|
| 42 | else return false;
|
---|
[e42f61a] | 43 | }
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.