Rev | Line | |
---|
[1454207] | 1 | using FarmatikoData.FarmatikoRepoInterfaces;
|
---|
| 2 | using FarmatikoData.Models;
|
---|
| 3 | using FarmatikoServices.FarmatikoServiceInterfaces;
|
---|
| 4 | using System;
|
---|
| 5 | using System.Collections.Generic;
|
---|
| 6 | using System.Linq;
|
---|
| 7 | using System.Threading.Tasks;
|
---|
| 8 |
|
---|
| 9 | namespace FarmatikoServices.Services
|
---|
| 10 | {
|
---|
| 11 | public class AdminService : IAdminService
|
---|
| 12 | {
|
---|
| 13 | private readonly IAdminRepo _adminRepo;
|
---|
| 14 | public AdminService(IAdminRepo adminRepo)
|
---|
| 15 | {
|
---|
| 16 | _adminRepo = adminRepo;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
[6f203af] | 19 | public async Task<IEnumerable<RequestPharmacyHead>> GetClaimingRequests()
|
---|
[1454207] | 20 | {
|
---|
[6f203af] | 21 | var req = await _adminRepo.GetClaimingRequests();
|
---|
| 22 | if (req != null)
|
---|
| 23 | return req;
|
---|
| 24 | throw new Exception("No data is found.");
|
---|
[1454207] | 25 | }
|
---|
| 26 |
|
---|
[6f203af] | 27 | public async Task<IEnumerable<PharmacyHead>> GetPharmacyHeads()
|
---|
[1454207] | 28 | {
|
---|
[6f203af] | 29 | var PHeads = await _adminRepo.GetPharmacyHeads();
|
---|
| 30 | var list = PHeads.Select(x => x.DeletedOn == null);
|
---|
| 31 | if (list != null)
|
---|
| 32 | {
|
---|
| 33 | return PHeads;
|
---|
| 34 | }
|
---|
| 35 | throw new Exception("No data is found.");
|
---|
[1454207] | 36 | }
|
---|
| 37 |
|
---|
[d23bf72] | 38 | public bool RejectRequest(int Id)
|
---|
[1454207] | 39 | {
|
---|
[d23bf72] | 40 | if (Id >= 0)
|
---|
[6f203af] | 41 | {
|
---|
[d23bf72] | 42 | _adminRepo.RemoveClaimRequest(Id);
|
---|
[6f203af] | 43 | return true;
|
---|
| 44 | }
|
---|
| 45 | return false;
|
---|
[1454207] | 46 | }
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.