source: FarmatikoServices/Services/MedicineListService.cs@ 4e72684

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
Line 
1using FarmatikoData.FarmatikoRepo;
2using FarmatikoData.Models;
3using FarmatikoServices.FarmatikoServiceInterfaces;
4using System.Collections.Generic;
5
6namespace FarmatikoServices.Services
7{
8 public class MedicineListService : IMedicineListService
9 {
10 private IMedicineListRepository _medicineListRepository;
11 public MedicineListService(IMedicineListRepository medicineListRepository)
12 {
13 _medicineListRepository = medicineListRepository;
14 }
15
16 public IEnumerable<MedicineList> GetAll()
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 {
28 if(Name != null)
29 {
30 return _medicineListRepository.GetByName(Name);
31 }
32 return null;
33 }
34
35 public bool SetHasMedicine(MedicineList medicineList, bool HasMedicine)
36 {
37 if (medicineList != null)
38 {
39 _medicineListRepository.SetHasMedicine(medicineList, HasMedicine);
40 return true;
41 }
42 else return false;
43 }
44 }
45}
Note: See TracBrowser for help on using the repository browser.