Beispiel #1
0
        /// <summary>
        /// Displays products associated with a package
        /// </summary>
        /// <param name="packageID"></param>
        private void GetBindedPackageProducts(int packageID)
        {
            //clear any existing products attached to the package
            if (!Object.Equals(PackageProducts, null))
            {
                PackageProducts.Clear();
            }

            //get the products linked to the package
            foreach (ProductExtended product in ProductExtendedDB.GetPackageProductsById(packageID))
            {
                PackageProducts.Add(product);
            }
        }
        /// <summary>
        /// Displays products associated with a package
        /// </summary>
        /// <param name="packageID"></param>
        private void GetBindedPackageProducts(int packageID)
        {
            //clear any existing products attached to the package
            if (!Object.Equals(PackageProducts, null))
            {
                PackageProducts.Clear();
            }

            try
            {
                //get the products linked to the package
                foreach (ProductExtended product in ProductExtendedDB.GetPackageProductsById(packageID))
                {
                    PackageProducts.Add(product);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Unable to get package products", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }