コード例 #1
0
		private void btnDeleteProductAttribute_Click(object sender, EventArgs e)
		{
			BEProducts.tbl_ProductAttributesRow attribute;
			BPProducts bp = new BPProducts();
			BEProducts DSProducts = bp.SelectProductAttributesByProductID(ProductID);
			attribute = DSProducts.tbl_ProductAttributes.FindByProductAttributeID(ProductAttributeID);
			attribute.Delete();
			bp.UpdateProductAttributes(DSProducts);
			ViewProductAttributes();
		}
コード例 #2
0
		private void ViewProductAttributes()
		{
			BPProducts bp = new BPProducts();
			DSProducts = bp.SelectProductAttributesByProductID(ProductID);
			dgProductAttributes.DataBind();
			dgProductAttributes.SelectedIndex = -1;

			tabViewProductAttributes.Attributes["class"] = "current";
			tabAddProductAttributes.Attributes["class"] = "";

			pnlAddProductAttributes.Visible = false;
			pnlViewProductAttributes.Visible = true;
		}
コード例 #3
0
		private void SaveProductAttributes()
		{
			BEProducts.tbl_ProductAttributesRow attribute;
			BPProducts bp = new BPProducts();
			BEProducts DSProducts = bp.SelectProductAttributesByProductID(ProductID);
			if (ProductAttributeID == 0)
			{
				attribute = DSProducts.tbl_ProductAttributes.Newtbl_ProductAttributesRow();
				attribute.DateCreated = DateTime.Now;
			}
			else
			{
				attribute = DSProducts.tbl_ProductAttributes.FindByProductAttributeID(ProductAttributeID);
			}
			attribute.ProductAttributeName = txtProductAttributeName.Text;
			attribute.ProductAttributeImageID = ddlProductAttributeImage.SelectedImage;
			attribute.ProductID = ProductID;
			attribute.ProductAttributeActive = chkProductAttributeActive.Checked;
			attribute.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
			attribute.DateModified = DateTime.Now;
			if (ProductAttributeID == 0)
			{
				DSProducts.tbl_ProductAttributes.Rows.Add(attribute);
			}
			bp.UpdateProductAttributes(DSProducts);	

			if (!attribute.IsProductAttributeImageIDNull())
			{
				MWUtility.CreateResizedImage(attribute.ProductAttributeImageID, "att", "", AttributeImageSize, 0, this);
			}
			ViewProductAttributes();
		}
コード例 #4
0
		private void AddProductAttributes()
		{
			if (ProductAttributeID != 0)
			{
				BPProducts bp = new BPProducts();
				BEProducts.tbl_ProductAttributesRow row = bp.SelectProductAttributesByProductID(ProductID).tbl_ProductAttributes.FindByProductAttributeID(ProductAttributeID);
				txtProductAttributeName.Text = row.ProductAttributeName;
				ddlProductAttributeImage.SelectedImage = row.ProductAttributeImageID;
				chkProductAttributeActive.Checked = row.ProductAttributeActive;
				btnDeleteProductAttribute.Visible = true;
			}
			else
			{
				txtProductAttributeName.Text = "";
				ddlProductAttributeImage.SelectedImage = -1;
				chkProductAttributeActive.Checked = false;
				btnDeleteProductAttribute.Visible = false;
			}
			tabAddProductAttributes.Attributes["class"] = "current";
			tabViewProductAttributes.Attributes["class"] = "";

			pnlViewProductAttributes.Visible = false;
			pnlAddProductAttributes.Visible = true;
		}