예제 #1
0
		private void SaveRelatedProducts()
		{
			ArrayList _NewRelatedProductIDs = SelectedProductsList;

			BEProducts.tbl_RelatedProductsRow relatedProduct;
			BPProducts bp = new BPProducts();
			BEProducts DSProducts = new BEProducts();
			bp.DeleteRelatedProductsByProductID(ProductID);

			foreach (object tmpProdID in _NewRelatedProductIDs)
			{
				relatedProduct = DSProducts.tbl_RelatedProducts.Newtbl_RelatedProductsRow();
				relatedProduct.ProductID = ProductID;
				relatedProduct.RelatedProductID = Convert.ToInt32(tmpProdID);
				relatedProduct.DateCreated = DateTime.Now;
				relatedProduct.DateModified = DateTime.Now;
				relatedProduct.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
				DSProducts.tbl_RelatedProducts.Addtbl_RelatedProductsRow(relatedProduct);
			}

			bp.UpdateRelatedProducts(DSProducts);
			ViewRelatedProducts();
		}