Changeset a55ef91 for Farmatiko/Controllers
- Timestamp:
- 07/31/20 10:15:02 (4 years ago)
- Branches:
- master
- Children:
- d8fafb8
- Parents:
- 4e72684
- Location:
- Farmatiko/Controllers
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Controllers/HealthFacilitiesController.cs
r4e72684 ra55ef91 1 1 using FarmatikoData; 2 2 using FarmatikoData.Models; 3 using Microsoft.AspNetCore.Cors;3 using FarmatikoServices.FarmatikoServiceInterfaces; 4 4 using Microsoft.AspNetCore.Mvc; 5 using Microsoft.Extensions.Logging; 6 using Newtonsoft.Json; 7 using Newtonsoft.Json.Linq; 8 using System; 5 9 using System.Collections.Generic; 10 using System.Linq; 11 using System.Net; 12 using System.Threading.Tasks; 6 13 7 14 namespace Farmatiko.Controllers … … 12 19 { 13 20 private IHealthFacilityService _healthFacilitiesService; 14 public HealthFacilitiesController(IHealthFacilityService healthFacilitiesService) 21 private IProcessJSONService _processJSONService; 22 /*private IProcessJSONService _processJSONService;*/ 23 private string Path = @"C:\Users\dslez\Desktop\ustanovi.json"; 24 public HealthFacilitiesController(IHealthFacilityService healthFacilitiesService, IProcessJSONService processJSONService) 15 25 { 16 26 _healthFacilitiesService = healthFacilitiesService; 27 _processJSONService = processJSONService; 17 28 } 18 29 [HttpGet] 19 public I Enumerable<HealthFacilities> Get()30 public IQueryable<HealthFacilities> Get() 20 31 { 21 32 return _healthFacilitiesService.GetAll(); 22 33 } 34 /* public void Index() 35 36 { 37 _processJSONService.GetProcessedHealthFacilitiesFromJSON(); 38 }*/ 23 39 } 24 40 } -
Farmatiko/Controllers/HealthcareWorkerController.cs
r4e72684 ra55ef91 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 1 using System.Linq; 5 2 using FarmatikoData.Models; 6 3 using FarmatikoServices.FarmatikoServiceInterfaces; … … 20 17 21 18 [HttpGet] 22 public I Enumerable<HealthcareWorkers> Get()19 public IQueryable<HealthcareWorkers> Get() 23 20 { 24 21 return _healthcareWorkerService.GetAll(); -
Farmatiko/Controllers/MedicineController.cs
r4e72684 ra55ef91 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 1 using System.Linq; 5 2 using FarmatikoData.Models; 6 3 using FarmatikoServices.FarmatikoServiceInterfaces; … … 19 16 } 20 17 [HttpGet] 21 public I Enumerable<Medicine> Get()18 public IQueryable<Medicine> Get() 22 19 { 23 20 return _medicineService.GetAll(); 24 21 } 22 /*[HttpPost] 23 public void Add(Medicine medicine) 24 { 25 _medicineService.Add(medicine); 26 } 27 [HttpPost] 28 public void Remove(string Medicine) 29 { 30 _medicineService.Remove(Medicine); 31 } 32 [HttpGet] 33 public IQueryable<Medicine> GetByName(string Name) 34 { 35 return _medicineService.GetByName(Name); 36 } 37 [HttpGet] 38 public IQueryable<Medicine> GetByManufacturer(string Manufacturer) 39 { 40 return _medicineService.GetByManufacturer(Manufacturer); 41 }*/ 25 42 } 26 43 } -
Farmatiko/Controllers/MedicineListController.cs
r4e72684 ra55ef91 1 1 using System.Collections.Generic; 2 using System.Linq; 2 3 using FarmatikoData.Models; 3 4 using FarmatikoServices.FarmatikoServiceInterfaces; … … 16 17 } 17 18 [HttpGet] 18 public I Enumerable<MedicineList> Get()19 public IQueryable<MedicineList> Get() 19 20 { 20 21 return _medicineListService.GetAll(); 21 22 } 23 [HttpGet] 24 public ICollection<MedicineList> GetByName(string Name) 25 { 26 return _medicineListService.GetByName(Name); 27 } 28 [HttpGet] 29 public ICollection<MedicineList> GetByManufacturer(string Manufacturer) 30 { 31 return _medicineListService.GetByManufacturer(Manufacturer); 32 } 33 /*[HttpPost] 34 public void SetHasMedicine(MedicineList medicineList, bool HasMedicine) 35 { 36 _medicineListService.SetHasMedicine(medicineList, HasMedicine); 37 }*/ 38 [HttpPost] 39 public void Add(MedicineList medicineList) 40 { 41 _medicineListService.Add(medicineList); 42 } 43 [HttpPost] 44 public void Remove(MedicineList medicineList) 45 { 46 _medicineListService.Remove(medicineList); 47 } 22 48 } 23 49 } -
Farmatiko/Controllers/PandemicController.cs
r4e72684 ra55ef91 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 1 using System.Linq; 5 2 using FarmatikoData.Models; 6 3 using FarmatikoServices.FarmatikoServiceInterfaces; … … 19 16 } 20 17 [HttpGet] 21 public I Enumerable<Pandemic> Get()18 public IQueryable<Pandemic> Get() 22 19 { 23 20 return _pandemicService.GetAll(); -
Farmatiko/Controllers/PharmacyController.cs
r4e72684 ra55ef91 1 using System; 2 using System.Collections.Generic; 1 using System.Collections.Generic; 3 2 using System.Linq; 4 using System.Threading.Tasks;5 3 using FarmatikoData.Models; 6 4 using FarmatikoServices.FarmatikoServiceInterfaces; … … 19 17 } 20 18 [HttpGet] 21 public I Enumerable<Pharmacy> Get()19 public IQueryable<Pharmacy> Get() 22 20 { 23 21 return _pharmacyService.GetAll(); 24 22 } 23 [HttpGet] 24 public ICollection<Pharmacy> GetPharmacies() 25 { 26 return _pharmacyService.GetPharmacies(); 27 } 28 [HttpPost] 29 public void UpdatePharmacy(Pharmacy pharmacy, string Name) 30 { 31 _pharmacyService.UpdatePharmacy(pharmacy,Name); 32 } 33 [HttpPost] 34 public void AddPharmacy(Pharmacy pharmacy) 35 { 36 _pharmacyService.Add(pharmacy); 37 } 38 [HttpPost] 39 public void RemovePharmacy(Pharmacy pharmacy) 40 { 41 _pharmacyService.Remove(pharmacy); 42 } 25 43 } 26 44 } -
Farmatiko/Controllers/PharmacyHeadController.cs
r4e72684 ra55ef91 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 1 using System.Linq; 5 2 using FarmatikoData.FarmatikoRepoInterfaces; 6 3 using FarmatikoData.Models; … … 23 20 return _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacy); 24 21 } 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] 38 public void Remove(PharmacyHead pharmacyHead, string Name) 39 { 40 _pharmacyHeadRepository.Remove(pharmacyHead, Name); 41 } 25 42 } 26 43 }
Note:
See TracChangeset
for help on using the changeset viewer.