Beispiel #1
0
    /// <summary>
    /// Gallery/Genre/Subject/Reviews repeater nested within 'parentRptSingleWork_ItemDataBound'
    /// </summary>
    protected void parentRptSingleWork_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {
        //Gallery Repeater: Child
        Repeater innerRptGallery = (Repeater)e.Item.FindControl("rptGallery");

        GalleryCollection gl = new GalleryCollection(false);

        gl.FetchForId(ac[0].GalleryID);
        innerRptGallery.DataSource = gl;
        innerRptGallery.DataBind();

        //Genre Repeater: Child
        Repeater innerRptGenre = (Repeater)e.Item.FindControl("rptGenre");

        GenreCollection _gCol = new GenreCollection(false);

        _gCol.FetchByArtWorkID(artWorkId);
        innerRptGenre.DataSource = _gCol;
        innerRptGenre.DataBind();

        //Second Genre Repeater (For Related Artworks in Accordian): Child
        Repeater innerRptRelatedArt = (Repeater)e.Item.FindControl("rptRelatedArt");

        GenreCollection _gCol2 = new GenreCollection(false);

        _gCol2.FetchByArtWorkID(artWorkId);
        innerRptRelatedArt.DataSource = _gCol2;
        innerRptRelatedArt.DataBind();

        //Subject Repeater: Child
        Repeater innerRptSubject = (Repeater)e.Item.FindControl("rptSubject");

        SubjectCollection _sCol = new SubjectCollection(false);

        _sCol.FetchByArtWorkId(artWorkId);
        innerRptSubject.DataSource = _sCol;
        innerRptSubject.DataBind();

        //Sales Repeater (Using date created---> Order/OrderDetails)
        Repeater innerRptOrders = (Repeater)e.Item.FindControl("rptSalesDateCreatedList");

        OrdersCollection _ordCol = new OrdersCollection();

        _ordCol.FetchByArtworkID(artWorkId);
        innerRptOrders.DataSource = _ordCol;
        innerRptOrders.DataBind();

        //Getting the Reviews
        artReview.FetchReviewsByArtWorkId(artWorkId);

        if (!artReview.IsEmpty)
        {
            rptReview.DataSource = artReview;
            rptReview.DataBind();
        }
        else
        {
            emptyReview.Text = "There is no review for this artwork ";
        }
    }
        protected void PopulateData()
        {
            string result  = string.Empty;
            string strHTML = string.Empty;

            GalleryCollection            gallery_collection_obj = new GalleryCollection();
            List <CustomCollectionFiles> lst = gallery_collection_obj.GetCollectionListForMaster(2, '1');
            DataTable dt = LinqHelper.ToDataTable(lst);

            if (dt.Rows.Count > 0)
            {
                string path_image = "/user_files/images/gallery_images/collection/";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    result += "<li style=\"width: 170px;\" jcarouselindex=\"1\" class=\"jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal\">"
                              + "<a href='' title='" + dt.Rows[i]["Title"].ToString() + "'>"
                              + "<img class=\"imgPortal\" src='" + path_image + dt.Rows[i]["IconFile"].ToString() + "' alt='" + dt.Rows[i]["Title"].ToString() + "' title='" + dt.Rows[i]["Title"].ToString() + "' style=\"width: 150px;height: 104px;\">"
                              + "</a>"
                              + "<p class=\"titleBox\">"
                              + " <a href='' title='" + dt.Rows[i]["Title"].ToString() + "' >" + dt.Rows[i]["Title"].ToString() + "</a>"
                              + "</p>"
                              + "</li>";
                }
                strHTML = "<div style=\"display: block;\" class=\"jcarousel-container jcarousel-container-horizontal\">"
                          + "<div class=\"jcarousel-clip jcarousel-clip-horizontal\">"
                          + "<ul  id=\"ulCarousel\" style=\"width: 1800px; left: -1200.66px;\" class=\"jcarousel-list jcarousel-list-horizontal\">"
                          + result
                          + "</ul>"
                          + "</div>"
                          + "</div>";
                divPictuerBox.InnerHtml = strHTML;
            }
        }
Beispiel #3
0
        private void HandlePassedData(List <BitmapImage> argBitmap, List <string> argPathes)
        {
            if (bitmapList != null && bitmapList.Count > 0)
            {
                bitmapList.Clear();
            }
            if (pathesList != null && pathesList.Count > 0)
            {
                pathesList.Clear();
            }
            this.bitmapList = new List <BitmapImage>(argBitmap);
            this.pathesList = new List <string>(argPathes);

            if (bitmapList.Count == pathesList.Count)
            {
                if (GalleryCollection != null && GalleryCollection.Count > 0)
                {
                    GalleryCollection.Clear();
                }
                for (int i = 0; i < bitmapList.Count; i++)
                {
                    GalleryCollection.Add(new GalleryModel(bitmapList[i], Path.GetFileName(pathesList[i])));
                }
            }
        }
Beispiel #4
0
        protected void PopulateCollectionList2DDL()
        {
            GalleryCollection gallery_collection_obj = new GalleryCollection();
            int topicid = Convert.ToInt32(ddlTreeNode_Topics.SelectedValue);
            List <Gallery_Collection> list = gallery_collection_obj.GetList(topicid, '1');

            ddlCollection.Items.Clear();
            ddlCollection.DataSource     = list;
            ddlCollection.DataTextField  = "Title";
            ddlCollection.DataValueField = "CollectionId";
            ddlCollection.Items.Insert(0, new ListItem("- Chọn -", "0"));
            ddlCollection.DataBind();
            ddlCollection.AutoPostBack = true;
        }
Beispiel #5
0
        public void GalleriesGetListUserIdTest()
        {
            GalleryCollection galleries = Instance.GalleriesGetList(Data.UserId);

            Assert.IsNotNull(galleries, "GalleryCollection should not be null.");
            Assert.AreNotEqual(0, galleries.Count, "Count should not be zero.");

            foreach (var g in galleries)
            {
                Assert.IsNotNull(g);
                Assert.IsNotNull(g.Title, "Title should not be null.");
                Assert.IsNotNull(g.GalleryId, "GalleryId should not be null.");
                Assert.IsNotNull(g.GalleryUrl, "GalleryUrl should not be null.");
            }
        }
        protected void CollectionList2DDL()
        {
            if (ddlTreeNode_Topics.SelectedValue != string.Empty)
            {
                GalleryCollection gallery_collection_obj = new GalleryCollection();
                int topicid = Convert.ToInt32(ddlTreeNode_Topics.SelectedValue);
                List <Gallery_Collection> list = gallery_collection_obj.GetList(topicid, '1');

                ddlCollection.Items.Clear();
                ddlCollection.DataSource     = list;
                ddlCollection.DataTextField  = "Title";
                ddlCollection.DataValueField = "CollectionId";
                ddlCollection.DataBind();
            }
            ddlCollection.Items.Insert(0, new ListItem("- Chọn -", ""));
        }
Beispiel #7
0
        /// <summary>
        /// Return the list of galleries created by a user. Sorted from newest to oldest.
        /// </summary>
        public GalleryCollection VtGetListOfGalleries()
        {
            var galleryCollection = new GalleryCollection();

            var startTime = DateTime.Now;
            GalleryCollection searchedForPage = null;
            var page = 1;

            do
            {
                RaiseSearchProgressEvent("GalleriesGetList", galleryCollection.Count, startTime);

                searchedForPage = GalleriesGetList(page, SearchOptions_PerPage_MAX);
                foreach (var gallery in searchedForPage)
                {
                    galleryCollection.Add(gallery);
                }
                page++;
            } while (searchedForPage.Count >= SearchOptions_PerPage_MAX);

            return(galleryCollection);
        }
        /// <summary>
        /// Get a list of galleries the specified <paramref name="userName"/> can administer. Site administrators can view all
        /// galleries, while gallery administrators may have access to zero or more galleries.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <returns>
        /// Returns an <see cref="IGalleryCollection"/> containing the galleries the current user can administer.
        /// </returns>
        public static IGalleryCollection GetGalleriesUserCanAdminister(string userName)
        {
            IGalleryCollection adminGalleries = new GalleryCollection();
            foreach (IGalleryServerRole role in RoleController.GetGalleryServerRolesForUser(userName))
            {
                if (role.AllowAdministerSite)
                {
                    return Factory.LoadGalleries();
                }
                else if (role.AllowAdministerGallery)
                {
                    foreach (IGallery gallery in role.Galleries)
                    {
                        if (!adminGalleries.Contains(gallery))
                        {
                            adminGalleries.Add(gallery);
                        }
                    }
                }
            }

            return adminGalleries;
        }
        /// <summary>
        /// Gets a collection of all the galleries the specified <paramref name="userName" /> has access to.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <returns>Returns an <see cref="IGalleryCollection" /> of all the galleries the specified <paramref name="userName" /> has access to.</returns>
        public static IGalleryCollection GetGalleriesForUser(string userName)
        {
            IGalleryCollection galleries = new GalleryCollection();

            foreach (IGalleryServerRole role in RoleController.GetGalleryServerRolesForUser(userName))
            {
                foreach (IGallery gallery in role.Galleries)
                {
                    if (!galleries.Contains(gallery))
                    {
                        galleries.Add(gallery);
                    }
                }
            }

            return galleries;
        }