Beispiel #1
0
        public string getPhoto(string name)
        {
            PhotoEntity photo = new PhotoEntity();

            photo = (PhotoEntity)createEntity(pathPhoto + "\\" + name, photo);
            if (photo != null)
            {
                return(utils.getJson(photo));
            }
            return("{No photo with this name.}");
        }
Beispiel #2
0
        public string getAllPhoto()
        {
            List <PhotoEntity> photos = new List <PhotoEntity>();

            string[] dirs = Directory.GetFiles(pathPhoto, "*");
            foreach (string file in dirs)
            {
                PhotoEntity p = new PhotoEntity();
                p = (PhotoEntity)createEntity(file, p);
                if (p != null)
                {
                    photos.Add(p);
                }
            }
            return(utils.getJson(photos));
        }