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 internal class PwgSessionProxy |
---|
12 | { |
---|
13 | static internal PwgSessionProxyResponse pwg_session_getStatus() |
---|
14 | { |
---|
15 | PwgSessionProxyResponse response = null; |
---|
16 | try |
---|
17 | { |
---|
18 | response = PwgGenericProxy<PwgSessionProxyResponse>.Get( |
---|
19 | PwgConfigProxy.PwgServeurUri, |
---|
20 | "pwg.session.getStatus", null); |
---|
21 | } |
---|
22 | catch (Exception ex) |
---|
23 | { |
---|
24 | throw new PwgProxyException("pwg_session_getStatus", ex); |
---|
25 | } |
---|
26 | return response; |
---|
27 | |
---|
28 | } |
---|
29 | |
---|
30 | static internal PwgSessionProxyResponse pwg_session_login(String UserName, String Password) |
---|
31 | { |
---|
32 | PwgSessionProxyResponse response = null; |
---|
33 | try |
---|
34 | { |
---|
35 | StringBuilder data = new StringBuilder(); |
---|
36 | data.Append("method=pwg.session.login"); |
---|
37 | data.Append("&username=" + Uri.EscapeUriString(UserName)); |
---|
38 | data.Append("&password=" + Uri.EscapeUriString(Password)); |
---|
39 | |
---|
40 | |
---|
41 | response = PwgGenericProxy<PwgSessionProxyResponse>.Post( |
---|
42 | PwgConfigProxy.PwgServeurUri, |
---|
43 | data.ToString()); |
---|
44 | } |
---|
45 | catch (Exception ex) |
---|
46 | { |
---|
47 | throw new PwgProxyException("pwg_session_login",ex); |
---|
48 | } |
---|
49 | |
---|
50 | return response; |
---|
51 | } |
---|
52 | |
---|
53 | static internal PwgSessionProxyResponse pwg_session_logout() |
---|
54 | { |
---|
55 | PwgSessionProxyResponse response = null; |
---|
56 | try |
---|
57 | { |
---|
58 | StringBuilder data = new StringBuilder(); |
---|
59 | data.Append("method=pwg.session.logout"); |
---|
60 | |
---|
61 | response = PwgGenericProxy<PwgSessionProxyResponse>.Post( |
---|
62 | PwgConfigProxy.PwgServeurUri, |
---|
63 | data.ToString()); |
---|
64 | } |
---|
65 | catch (Exception ex) |
---|
66 | { |
---|
67 | throw new PwgProxyException("pwg_session_logout", ex); |
---|
68 | } |
---|
69 | return response; |
---|
70 | } |
---|
71 | |
---|
72 | } |
---|
73 | |
---|
74 | } |
---|
75 | |
---|