public ActionResult Edit([Bind(Include = "GalleryId,ImageUrl,IsActive")] Galleries galleries)
 {
     if (ModelState.IsValid)
     {
         db.Entry(galleries).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(galleries));
 }
示例#2
0
        public IActionResult Edit(ViewEditModel viewEditModel)
        {
            if (ModelState.IsValid)
            {
                Galleries galleries = mercyContext1.Galleries.Find(viewEditModel.Id);
                galleries.Id   = viewEditModel.Id;
                galleries.Name = viewEditModel.Name;
                if (viewEditModel.Photo != null)
                {
                    if (viewEditModel.CurrentPhoto != null)
                    {
                        string file = Path.Combine(iwebHostEnvironment.WebRootPath, "images",
                                                   viewEditModel.CurrentPhoto);
                        //if (file!=null)
                        //{
                        System.IO.File.Delete(file);
                        //}
                        //else
                        //{
                        //    return View("Picture already Exist.");
                        //}
                    }
                    galleries.Photo = NewMethod(viewEditModel);
                }
                mercyContext1.Update(galleries);
                mercyContext1.SaveChanges();

                return(RedirectToAction("UploadInfo", "Account"));
            }
            return(View());
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (featuredCategory == null)
     {
         featuredCategory = Galleries.GetFeatured(Galleries.GalleryType.Category);
     }
 }
示例#4
0
        public IActionResult Delete(DeleteModel deleteModel, ViewEditModel viewEditModel, int id)
        {
            Galleries remove = mercyContext1.Galleries.Find(id);


            DeleteModel deleteModel1 = new DeleteModel
            {
                Id          = remove.Id,
                Name        = remove.Name,
                DeletePhoto = remove.Photo
            };

            string upload     = Path.Combine(iwebHostEnvironment.WebRootPath, "images");
            string uniqueName = Guid.NewGuid().ToString() + "_" + deleteModel.Photo.FileName;
            string filePath   = Path.Combine(upload, uniqueName);

            using (var fileStream = new FileStream(filePath, FileMode.Create))
            {
                deleteModel.Photo.CopyTo(fileStream);
            }

            var sd = Path.Combine(iwebHostEnvironment.WebRootPath, "images", deleteModel.DeletePhoto);

            if (System.IO.File.Exists(sd))
            {
                System.IO.File.Delete(sd);
            }
            mercyContext1.Galleries.Remove(remove);
            mercyContext1.SaveChanges();

            RedirectToAction("UploadInfo", "Account");

            return(View());
        }
        private static List <GalleryItem> GetLatestPhotos()
        {
            var latestPhotos = new List <GalleryItem>();

            latestPhotos = Galleries.GetGallery(Galleries.GalleryType.Image, 8);
            return(latestPhotos);
        }
示例#6
0
    public void Init(Galleries galleries, int id, string _title, string _url)
    {
        loadingAsset.SetActive(true);
        //Debug.Log ("B_ID: " + id);
        title.text = _title;
        GetComponent<Button>().onClick.AddListener(() =>
        {
            OnSelected(galleries, id);
        });

        //ArtData.GalleryData.ArtData artData = null;

        if (id == -1 && Data.Instance.artData.favorites.Count>0)
            artData = Data.Instance.artData.GetArtData(Data.Instance.artData.favorites[0].galleryId, Data.Instance.artData.favorites[0].artId);
        else if(id == -2 && Data.Instance.artData.myArtWorks.artWorksData.Count>0)
            artData = Data.Instance.artData.myArtWorks.artWorksData[0];
        else  //if (id > -1)
            artData = Data.Instance.artData.GetArtData(id, 0);

        if (_url != "")
            StartCoroutine(LoadThumb(_url));

        //if (artData != null)
        //{
        //    string url = artData.GetUrl();
        //    if(artData.isLocal)
        //        RealLoadLocalImage(url);
        //    else{
        //        if (url.Length > 6){
        //            StartCoroutine(LoadThumb(url));
        //        }
        //    }
        //}
    }
        private static List <GalleryItem> GetLatestVideos()
        {
            var latestVideos = new List <GalleryItem>();

            latestVideos = Galleries.GetGallery(Galleries.GalleryType.Video, 8);
            return(latestVideos);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Photo")] Galleries galleries)
        {
            if (id != galleries.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(galleries);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GalleriesExists(galleries.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(galleries));
        }
        public ActionResult DeleteConfirmed(short id)
        {
            Galleries galleries = db.Galleries.Find(id);

            db.Galleries.Remove(galleries);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#10
0
 /// <summary>
 /// Deletes a gallery
 /// </summary>
 /// <param name="gallery">gallery</param>
 public virtual void DeleteGallery(Galleries gallery)
 {
     if (gallery == null)
     {
         throw new ArgumentNullException("gallery");
     }
     _galleryRepository.Delete(gallery);
     UpdateGallery(gallery);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            topFeaturedArticles = Galleries.GetFeatured(Galleries.GalleryType.Article);
            CleanUpArticleForBillboard();
            var billboardJson      = JsonConvert.SerializeObject(topFeaturedArticles);
            var functionScriptCall = string.Format("constructBillboard({0});", billboardJson);

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", functionScriptCall, true);
        }
        protected void UpdatePictureSeoNames(Galleries gallery)
        {
            var picture = _pictureService.GetPictureById(gallery.PictureId);

            if (picture != null)
            {
                _pictureService.SetSeoFilename(picture.Id, _pictureService.GetPictureSeName(gallery.Name));
            }
        }
示例#13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     featuredCategory = Galleries.GetFeatured(Galleries.GalleryType.Category);
     LoadFeaturedCategoryArticles();
     LoadFeaturedCategories();
     loadLatestGalleries();
     LoadLatestMonthlyContributors();
     LoadTopEarningVideos();
     loadAds();
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Galleries galleries = db.Gallery.Find(id);

            db.photo.RemoveRange(db.photo.Where(x => x.GalleryID == galleries.GalleryID));

            db.Gallery.Remove(galleries);
            db.SaveChanges();
            return(RedirectToAction("Mygalleries"));
        }
        public void AddGalleryService(GalleriesDTO entity)
        {
            Galleries galleries = new Galleries
            {
                GalleryCategoryId = entity.GalleryCategoryId,
                GalleryName       = entity.GalleryName,
                GalleryPhoto      = entity.GalleryPhoto
            };

            galleriesRepository.Add(galleries);
        }
        public ActionResult galleryphotos2(int?id, string search, int?pages)
        {
            Galleries gallery = db.Gallery.Find(id);
            int       name    = gallery.GalleryID;

            if (!string.IsNullOrEmpty(search))
            {
                return(View(db.photo.Where(x => x.GalleryID == name && x.ImageName.Contains(search) || search == null).OrderBy(X => X.ImageName).ToPagedList(pages ?? 1, 1)));
            }
            return(View(db.photo.Where(x => x.GalleryID == name).OrderBy(x => x.ImageName).ToPagedList(pages ?? 1, 1)));
        }
        public ActionResult Create([Bind(Include = "GalleryId,ImageUrl,IsActive")] Galleries galleries)
        {
            if (ModelState.IsValid)
            {
                db.Galleries.Add(galleries);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(galleries));
        }
        public ActionResult Create([Bind(Include = "GalleryID,GalleryName,GalleryCreator")] Galleries galleries)
        {
            if (ModelState.IsValid)
            {
                galleries.GalleryCreator = User.Identity.Name;
                db.Gallery.Add(galleries);
                db.SaveChanges();
                return(RedirectToAction("Mygalleries"));
            }

            return(View(galleries));
        }
示例#19
0
文件: Global.cs 项目: Piorosen/HioViw
        public void Remove(string mID)
        {
            int num = ID.IndexOf(mID);

            if (num != -1)
            {
                Galleries.RemoveAt(num);
                ID.RemoveAt(num);
                DownloadPage.RemoveAt(num);
                TotalPage.RemoveAt(num);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadTopEarningVideos();
            List <GalleryItem> fVideos = new List <GalleryItem>();

            fVideos        = Galleries.GetFeatured(Galleries.GalleryType.Video);
            featuredVideos = (fVideos.Count() >= 4) ? fVideos.GetRange(0, 4) : fVideos;
            //LoadTopEarningVideos();
            //LoadLasteBLogs();
            //loadAds();
            //loadTopStories();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            videoGallery = Galleries.GetGallery(Galleries.GalleryType.Video, 8);
            imageGallery = Galleries.GetGallery(Galleries.GalleryType.Image, 8);
            latestBlogs  = library.GetLatestCompletedArticles(4);
            stringMonth  = utils.FullyQualifiedMonthName(DateTime.Now.Month);
            uc_TopMonthlyContributors Contributors = (uc_TopMonthlyContributors)LoadControl("~/uc_TopMonthlyContributors.ascx");

            topTenContributors.Controls.Add(Contributors);
            LoadTopEarningVideos();
            loadAds();
            loadTopStories();
        }
示例#22
0
        public IActionResult Edit(int id)
        {
            Galleries galleries1 = mercyContext1.Galleries.Find(id);

            ViewEditModel viewEditModel = new ViewEditModel
            {
                Id           = galleries1.Id,
                Name         = galleries1.Name,
                CurrentPhoto = galleries1.Photo,
            };

            return(View(viewEditModel));
        }
示例#23
0
        public ActionResult Index(int pageIndex = 0)
        {
            GalleryLink[] galleryLinks = GetGalleryLinks(pageIndex);

            Galleries galleriesModel = new Galleries
            {
                Category            = Category.Gallery,
                Gallery             = galleryLinks,
                NextPreviousOptions = NextPreviousOptions.ForPageIndex(pageIndex, galleries.Count())
            };

            return(View(galleriesModel));
        }
示例#24
0
        //Details of a product
        public IActionResult UploadsDetails(Galleries viewDetails, int?id)
        {
            var filename = mercyContext1.ViewDetails.FirstOrDefault(s => s.Id == id);

            if (filename != null)
            {
                return(View("UploadsDetails", filename));
            }
            else
            {
                return(View());
            }
        }
        private void RenderGalleries()
        {
            Feeds.Items.Clear();

            TreeViewItem selectedItem = null;

            var galleries = Galleries.ToList();

            foreach (var gallery in galleries)
            {
                gallery.Initialize(this);

                var treeViewItem = new TreeViewItem
                {
                    Header     = gallery.Name,
                    IsExpanded = true
                };

                if (Feeds.Items.Count > 0)
                {
                    treeViewItem.Margin = new Thickness(0, 8, 0, 0);
                }

                Feeds.Items.Add(treeViewItem);

                foreach (var feed in gallery.GetFeeds())
                {
                    feeds.Add(feed);
                    feed.SetInstalledPlugins(InstalledPlugins);

                    var item = new TreeViewItem
                    {
                        Header     = feed.FeedName,
                        Tag        = feed,
                        FontWeight = FontWeights.Normal
                    };

                    treeViewItem.Items.Add(item);

                    if (selectedItem == null)
                    {
                        selectedItem = item;
                    }
                }
            }

            if (selectedItem != null)
            {
                selectedItem.IsSelected = true;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     //topFeaturedArticles = Galleries.GetFeatured(Galleries.GalleryType.Article);
     featuredVideos = Galleries.GetFeatured(Galleries.GalleryType.Video);
     //CleanUpArticleForBillboard();
     LoadLatestMonthlyContributors();
     LoadTopEarningVideos();
     LoadLasteBLogs();
     loadLatestGalleries();
     buildYouTubeVideosArray(featuredVideos);
     loadAds();
     loadBB();
     loadTings();
 }
示例#27
0
        /// <summary>
        /// Updates the gallery
        /// </summary>
        /// <param name="gallery">gallery</param>
        public virtual void UpdateGallery(Galleries gallery)
        {
            if (gallery == null)
            {
                throw new ArgumentNullException("gallery");
            }
            _galleryRepository.Update(gallery);

            //cache
            _cacheManager.RemoveByPattern(GALLERIES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityUpdated(gallery);
        }
        // GET: AdminPage/Galleries/Delete/5
        public ActionResult Delete(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Galleries galleries = db.Galleries.Find(id);

            if (galleries == null)
            {
                return(HttpNotFound());
            }
            return(View(galleries));
        }
        protected void UpdateLocales(Galleries gallery, ConfigurationGalleryModel model)
        {
            foreach (var localized in model.Locales)
            {
                _localizedEntityService.SaveLocalizedValue(gallery,
                                                           x => x.Name,
                                                           localized.Name,
                                                           localized.LanguageId);

                _localizedEntityService.SaveLocalizedValue(gallery,
                                                           x => x.Description,
                                                           localized.Description,
                                                           localized.LanguageId);
            }
        }
示例#30
0
    public void onAreaEnter(Collider other, int connectionIndex)
    {
        if (!this.isCurrentRoom)
        {
            this.isCurrentRoom = true;
            Galleries gallerie = this.transform.parent.GetComponent <Galleries>();

            if (gallerie)
            {
                gallerie.onRoomEnter(this, connectionIndex);
            }

            Debug.Log("Enter Room");
        }
    }
        //private string categoryId;
        //protected string CategoryId
        //{
        //    get
        //    {
        //        if (String.IsNullOrEmpty(categoryId) && Page.RouteData.Values["id"].ToString() != null)
        //            categoryId = Page.RouteData.Values["id"].ToString();

        //        return categoryId;
        //    }
        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            if (HasCategoryUrl())
            {
                string categoryUrl = Request.QueryString["p"].ToString();
                categoryId       = Convert.ToInt32(library.GetCategoryUrlId(categoryUrl));
                featuredCategory = new List <GalleryItem>();
                featuredCategory = Galleries.GetFeatured(Galleries.GalleryType.Category);
                LoadFeaturedCategoryArticles();
                LoadFeaturedCategories();
                loadLatestGalleries();
                LoadLatestMonthlyContributors();
                LoadTopEarningVideos();
                LoadAd();
            }
        }
示例#32
0
 public void OnSelected(Galleries galleries, int id)
 {
     /////
     galleries.OnSelect(id);
 }