Ignore:
Timestamp:
07/31/20 10:15:02 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
d8fafb8
Parents:
4e72684
Message:

Update & add service

Location:
Farmatiko/Controllers
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/Controllers/HealthFacilitiesController.cs

    r4e72684 ra55ef91  
    11using FarmatikoData;
    22using FarmatikoData.Models;
    3 using Microsoft.AspNetCore.Cors;
     3using FarmatikoServices.FarmatikoServiceInterfaces;
    44using Microsoft.AspNetCore.Mvc;
     5using Microsoft.Extensions.Logging;
     6using Newtonsoft.Json;
     7using Newtonsoft.Json.Linq;
     8using System;
    59using System.Collections.Generic;
     10using System.Linq;
     11using System.Net;
     12using System.Threading.Tasks;
    613
    714namespace Farmatiko.Controllers
     
    1219    {
    1320        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)
    1525        {
    1626            _healthFacilitiesService = healthFacilitiesService;
     27            _processJSONService = processJSONService;
    1728        }
    1829        [HttpGet]
    19         public IEnumerable<HealthFacilities> Get()
     30        public IQueryable<HealthFacilities> Get()
    2031        {
    2132            return _healthFacilitiesService.GetAll();
    2233        }
     34       /* public void Index()
     35       
     36        {
     37            _processJSONService.GetProcessedHealthFacilitiesFromJSON();
     38        }*/
    2339    }
    2440}
  • Farmatiko/Controllers/HealthcareWorkerController.cs

    r4e72684 ra55ef91  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Threading.Tasks;
     1using System.Linq;
    52using FarmatikoData.Models;
    63using FarmatikoServices.FarmatikoServiceInterfaces;
     
    2017
    2118        [HttpGet]
    22         public IEnumerable<HealthcareWorkers> Get()
     19        public IQueryable<HealthcareWorkers> Get()
    2320        {
    2421            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;
     1using System.Linq;
    52using FarmatikoData.Models;
    63using FarmatikoServices.FarmatikoServiceInterfaces;
     
    1916        }
    2017        [HttpGet]
    21         public IEnumerable<Medicine> Get()
     18        public IQueryable<Medicine> Get()
    2219        {
    2320            return _medicineService.GetAll();
    2421        }
     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        }*/
    2542    }
    2643}
  • Farmatiko/Controllers/MedicineListController.cs

    r4e72684 ra55ef91  
    11using System.Collections.Generic;
     2using System.Linq;
    23using FarmatikoData.Models;
    34using FarmatikoServices.FarmatikoServiceInterfaces;
     
    1617        }
    1718        [HttpGet]
    18         public IEnumerable<MedicineList> Get()
     19        public IQueryable<MedicineList> Get()
    1920        {
    2021            return _medicineListService.GetAll();
    2122        }
     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        }
    2248    }
    2349}
  • Farmatiko/Controllers/PandemicController.cs

    r4e72684 ra55ef91  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Threading.Tasks;
     1using System.Linq;
    52using FarmatikoData.Models;
    63using FarmatikoServices.FarmatikoServiceInterfaces;
     
    1916        }
    2017        [HttpGet]
    21         public IEnumerable<Pandemic> Get()
     18        public IQueryable<Pandemic> Get()
    2219        {
    2320            return _pandemicService.GetAll();
  • Farmatiko/Controllers/PharmacyController.cs

    r4e72684 ra55ef91  
    1 using System;
    2 using System.Collections.Generic;
     1using System.Collections.Generic;
    32using System.Linq;
    4 using System.Threading.Tasks;
    53using FarmatikoData.Models;
    64using FarmatikoServices.FarmatikoServiceInterfaces;
     
    1917        }
    2018        [HttpGet]
    21         public IEnumerable<Pharmacy> Get()
     19        public IQueryable<Pharmacy> Get()
    2220        {
    2321            return _pharmacyService.GetAll();
    2422        }
     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        }
    2543    }
    2644}
  • Farmatiko/Controllers/PharmacyHeadController.cs

    r4e72684 ra55ef91  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Threading.Tasks;
     1using System.Linq;
    52using FarmatikoData.FarmatikoRepoInterfaces;
    63using FarmatikoData.Models;
     
    2320            return _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacy);
    2421        }
     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        }
    2542    }
    2643}
Note: See TracChangeset for help on using the changeset viewer.