1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Text; |
---|
4 | |
---|
5 | using Com.Piwigo.Lib.DTO; |
---|
6 | using Com.Piwigo.Lib.Proxy; |
---|
7 | using Com.Piwigo.Lib.Proxy.Response; |
---|
8 | using Com.Piwigo.Lib.DTO.Helper; |
---|
9 | |
---|
10 | namespace Com.Piwigo.Lib.Service |
---|
11 | { |
---|
12 | |
---|
13 | static public class PwgTagsService |
---|
14 | { |
---|
15 | |
---|
16 | static public List<PwgTag> GetListOfPwgTag(Boolean sortedByCounter) |
---|
17 | { |
---|
18 | List<PwgTag> returnValue = new List<PwgTag>(); |
---|
19 | |
---|
20 | try |
---|
21 | { |
---|
22 | PwgTagsProxyResponse response = PwgTagsProxy.pwg_tags_getList(sortedByCounter); |
---|
23 | |
---|
24 | if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok) |
---|
25 | { |
---|
26 | if (response.Erreur != null) |
---|
27 | { |
---|
28 | throw new PwgServiceException("GetListOfPwgTag, the server has return the error.", |
---|
29 | response.Erreur.Code, |
---|
30 | response.Erreur.Message); |
---|
31 | } |
---|
32 | else |
---|
33 | { |
---|
34 | throw new PwgServiceException("GetListOfPwgTag : a error occurs during server process."); |
---|
35 | } |
---|
36 | } |
---|
37 | else |
---|
38 | { |
---|
39 | returnValue = ConvertProxyResponseToDTO(response); |
---|
40 | } |
---|
41 | } |
---|
42 | catch (PwgProxyException ex) |
---|
43 | { |
---|
44 | throw new PwgServiceException("GetListOfPwgTag : a error is raised by proxy.", ex); |
---|
45 | } |
---|
46 | return returnValue; |
---|
47 | } |
---|
48 | |
---|
49 | /// <summary> |
---|
50 | /// private: convert response to dto object |
---|
51 | /// </summary> |
---|
52 | /// <param name="response"></param> |
---|
53 | /// <param name="session"></param> |
---|
54 | static private List<PwgTag> ConvertProxyResponseToDTO(PwgTagsProxyResponse response) |
---|
55 | { |
---|
56 | List<PwgTag> returnValue = new List<PwgTag>(); |
---|
57 | |
---|
58 | return returnValue; |
---|
59 | } |
---|
60 | } |
---|
61 | } |
---|