Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //place pictures
        string addPicString = string.Empty;
        tblStaffDetailsCollection staffDetailsTbl = new tblStaffDetailsCollection();
        tblGalleryPicsCollection  galleryTbl      = new tblGalleryPicsCollection();

        galleryTbl.ReadList();

        for (int i = 0; i < galleryTbl.Count; i++)
        {
            staffDetailsTbl.ReadList(Criteria.NewCriteria(tblStaffDetails.Columns.idPic, CriteriaOperators.Equal, galleryTbl[i].id));
            addPicString += "<div class='grid1_of_4 flip-card'><div class='content_box flip-card-inner'><div class='flip-card-front'>" +
                            "<a href='gallery-normal-details.aspx?item=" + galleryTbl[i].id + "'>" +
                            "<img src='../images/gallery/" + galleryTbl[i].picName + "' class='img-responsive' alt='halisenGallery" + galleryTbl[i].id + "'></a></div>" +
                            "<div class='grid_1 simpleCart_shelfItem flip-card-back'>" +
                            "<h1><a style='color: white;'> " + galleryTbl[i].picTile + " </a></h1>" +
                            "<p>" + galleryTbl[i].picDetail + "</p>" +
                            "<h6 style='padding: 10% 0;'>Price: $" + staffDetailsTbl[0].staffPrice + ".00</h6>" +
                            "<a class='edit-gallery-button' href='gallery-normal-details.aspx?item=" + galleryTbl[i].id + "'>EDIT</a></div></div></div>";
        }
        //addPicHtml.InnerHtml = addPicString;


        //fill the drop down lists
        tblColorsCollection colorsTbl = new tblColorsCollection();

        colorsTbl.ReadList();

        tblShapeCollection shapesTbl = new tblShapeCollection();

        shapesTbl.ReadList();

        tblSizeCollection sizeTbl = new tblSizeCollection();

        sizeTbl.ReadList();

        tblGalleryGroupCollection groupsTbl = new tblGalleryGroupCollection();

        groupsTbl.ReadList();

        for (int i = 0; i < colorsTbl.Count; i++)
        {
            ddlColors.Items.Add(new ListItem(colorsTbl[i].colorName, colorsTbl[i].id.ToString()));
        }

        for (int i = 0; i < shapesTbl.Count; i++)
        {
            ddlShape.Items.Add(new ListItem(shapesTbl[i].ShapeName, shapesTbl[i].id.ToString()));
        }

        for (int i = 0; i < sizeTbl.Count; i++)
        {
            ddlSize.Items.Add(new ListItem(sizeTbl[i].size, sizeTbl[i].id.ToString()));
        }

        for (int i = 0; i < groupsTbl.Count; i++)
        {
            // ddlGropus.Items.Add(groupsTbl[i].GroupTitle);
            ddlGropus.Items.Add(new ListItem(groupsTbl[i].GroupTitle, sizeTbl[i].id.ToString()));
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string headerStr = string.Empty; string headerDetStr = string.Empty; string galleryItemsStr = string.Empty; int counter = 0;

        #region Reading post values

        tblGalleryGroupCollection    galleryGrpTbl = new tblGalleryGroupCollection();
        tblGalleryPicturesCollection galleryTbl    = new tblGalleryPicturesCollection();

        int itemGet = 0;
        if (Request.QueryString["itemId"] != null)
        {
            itemGet = int.Parse(Request.QueryString["itemId"]);
            galleryGrpTbl.ReadList(Criteria.NewCriteria(tblGalleryGroup.Columns.id, CriteriaOperators.Equal, itemGet));
            galleryTbl.ReadList(Criteria.NewCriteria(tblGalleryPictures.Columns.idGroup, CriteriaOperators.Equal, itemGet));
            headerStr    = galleryGrpTbl[0].GalleryGroupTitle;
            headerDetStr = galleryGrpTbl[0].GalleryGroupDetail;
        }
        else
        {
            Response.Redirect("default.aspx");
        }

        #endregion

        #region filling header text

        headerGalleryHtml.InnerHtml = "<h3>" + headerStr + "</h3><p class='lead'>" + headerDetStr + "</p>";

        #endregion

        #region items filling

        galleryItemsStr += "<div class='gallery-row'>";
        for (int i = 0; i < galleryTbl.Count; i++)
        {
            if (counter == 4)
            {
                galleryItemsStr += "</div><div class='gallery-row'>";
                counter          = 0;
            }
            galleryItemsStr += "<div class='col-lg-3 col-md-3 col-sm-12 col-xs-12 wow fadeIn' data-wow-duration='1s' data-wow-delay='0.2s'>" +
                               "<div class='widget clearfix'><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt='bondelectric '" + galleryTbl[i].GalleryPicName + "' class='img-responsive'>" +
                               "<div class='widget-title'><h3>" + galleryTbl[i].GalleryPicTitle + "</h3></div><p>" + galleryTbl[i].GalleryPicDetail + "</p>" +
                               "<hr></div></div>";

            counter++;
        }

        gallertItemsHtml.InnerHtml = galleryItemsStr;

        #endregion

        #region header top picture
        tblLogsCollection picTopTbl = new tblLogsCollection();
        picTopTbl.ReadList();
        if (picTopTbl.Count > 0)
        {
            headerPicHtml.Attributes["style"] = "background: url(" + picTopTbl[0].logDetail + ")no-repeat;background-size: cover;background-position: center;";
        }
        #endregion
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        tblGalleryPicturesCollection galleryTbl = new tblGalleryPicturesCollection();

        galleryTbl.ReadList();
        tblGalleryGroupCollection galleryGrpTbl = new tblGalleryGroupCollection();

        galleryGrpTbl.ReadList();


        #region slider
        int    sliderCount  = 0;
        string sliderString = "";
        if (galleryTbl.Count > 5)
        {
            for (int i = galleryTbl.Count - 1; i > galleryTbl.Count - 6; i--)
            {
                sliderString += "<li><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt='دنیای ورزشی" + galleryTbl[i].GalleryPicName + "' title='" + galleryTbl[i].GalleryPicTitle + "' id='wows1_" + sliderCount + "' /></li>";
                sliderCount++;
            }
        }
        else
        {
            for (int i = galleryTbl.Count - 1; i > 0; i--)
            {
                sliderString += "<li><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt='دنیای ورزشی" + galleryTbl[i].GalleryPicName + "' title='" + galleryTbl[i].GalleryPicTitle + "' id='wows1_" + sliderCount + "' /></li>";
                sliderCount++;
            }
        }
        sliderHtml.InnerHtml = sliderString;
        #endregion


        #region tabMenu
        string tabsStrings = string.Empty;
        if (galleryGrpTbl.Count > 0)
        {
            tabsStrings += "<li  class='active'><a data-toggle='tab' href='#tab" + galleryGrpTbl[0].id + "'>" + galleryGrpTbl[0].GalleryGroupTitle + "</a></li>";
        }

        for (int i = 1; i < galleryGrpTbl.Count; i++)
        {
            tabsStrings += "<li><a data-toggle='tab' href='#tab" + galleryGrpTbl[i].id + "'>" + galleryGrpTbl[i].GalleryGroupTitle + "</a></li>";
        }
        tabsHtml.InnerHtml = tabsStrings;
        #endregion


        #region tab content
        string newsTabBarString = string.Empty;
        for (int j = 0; j < galleryGrpTbl.Count; j++)
        {
            galleryTbl.ReadList(Criteria.NewCriteria(tblGalleryPictures.Columns.idGroup, CriteriaOperators.Equal, galleryGrpTbl[j].id));
            if (j == 0)
            {
                newsTabBarString += "<div id='tab" + galleryGrpTbl[j].id + "' class='tab-pane fade in active'><div class='row'>";
            }
            else
            {
                newsTabBarString += "<div id='tab" + galleryGrpTbl[j].id + "' class='tab-pane fade'><div class='row'>";
            }

            if (galleryTbl.Count < 5)
            {
                for (int i = 0; i < galleryTbl.Count; i++)
                {
                    newsTabBarString += "<div class='col-md-4 col-sm-6'><article class='article'><div class='article2-img'>";


                    newsTabBarString += "<a><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt='" + galleryTbl[i].GalleryPicName + "'></a><ul class='article-info'><li class='article-type'><i class='fa fa-camera'></i>";

                    newsTabBarString += "</li></ul></div><div class='article-body article-body-top'>" +
                                        "<p class='sub-title-news sub-title' style='font-size: 9px;'>" + galleryTbl[i].GalleryPicTitle + "</p>" +
                                        "<h4 class='farsi-font farsi-position article-title'><a>" + galleryTbl[i].GalleryPicTitle + "</a></h4>" +
                                        "<p>" + galleryTbl[i].GalleryPicDetail + "</p>" +
                                        "<ul class='article-meta'><li><i class='fa fa-clock-o'></i>" + galleryTbl[i].GalleryInsertDate + "</li>" +
                                        //"<li><i class='fa fa-comments'></i>" + galleryTbl[i].incReview + "</li>" +
                                        "</ul></div></article></div>";
                }
            }
            else
            {
                for (int i = 0; i < 5; i++)
                {
                    newsTabBarString += "<div class='col-md-3 col-sm-6'><article class='article'><div class='article2-img'>" +
                                        "<a><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt='" + galleryTbl[i].GalleryPicName + "'></a>" +
                                        "<ul class='article-info'><li class='article-type'><i class='fa fa-camera'></i></li></ul></div><div class='article-body article-body-top'>" +
                                        "<p class='sub-title-news sub-title' style='font-size: 9px;'>" + galleryTbl[i].GalleryPicTitle + "</p>" +
                                        "<h4 class='farsi-font farsi-position article-title'><a>" + galleryTbl[i].GalleryPicTitle + "</a></h4>" +
                                        "<p>" + galleryTbl[i].GalleryPicDetail + "</p>" +
                                        "<ul class='article-meta'><li><i class='fa fa-clock-o'></i>" + galleryTbl[i].GalleryInsertDate + "</li>" +
                                        //"<li><i class='fa fa-comments'></i>" + galleryTbl[i].incReview + "</li>" +
                                        "</ul></div></article></div>";
                }
            }
            newsTabBarString += "</div></div>";
        }
        tabNewsDetailsHtml.InnerHtml = newsTabBarString;
        #endregion
    }