public ActionResult ViewPhoto(string photo) { photosModel = new PhotosModel(outputDir); PhotoInfo p = photosModel.GetPhotoInfo(photo); return(View(p)); }
public ActionResult Index(string theme) { if (!string.IsNullOrWhiteSpace(theme)) { string dir = Server.MapPath("content/themes/" + theme); //make sure theme dir exists if (Directory.Exists(dir)) { Session["theme"] = theme; } } string re = Request.RawUrl; GalleryRepository rep = this.GetGalleryRepository(); ViewBag.Folders = rep.Folders; var photoRepository = new PhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = photoRepository.GetImagesCount() // Categorieses = photoRepository.GetCategories() }; ViewBag.Categories = photoRepository.GetCategories(); ViewBag.HtmlContent = rep.RootFolder.GetHtmlContentIfAny(); //initial html content from root folder return(View("Index")); }
public ActionResult PhotosView(string id) { photosModel = new PhotosModel(outputDir); PhotoInfo p = photosModel.GetPhotoInfo(id); return(View(p)); //check that is not null }
/// <summary> /// Returns the new photos view /// </summary> /// <param name="photoView"></param> /// <returns></returns> public ActionResult ReturnFromDelete(string photoView) { // delete the photo this.photosModel = PhotosModel.Instance; foreach (PhotosModel.Photo photo in this.photosModel.photosList) { if (photo.RealRelPath == photoView) { try { string thumbnailToDelete = photo.ThumbnailPath; string pathToDelete = photo.Path; if (System.IO.File.Exists(pathToDelete)) { int x = 5; } System.IO.File.Delete(thumbnailToDelete); System.IO.File.Delete(pathToDelete); this.photosModel.photosList.Remove(photo); } catch (Exception e) { } return(RedirectToAction("Photos")); } } return(RedirectToAction("Photos")); }
public ActionResult Add() { PhotoRepository rep = this.GetPhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = rep.GetImagesCount(), Categorieses = rep.GetCategories(), CatCount = rep.GetCategories().Count, }; return(View("Add", photosModel)); }
// // GET: /Photos/ public ViewResult Index() { var photoRepository = new PhotoRepository(); PhotosModel photosModel = new PhotosModel() { PicCount = photoRepository.GetImagesCount(), Categorieses = photoRepository.GetCategories() }; return(View("IndexPhoto", photosModel)); }
public async Task <IEnumerable <PhotosModel> > Get(int id) { IEnumerable <PhotosModel> result = new PhotosModel[] { }; using (var client = new HttpClient()) { var list = JsonConvert.DeserializeObject <List <PhotosModel> >(await client.GetStringAsync("http://jsonplaceholder.typicode.com/photos")); result = list.Where(x => x.albumId == id); } return(result); }
/// <summary> /// Delete a specific image (open new view to make sure the user wants to delete) /// </summary> /// <param name="photoView"></param> /// <returns></returns> public ActionResult DeleteImage(string photoView) { this.photosModel = PhotosModel.Instance; foreach (PhotosModel.Photo photo in this.photosModel.photosList) { if (photo.RealRelPath == photoView) { return(View(photo)); } } return(View()); }
public ActionResult Photos() { if (!config.isReady) { LoadConfig(); } while (!config.isReady) { } PhotosModel model = new PhotosModel(config.OutputDir); return(View(model)); }
public static bool CheckPhotos(PhotosModel photos) { if (photos == null) { return(false); } if (photos.Photos != null && photos.Hash != null) { return(true); } return(false); }
/// <summary> /// Photoses the view. /// </summary> /// <returns>PartialViewResult.</returns> public PartialViewResult PhotosDelete(string id) { removedPhoto = id; photosModel = new PhotosModel(outputDir); return(PartialView("PhotosDelete", id)); //check that is not null }
public ActionResult Photos(string oauth_token, string oauth_verifier, string q) { if (Session[OAuthSessionKey] == null) { Session[OAuthSessionKey] = OAuthService.GetOAuthUser(oauth_token, oauth_verifier); } var user = Session[OAuthSessionKey] as IOAuthUser; var photos = PhotoService.GetPhotos(user, (q ?? String.Empty)); var alltags = PhotoService.GetAllTags(user); var photosmodel = new PhotosModel { Owner = user, Photos = photos, Tags = alltags }; return View(photosmodel); }
public ActionResult Photos() { PhotosModel model = new PhotosModel(); return(View(model)); }
/// <summary> /// photos page view. /// </summary> /// <returns></returns> public ActionResult PhotosView() { configModel.getConfig(); photosModel = new PhotosModel(configModel.OutputDirectory); return(View(photosModel)); }
/// <summary> /// Returns all the photos in the thumbnail view. /// </summary> /// <returns></returns> public ActionResult Photos() { this.photosModel = PhotosModel.Instance; this.photosModel.Initialize(); return(View(this.photosModel.photosList)); }
public ActionResult Photos() { photosModel = new PhotosModel(outputDir); return(View(photosModel)); }
public ActionResult OnDeletePhoto() { photosModel = new PhotosModel(outputDir); photosModel.RemovePhoto(removedPhoto); return(RedirectToAction("Photos", photosModel)); }
// // GET: /Photos/ public ActionResult Index() { PhotosModel model = new PhotosModel(); return(View(model.PhotosByParentId().ToList())); }
public virtual void Initialize(Context context) { this.context = context; PhotosModel = new PhotosModel(Database); DownloadedElevationDataModel = new DownloadedElevationDataModel(Database); }
/// <summary> /// Consturctor. /// </summary> public PhotosController() { photosModel = new PhotosModel(); }