Last change
on this file since c406ae5 was c406ae5, checked in by DimitarSlezenkovski <dslezenkovski@…>, 5 years ago |
Update Models, Repos, Services and Controllers
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[a55ef91] | 1 | using System.Linq;
|
---|
[4e72684] | 2 | using FarmatikoData.FarmatikoRepoInterfaces;
|
---|
| 3 | using FarmatikoData.Models;
|
---|
| 4 | using Microsoft.AspNetCore.Mvc;
|
---|
| 5 |
|
---|
| 6 | namespace Farmatiko.Controllers
|
---|
| 7 | {
|
---|
| 8 | [ApiController]
|
---|
| 9 | [Route("[controller]/[action]")]
|
---|
| 10 | public class PharmacyHeadController : Controller
|
---|
| 11 | {
|
---|
| 12 | private IPharmacyHeadRepository _pharmacyHeadRepository;
|
---|
| 13 | public PharmacyHeadController(IPharmacyHeadRepository pharmacyHeadRepository)
|
---|
| 14 | {
|
---|
| 15 | _pharmacyHeadRepository = pharmacyHeadRepository;
|
---|
| 16 | }
|
---|
| 17 | [HttpGet]
|
---|
| 18 | public IQueryable<PharmacyHead> GetAllPharmacies(string NameOfPharmacy)
|
---|
| 19 | {
|
---|
| 20 | return _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacy);
|
---|
| 21 | }
|
---|
[a55ef91] | 22 | [HttpGet]
|
---|
| 23 | public IQueryable<PharmacyHead> GetPharmacyByName(string Name)
|
---|
| 24 | {
|
---|
| 25 | return _pharmacyHeadRepository.GetPharmacyByName(Name);
|
---|
| 26 | }
|
---|
| 27 | [HttpGet]
|
---|
| 28 | public IQueryable<MedicineList> GetPharmacyMedicines(string NameOfPharmacy)
|
---|
| 29 | {
|
---|
| 30 | return _pharmacyHeadRepository.GetPharmacyMedicines(NameOfPharmacy);
|
---|
| 31 | }
|
---|
| 32 | [HttpPost]
|
---|
| 33 | public void Add(PharmacyHead pharmacyHead)
|
---|
| 34 | {
|
---|
| 35 | _pharmacyHeadRepository.Add(pharmacyHead);
|
---|
| 36 | }
|
---|
| 37 | [HttpPost]
|
---|
[c406ae5] | 38 | public void Remove(PharmacyHead pharmacyHead)
|
---|
[a55ef91] | 39 | {
|
---|
[c406ae5] | 40 | _pharmacyHeadRepository.Remove(pharmacyHead);
|
---|
[a55ef91] | 41 | }
|
---|
[4e72684] | 42 | }
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.