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.2 KB
|
Rev | Line | |
---|
[4e72684] | 1 | using FarmatikoData.FarmatikoRepoInterfaces;
|
---|
| 2 | using FarmatikoData.Models;
|
---|
| 3 | using FarmatikoServices.FarmatikoServiceInterfaces;
|
---|
| 4 | using System.Collections.Generic;
|
---|
| 5 |
|
---|
| 6 | namespace FarmatikoServices.Services
|
---|
| 7 | {
|
---|
| 8 | public class PharmacyService : IPharmacyService
|
---|
| 9 | {
|
---|
| 10 | private IPharmacyRepository _pharmacyRepository;
|
---|
| 11 | public PharmacyService(IPharmacyRepository pharmacyRepository)
|
---|
| 12 | {
|
---|
| 13 | _pharmacyRepository = pharmacyRepository;
|
---|
| 14 | }
|
---|
| 15 | public void Add(Pharmacy pharmacy)
|
---|
| 16 | {
|
---|
| 17 | if(pharmacy != null)
|
---|
| 18 | {
|
---|
| 19 | _pharmacyRepository.Add(pharmacy);
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public IEnumerable<Pharmacy> GetAll()
|
---|
| 24 | {
|
---|
| 25 | return _pharmacyRepository.GetAll();
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | public ICollection<Pharmacy> GetPharmacies()
|
---|
| 29 | {
|
---|
| 30 | return _pharmacyRepository.GetPharmacies();
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public void Remove(Pharmacy pharmacy)
|
---|
| 34 | {
|
---|
| 35 | _pharmacyRepository.Remove(pharmacy);
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | public void UpdatePharmacy(Pharmacy pharmacy, string Name)
|
---|
| 39 | {
|
---|
| 40 | if(pharmacy != null && Name != null)
|
---|
| 41 | {
|
---|
| 42 | _pharmacyRepository.UpdatePharmacy(pharmacy, Name);
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.