示例#1
0
		public BEImageCategories SelectAllInactive()
		{
			BEImageCategories ds = new BEImageCategories();
			DAImageCategories da = new DAImageCategories();
			da.SelectAllInactive(ds.tbl_ImageCategories);
			return ds;
		}
		protected void BindImageCategoriesList()
		{
			BPImageCategories bpcat = new BPImageCategories();
			DSImageCategories = bpcat.SelectAll();
			//DSImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryOrder";
			DSImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";
			dgImageCategories.DataBind();
		}
示例#3
0
		public BEImageCategories UpdateByImageCategoryID(int ImageCatgeoryID)
		{
			BEImageCategories ds = new BEImageCategories();
			DAImageCategories da = new DAImageCategories();

			da.UpdateByImageCategoryID(ImageCatgeoryID, ds.tbl_ImageCategories);
			return ds;
		}
示例#4
0
		public BEImageCategories SelectImageCategoryByID(int ImageCatgeoryID)
		{
			BEImageCategories ds = new BEImageCategories();
			DAImageCategories da = new DAImageCategories();

			da.SelectByID(ImageCatgeoryID.ToString(), ds.tbl_ImageCategories);
			return ds;
		}
示例#5
0
		protected void BindImageCategories()
		{
			BPImageCategories bp = new BPImageCategories();
			DSImageCategories = bp.SelectAllActive();
			DSImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";
			ddlImageCategories.DataBind();

			ddlImageCategories.Items.Insert(0, new ListItem("(All Categories)", "-1"));
			ddlImageCategories.Items.Insert(1, new ListItem("Not Assigned", "0"));
		}
		private void btnDelete_Click(object sender, EventArgs e)
		{
			BPImageCategories bp = new BPImageCategories();
			BEImageCategories.tbl_ImageCategoriesRow ImageCategory;
			
			DSImageCategories = bp.SelectImageCategoryByID(ImageCategoryID);
			ImageCategory = DSImageCategories.tbl_ImageCategories.FindByImageCategoryID(ImageCategoryID);

			ImageCategory.Delete();
			bp.Update(DSImageCategories);

			bp.UpdateByImageCategoryID(ImageCategoryID);

			Response.Redirect("BrowseImageCategories.aspx");
		}
		private void btnSubmit_ServerClick(object sender, EventArgs e)
		{
			BPImageCategories bp = new BPImageCategories();
			BEImageCategories.tbl_ImageCategoriesRow category;
			DSImageCategories = new BEImageCategories();

			//if they are making this category inactive make all items below this category unassigned and inactive
			if (ImageCategoryID > 0)
			{
				bool wasActive = GetImageCategoryActiveStatus(ImageCategoryID);

				if ((wasActive) && (! chkImageCategoryActive.Checked))
				{
					bp.UpdateByImageCategoryID(ImageCategoryID);
				}
			}

			if (ImageCategoryID == 0)
			{
				// Add a Image Category
				category = DSImageCategories.tbl_ImageCategories.Newtbl_ImageCategoriesRow();
			}
			else
			{
				// Edit a Image Category
				DSImageCategories = bp.SelectImageCategoryByID(ImageCategoryID);
				category = DSImageCategories.tbl_ImageCategories.FindByImageCategoryID(ImageCategoryID);				
			}
			//all content to be updated/inserted between here
			category.ImageCategoryName = txtImageCategoryName.Text;
			category.ImageCategoryDescription = txtImageCategoryDescription.Text;
			category.ImageCategoryActive = chkImageCategoryActive.Checked;

			category.DateModified = DateTime.Now;
			category.ModifiedByAdminID = Convert.ToInt32(OryxUser.OryxIdentity.MemberID);
			//all content to be updated/inserted between here			
			if (ImageCategoryID == 0)
			{
				//Add new Image Category
				category.ImageCategoryOrder = bp.GetImageCategoryMaxOrder();
				category.DateCreated = DateTime.Now;

				DSImageCategories.tbl_ImageCategories.Addtbl_ImageCategoriesRow(category);
			}

			bp.Update(DSImageCategories);

			Response.Redirect("BrowseImageCategories.aspx");
		}
		protected bool GetImageCategoryActiveStatus(int ImageCategoryID)
		{
			BPImageCategories bp = new BPImageCategories();
			DSImageCategories = bp.SelectImageCategoryByID(ImageCategoryID);
			BEImageCategories.tbl_ImageCategoriesRow category = DSImageCategories.tbl_ImageCategories[0];
			category = DSImageCategories.tbl_ImageCategories[0];
			return category.ImageCategoryActive;
		}
示例#9
0
		public void Update(BEImageCategories ds)
		{
			DAImageCategories da = new DAImageCategories();
			da.Update(ds.tbl_ImageCategories);
		}