Ignore:
Timestamp:
Jul 29, 2011, 6:05:05 PM (13 years ago)
Author:
bayral
Message:

MAj des truc existant et debut du upload de fichier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs

    r7149 r11850  
    1010namespace Com.Piwigo.Lib.Proxy
    1111{
     12    /// <summary>
     13    /// pwg.categories.add              pwg_categories_add
     14    /// pwg.categories.delete           pwg_categories_delete
     15    /// pwg.categories.getAdminList     pwg_categories_getAdminList
     16    /// pwg.categories.getImages        pwg_categories_getImages
     17    /// pwg.categories.getList          pwg_categories_getList
     18    /// pwg.categories.move             pwg_categories_move
     19    /// pwg.categories.setInfo          pwg_categories_setInfo
     20    /// </summary>
    1221    static internal class PwgCategoriesProxy
    1322    {
     
    200209
    201210        /// <summary>
    202         ///
    203         /// </summary>
    204         /// <param name="tagName"></param>
    205         /// <returns></returns>
    206         static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
    207         {
    208             PwgAddRequestProxyResponse response = null;
    209             try
    210             {
    211                 StringBuilder data = new StringBuilder();
    212                 data.Append("method=pwg.tags.add");
    213                 data.Append("&name=" + HttpUtility.UrlEncode(tagName));
    214 
    215                 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    216                     PwgConfigProxy.PwgServeurUri,
    217                     data.ToString());
    218             }
    219             catch (Exception ex)
    220             {
    221                 throw new PwgProxyException("pwg_tag_add", ex);
    222             }
    223 
    224             return response;
    225         }
    226 
     211        /// pwg.categories.delete
     212        /// </summary>
     213        /// <param name="CategorysId"></param>
     214        /// <param name="SecurityToken"></param>
     215        /// <param name="PhotoDeletionMode"></param>
     216        /// <returns></returns>
     217        static internal PwgBaseProxyReponse pwg_categories_delete(Int32 CategoryId,
     218                                                                  String SecurityToken,
     219                                                                  PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode)
     220        {
     221            PwgBaseProxyReponse response = null;
     222            try
     223            {
     224                StringBuilder data = new StringBuilder();
     225                Boolean firstOcc = true;
     226                data.Append("method=pwg.categories.delete");
     227                firstOcc = false;
     228                PwgProxyReponseHelper.buildQueryFromValue<Int32>(CategoryId, "category_id", ref firstOcc, data);
     229                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
     230                PwgProxyReponseHelper.buildQueryFromValue<PwgCategoryPhotoDeletionModeEnum>(PhotoDeletionMode, "photo_deletion_mode", ref firstOcc, data);
     231
     232                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
     233                                PwgConfigProxy.PwgServeurUri,
     234                                data.ToString());
     235            }
     236            catch (Exception ex)
     237            {
     238                throw new PwgProxyException("pwg_categories_delete", ex);
     239            }
     240
     241            return response;
     242        }
     243
     244        static internal PwgBaseProxyReponse pwg_categories_move(List<Int32> CategoriesId,
     245                                                                Int32 ParentCategoryId,
     246                                                                String SecurityToken)
     247        {
     248            PwgBaseProxyReponse response = null;
     249            try
     250            {
     251                StringBuilder data = new StringBuilder();
     252                Boolean firstOcc = true;
     253                data.Append("method=pwg.categories.move");
     254                firstOcc = false;
     255                PwgProxyReponseHelper.buildQueryFromArray<Int32>(CategoriesId, "category_id", ref firstOcc, data);
     256                PwgProxyReponseHelper.buildQueryFromValue<Int32>(ParentCategoryId, "parent", ref firstOcc, data);
     257                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
     258
     259                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
     260                                PwgConfigProxy.PwgServeurUri,
     261                                data.ToString());
     262            }
     263            catch (Exception ex)
     264            {
     265                throw new PwgProxyException("pwg_categories_delete", ex);
     266            }
     267
     268            return response;
     269        }
    227270    }
    228271
Note: See TracChangeset for help on using the changeset viewer.