Beispiel #1
0
        private void GetImages()
        {
            int brand_id = Convert.ToInt32(Request.QueryString["id"]);;

            //Getting Images Based on This Brand ID
            List <Gallery> images = GalleryDAL.GetImages(brand_id);

            if (images.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Gallery image in images)
                {
                    sb.Append(string.Format(@"
                    <a class='group' rel='gallery' href='../images/gallery/{2}' title='{0}'>
                        <div class='image'>
                            <img src = '../images/gallery/{2}' runat='server' alt='Gallery Image Here' title='{3}' height='300px' />
                        </div>
                    </a>     

                    ", image.image_id, image.brand_id, image.image_name, image.image_title));
                    lblGallery.Text = sb.ToString();
                }
            }
            else
            {
                lblGallery.Text = "No Image Added";
            }
        }
Beispiel #2
0
        private void GetImages()
        {
            int brand_id = 0;
            //To Get Brand ID
            string            email       = Session["login"].ToString();
            List <brandClass> brandDetail = brandDAL.GetBrandDetailsByEmail(email);

            if (brandDetail.Count == 1)
            {
                foreach (brandClass brand in brandDetail)
                {
                    brand_id = brand.brand_id;
                }
            }
            //Getting Images Based on This Brand ID
            List <Gallery> images = GalleryDAL.GetImages(brand_id);

            if (images.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Gallery image in images)
                {
                    sb.Append(string.Format(@"
                    <a class='group' rel='gallery' href='../images/gallery/{2}' title='{0}'>
                        <div class='image'>
                            <img src = '../images/gallery/{2}' runat='server' alt='Gallery Image Here' title='{3}' height='300px' />
                        </div>
                    </a>     

                    ", image.image_id, image.brand_id, image.image_name, image.image_title));
                    lblGallery.Text = sb.ToString();
                }
            }
            else
            {
                lblGallery.Text = "No Image Added";
            }
        }