Beispiel #1
0
 public GalleryDetailPage()
 {
     InitializeComponent();
     ViewModel        = new GalleryDetailViewModel();
     this.DataContext = ViewModel;
     Loaded          += GalleryPage_OnLoaded;
 }
        public GalleryDetailPageViewModel Get_GalleryDetail_Page(int id)
        {
            GalleryDetailPageViewModel vm_page = new GalleryDetailPageViewModel();

            GalleryDetailViewModel vm_gallery = new GalleryDetailViewModel();
            ArtGalleryViewModel    gallery    = DataLayer.get_ArtGallery_byID(id);

            vm_gallery.fa_title       = gallery.fa_title;
            vm_gallery.openning_hours = gallery.fromHour + " - " + gallery.toHour;
            vm_gallery.visit_from     = gallery.fromDate;
            vm_gallery.visit_to       = gallery.toDate;
            vm_gallery.description    = gallery.description;
            vm_gallery.poster_path    = "/Upload/gallery_" + id + "/poster.jpg";
            vm_gallery.GalleryId      = id;

            List <string> str_images = DataLayer.get_gallery_images(id);

            for (int i = 0; i < str_images.Count; i++)
            {
                str_images[i] = ("gallery_" + id + "/" + str_images[i]);
            }

            vm_page.accordion_detail = vm_gallery;
            vm_page.photos           = str_images;

            return(vm_page);
        }
        public GalleryDetailViewModel Get_PartialDetail(int id, Controller ctrl)
        {
            GalleryDetailViewModel vm = new GalleryDetailViewModel();

            ArtGalleryViewModel gallery = DataLayer.get_ArtGallery_byID(id);

            vm.fa_title       = gallery.fa_title;
            vm.eng_title      = gallery.eng_title;
            vm.openning_hours = gallery.fromHour + " - " + gallery.toHour;
            vm.visit_from     = "Opening Day : " + gallery.fromDate;
            vm.visit_to       = "Continues to : " + gallery.toDate;

            string poster_path = "/Upload/gallery_" + gallery.GalleryId + "/poster.jpg";

            if (File.Exists(ctrl.Server.MapPath(@poster_path)))
            {
                vm.poster_path = poster_path + "?" + DateTime.Now.ToString("ddMMyyyyhhmmsstt");
            }
            else
            {
                vm.poster_path = "/images/empty.gif?" + DateTime.Now.ToString("ddMMyyyyhhmmsstt");
            }


            return(vm);
        }
Beispiel #4
0
        public IActionResult Detail(int id)
        {
            var image = _context.Images.Find(id);

            var model = new GalleryDetailViewModel()
            {
                Id  = image.Id,
                Url = image.Url
            };

            return(View(model));
        }
Beispiel #5
0
        protected internal override void OnCreate(object parameter)
        {
            base.OnCreate(parameter);
            var api = Intent.TryGet("api") as EHApi;

            switch (parameter)
            {
            case EHGallery gallery:
                ViewModel = new GalleryDetailViewModel(gallery, api);
                break;

            case string link:
                ViewModel = new GalleryDetailViewModel(link, api);
                break;
            }
        }
        public ActionResult Get_GalleryDetail(int id)
        {
            GalleryDetailViewModel vm = NegahenoService.Get_PartialDetail(id, this);

            return(PartialView("_PartialDetailGallery", vm));
        }