1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Collections;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Data.Linq;
|
---|
6 | using System.Data.Linq.Mapping;
|
---|
7 | using System.Text;
|
---|
8 |
|
---|
9 | using HeuristicLab.Services.Authentication.DataAccess;
|
---|
10 | using HeuristicLab.Services.Authentication.DataTransfer;
|
---|
11 | using HeuristicLab.Services.Authentication;
|
---|
12 | using DA = HeuristicLab.Services.Authentication.DataAccess;
|
---|
13 | using DT = HeuristicLab.Services.Authentication.DataTransfer;
|
---|
14 | using HLSA = HeuristicLab.Services.Authentication;
|
---|
15 |
|
---|
16 |
|
---|
17 | namespace HeuristicLab.Services.Authentication {
|
---|
18 |
|
---|
19 | public class ClientService : IClientService{
|
---|
20 |
|
---|
21 |
|
---|
22 | private void RemoveRRGEntry(ClientManagmentDataContext cmdc, Guid resID) {
|
---|
23 | foreach (var rrg in cmdc.ResourceResourceGroups.Where(x => x.ResourceId == resID))
|
---|
24 | cmdc.ResourceResourceGroups.DeleteOnSubmit(rrg);
|
---|
25 | }
|
---|
26 |
|
---|
27 |
|
---|
28 | public DataTransfer.Client GetClient(Guid id) {
|
---|
29 | throw new NotImplementedException();
|
---|
30 | }
|
---|
31 |
|
---|
32 | public IEnumerable<DataTransfer.Client> GetClients() {
|
---|
33 | throw new NotImplementedException();
|
---|
34 | }
|
---|
35 |
|
---|
36 | public Guid AddClient(DataTransfer.Client dto) {
|
---|
37 | throw new NotImplementedException();
|
---|
38 | }
|
---|
39 |
|
---|
40 | public bool UpdateClient(DataTransfer.Client dto) {
|
---|
41 | throw new NotImplementedException();
|
---|
42 | }
|
---|
43 |
|
---|
44 | public bool DeleteClient(DataTransfer.Client dto) {
|
---|
45 | using (ClientManagmentDataContext cmdc = new ClientManagmentDataContext()) {
|
---|
46 | RemoveRRGEntry(cmdc, dto.ResourceID);
|
---|
47 | DA.Resource entity = cmdc.Resources.FirstOrDefault(x => x.Id == dto.ResourceID);
|
---|
48 | if (entity != null) {
|
---|
49 | cmdc.Resources.DeleteOnSubmit(entity);
|
---|
50 | cmdc.SubmitChanges();
|
---|
51 | return true;
|
---|
52 | }
|
---|
53 | return false;
|
---|
54 | }
|
---|
55 | }
|
---|
56 |
|
---|
57 | public DataTransfer.ResourceGroup GetResourceGroup(Guid id) {
|
---|
58 | throw new NotImplementedException();
|
---|
59 | }
|
---|
60 |
|
---|
61 | public IEnumerable<DataTransfer.ResourceGroup> GetResourceGroups() {
|
---|
62 | throw new NotImplementedException();
|
---|
63 | }
|
---|
64 |
|
---|
65 | public Guid AddResourceGroup(DataTransfer.ResourceGroup dto) {
|
---|
66 | throw new NotImplementedException();
|
---|
67 | }
|
---|
68 |
|
---|
69 | public bool UpdateResourceGroup(DataTransfer.ResourceGroup dto) {
|
---|
70 | throw new NotImplementedException();
|
---|
71 | }
|
---|
72 |
|
---|
73 | public bool DeleteResourceGroup(DataTransfer.ResourceGroup id) {
|
---|
74 | throw new NotImplementedException();
|
---|
75 | }
|
---|
76 |
|
---|
77 | public IEnumerable<DataTransfer.Resource> GetMembers(Guid id) {
|
---|
78 | throw new NotImplementedException();
|
---|
79 | }
|
---|
80 |
|
---|
81 | public IEnumerable<DataTransfer.Resource> GetRootResources() {
|
---|
82 | throw new NotImplementedException();
|
---|
83 | }
|
---|
84 | }
|
---|
85 | } |
---|