source: extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs @ 7149

Last change on this file since 7149 was 7149, checked in by bayral, 14 years ago

Piwigolib is now modify for mask the implementation of proxy.
Add start version of piwigo WPF

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using Com.Piwigo.Lib.DTO;
6using System.Web;
7using Com.Piwigo.Lib.Proxy.Response;
8using Com.Piwigo.Lib.Proxy.Helper;
9
10namespace Com.Piwigo.Lib.Proxy
11{
12    static internal class PwgImagesProxy
13    {
14        /// <summary>
15        /// pwg.images.rate
16        /// </summary>
17        /// <param name="imageId"></param>
18        /// <param name="imageRate"></param>
19        /// <returns></returns>
20        static internal PwgImageRateProxyResponse pwg_images_rate(Int32 imageId, Int32 imageRate)
21        {
22            PwgImageRateProxyResponse response = null;
23            try
24            {
25                StringBuilder data = new StringBuilder();
26                data.Append("method=pwg.images.rate");
27                Boolean firstOcc = false;
28                PwgProxyReponseHelper.buildQueryFromValue<Int32>(imageId, "image_id", ref firstOcc, data);
29                PwgProxyReponseHelper.buildQueryFromValue<Int32>(imageRate, "rate", ref firstOcc, data);
30
31                response = PwgGenericProxy<PwgImageRateProxyResponse>.Post(
32                    PwgConfigProxy.PwgServeurUri,
33                    data.ToString());
34            }
35            catch (Exception ex)
36            {
37                throw new PwgProxyException("pwg_images_rate", ex);
38            }
39
40            return response;
41        }
42
43    }
44
45}
46
Note: See TracBrowser for help on using the repository browser.