internal static EventDetailsTDO GetProcessedPhotosReporting(Event ev, FotoShoutDbContext db) { EventDetailsTDO evDetails = new EventDetailsTDO(); IEnumerable <Photo> photos = ev.Photos.Where(p => p.Status > (byte)PhotoStatus.Selected).OrderBy(p => p.Filename); if (!photos.Any()) { return(evDetails); } HashSet <dynamic> photosDetails = new HashSet <dynamic>(); foreach (var photo in photos) { dynamic tdo = new ExpandoObject(); tdo.PhotoId = photo.PhotoId; tdo.Filename = photo.Filename; tdo.Guests = PhotoAnnotationService.GetGuestsInfo(photo, false); photosDetails.Add(tdo); } if (photosDetails.Any()) { evDetails.EventOption = ev.EventOption; evDetails.PhotosDetails = photosDetails; } return(evDetails); }
// // GET: /EventPhoto/ExportToExcel/<filename> public ActionResult ExportToExcel(int id) { try { EventDetailsTDO photosDetails = fsWebService.GetProcessedPhotosReporting(id); return(new ExportResult <EventDetailsTDO>("~/Views/EventPhoto/_EventProcessedPhotosExport.cshtml", "ExportPhotosList.csv", photosDetails)); } catch (Exception ex) { FotoShoutUtils.Log.LogManager.Error(_logger, ex.ToString()); return(PartialView("_Error", ex.ToString())); } }
public ActionResult Report(int id) { try { EventDetailsTDO photosDetails = fsWebService.GetProcessedPhotosReporting(id); return(PartialView("_EventProcessedPhotosReport", photosDetails)); } catch (Exception ex) { FotoShoutUtils.Log.LogManager.Error(_logger, ex.ToString()); return(PartialView("_Error", ex.ToString())); } }