Last change
on this file since 1454207 was 1454207, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Change structure, Add repo, services & controllers
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1454207] | 1 | using FarmatikoData.FarmatikoRepoInterfaces;
|
---|
| 2 | using FarmatikoData.Models;
|
---|
| 3 | using System;
|
---|
| 4 | using System.Collections.Generic;
|
---|
| 5 | using System.Linq;
|
---|
| 6 | using System.Text;
|
---|
| 7 | using System.Threading.Tasks;
|
---|
| 8 |
|
---|
| 9 | namespace FarmatikoData.FarmatikoRepo
|
---|
| 10 | {
|
---|
| 11 | public class AdminRepo : IAdminRepo
|
---|
| 12 | {
|
---|
| 13 | private readonly FarmatikoDataContext _context;
|
---|
| 14 | public AdminRepo(FarmatikoDataContext context)
|
---|
| 15 | {
|
---|
| 16 | _context = context;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | public async Task<IQueryable<RequestPharmacyHead>> GetClaimingRequests()
|
---|
| 20 | {
|
---|
| 21 | var reqs = await Task.Run(() => _context.PHRequests.OrderBy(x => x.Head.Name));
|
---|
| 22 | return reqs;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | //GET
|
---|
| 26 | public async Task<IQueryable<PharmacyHead>> GetPharmacyHeads()
|
---|
| 27 | {
|
---|
| 28 | var PHeads = await Task.Run(() => _context.PharmacyHeads.OrderBy(x => x.Name));
|
---|
| 29 | return PHeads;
|
---|
| 30 | }
|
---|
| 31 | //POST
|
---|
| 32 | public async Task RemoveClaimRequest(RequestPharmacyHead req)
|
---|
| 33 | {
|
---|
| 34 | await Task.Run(() => _context.PHRequests.Remove(req));
|
---|
| 35 | await _context.SaveChangesAsync();
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.