Beispiel #1
0
		protected void BindImages()
		{
			BPImages bpu = new BPImages();
			DSImages = new BEImages();

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

			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>";
		}
Beispiel #2
0
		private void BindDSImages()
		{
			BPImages bp = new BPImages();
			if (ddlImageCategories.SelectedValue == "-1")
			{
				DSImages = bp.SelectAllWithImageCategories();
			}
			else
			{
				DSImages = bp.SelectAllByImageCategoryID(Convert.ToInt32(ddlImageCategories.SelectedValue));
			}
			
			DSImages.tbl_Images.DefaultView.Sort = "ImageAlias";
			DSImages.tbl_Images.DefaultView.RowFilter = RowFilter("ImageAlias", "ImageActive");

			letters_Bind();
			dgDocs.DataBind();

			SetPagerButtons();
			if (DSImages.tbl_Images.DefaultView.Count ==  0)
			{
				lblError.Visible = true;
				lblError.Text = "0 Records found.";
			}

			else
			{
				lblError.Visible = false;
				lblError.Text = "";
			}
		}