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/Service/PwgImagesService.cs

    r7149 r11850  
    99using Com.Piwigo.Lib.DTO.Helper;
    1010using Com.Piwigo.Lib.IService;
     11using System.IO;
    1112
    1213namespace Com.Piwigo.Lib.Service
     
    4445            {
    4546                throw new PwgServiceException("RateImage : a error is raised by proxy.", ex);
     47            }
     48            return returnValue;
     49        }
     50
     51        public Boolean addImageByMultiPartForm(FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags)
     52        {
     53            Boolean returnValue = false;
     54
     55            try
     56            {
     57                PwgBaseProxyReponse response = PwgImagesProxy.pwg_images_addSimple(fileImage,imageId, categoryId, imageName, imageAuthor, imageComment, imageLevel, imageTags );
     58
     59                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
     60                {
     61                    if (response.Erreur != null)
     62                    {
     63                        throw new PwgServiceException("addImageByMultiPartForm, the server has return the error.",
     64                            response.Erreur.Code,
     65                            response.Erreur.Message);
     66                    }
     67                    else
     68                    {
     69                        throw new PwgServiceException("addImageByMultiPartForm : a error occurs during server process.");
     70                    }
     71                }
     72                else
     73                {
     74                    returnValue = true;
     75                }
     76            }
     77            catch (PwgProxyException ex)
     78            {
     79                throw new PwgServiceException("addImageByMultiPartForm : a error is raised by proxy.", ex);
    4680            }
    4781            return returnValue;
Note: See TracChangeset for help on using the changeset viewer.