1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Text; |
---|
4 | |
---|
5 | using Com.Piwigo.Lib.DTO; |
---|
6 | using System.Web; |
---|
7 | using Com.Piwigo.Lib.Proxy.Response; |
---|
8 | |
---|
9 | namespace Com.Piwigo.Lib.Proxy |
---|
10 | { |
---|
11 | static class PwgTagsProxy |
---|
12 | { |
---|
13 | static public PwgTagsProxyResponse pwg_tags_getList(Boolean sortedByCounter) |
---|
14 | { |
---|
15 | PwgTagsProxyResponse response = null; |
---|
16 | try |
---|
17 | { |
---|
18 | StringBuilder data = new StringBuilder(); |
---|
19 | data.Append("sort_by_counter=" + HttpUtility.UrlEncode(sortedByCounter.ToString().ToLower())); |
---|
20 | |
---|
21 | response = PwgGenericProxy<PwgTagsProxyResponse>.Get( |
---|
22 | PwgConfigProxy.PwgServeurUriBuilder.Uri, |
---|
23 | "pwg.tags.getList", data.ToString()); |
---|
24 | } |
---|
25 | catch (Exception ex) |
---|
26 | { |
---|
27 | throw new PwgProxyException("pwg_tags_getList", ex); |
---|
28 | } |
---|
29 | return response; |
---|
30 | |
---|
31 | } |
---|
32 | |
---|
33 | static public PwgTagsProxyResponse pwg_tags_getAdminList() |
---|
34 | { |
---|
35 | PwgTagsProxyResponse response = null; |
---|
36 | try |
---|
37 | { |
---|
38 | response = PwgGenericProxy<PwgTagsProxyResponse>.Get( |
---|
39 | PwgConfigProxy.PwgServeurUriBuilder.Uri, |
---|
40 | "pwg.tags.getAdminList", null); |
---|
41 | } |
---|
42 | catch (Exception ex) |
---|
43 | { |
---|
44 | throw new PwgProxyException("pwg_tags_getAdminList", ex); |
---|
45 | } |
---|
46 | return response; |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | static public PwgTagsProxyResponse pwg_tag_add(string tagName) |
---|
51 | { |
---|
52 | PwgTagsProxyResponse response = null; |
---|
53 | try |
---|
54 | { |
---|
55 | StringBuilder data = new StringBuilder(); |
---|
56 | data.Append("method=pwg.tags.add"); |
---|
57 | data.Append("&name=" + HttpUtility.UrlEncode(tagName)); |
---|
58 | |
---|
59 | response = PwgGenericProxy<PwgTagsProxyResponse>.Post( |
---|
60 | PwgConfigProxy.PwgServeurUriBuilder.Uri, |
---|
61 | data.ToString()); |
---|
62 | } |
---|
63 | catch (Exception ex) |
---|
64 | { |
---|
65 | throw new PwgProxyException("pwg_tag_add", ex); |
---|
66 | } |
---|
67 | |
---|
68 | return response; |
---|
69 | } |
---|
70 | |
---|
71 | } |
---|
72 | |
---|
73 | } |
---|
74 | |
---|