source: extensions/PiwigoLib/PiwigoLib/Service/PwgTagsService.cs @ 3816

Last change on this file since 3816 was 3816, checked in by bayral, 15 years ago

Initial import

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using Com.Piwigo.Lib.DTO;
6using Com.Piwigo.Lib.Proxy;
7using Com.Piwigo.Lib.Proxy.Response;
8using Com.Piwigo.Lib.DTO.Helper;
9
10namespace 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}
Note: See TracBrowser for help on using the repository browser.