Ejemplo n.º 1
0
		protected void BindImages()
		{
			BPImages bpu = new BPImages();
			DSImages = new BEImages();

			if (FilterID != -1 && FilterID != 0)
			{
                DSImages.Merge(bpu.SelectActiveByImageCategoryID(FilterID));
			}
			else
			{
                DSImages.Merge(bpu.SelectActiveNonGalleryWithImageCategories());
			}

			int ImageCategoryID = -1;
			Boolean blnNew = true;

			StringBuilder returnImages = new StringBuilder(10000);
			 
			returnImages.Append("none,No Image|");

			foreach(DataRow dr in DSImages.tbl_Images.Rows)
			{
				if ((int) dr["ImageCategoryID"] != ImageCategoryID)
				{
					ImageCategoryID = (int) dr["ImageCategoryID"];
					blnNew = true;
				}

				if (blnNew)
				{
					returnImages.Append(",-- " + dr["ImageCategoryName"] + " --|");
					blnNew = false;
				}
				
				returnImages.Append(dr["ImageID"].ToString() + "," + HttpUtility.HtmlDecode("    ") + dr["ImageAlias"].ToString() + "|");
			}

			lblScript.Text = "<script Language=\"Javascript\">window.parent.handleResponse('" + returnImages + "', 'Image')</script>";
		}
Ejemplo n.º 2
0
		protected void BindImages()
		{
			BPImages bpu = new BPImages();
			DSImages = new BEImages();

			if (ddlImageCategories.SelectedValue != "-1")
			{
                DSImages.Merge(bpu.SelectActiveByImageCategoryID(Convert.ToInt32(ddlImageCategories.SelectedValue)));
			}
			else
			{
                DSImages.Merge(bpu.SelectActiveNonGalleryWithImageCategories());
			}

			int ImageCategoryID = -1;
			Boolean blnNew = true;

			ddlImages.Items.Clear();

			ddlImages.Items.Add(new ListItem("No Image", "0"));
			foreach(DataRow dr in DSImages.tbl_Images.Rows)
			{
				if ((int) dr["ImageCategoryID"] != ImageCategoryID)
				{
					ImageCategoryID = (int) dr["ImageCategoryID"];
					blnNew = true;
				}

				if (blnNew)
				{
					ddlImages.Items.Add(new ListItem("-- " + dr["ImageCategoryName"] + " --", ""));
					blnNew = false;
				}
				
				ddlImages.Items.Add(new ListItem(HttpUtility.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;") + dr["ImageAlias"], dr["ImageID"].ToString()));
			}

			if (SelectedImage != 0)
				ddlImages.SelectedValue = SelectedImage.ToString();
		}