Example #1
0
        /// <summary>
        /// 刪除商品
        /// </summary>
        /// <returns></returns>
        public bool Delete(uint product_Id)
        {
            ArrayList delList = new ArrayList();
            ProductComboMgr proComboMgr = new ProductComboMgr("");
            delList.Add(proComboMgr.Delete(Convert.ToInt32(product_Id)));

            ItemPriceMgr itemPriceMgr = new ItemPriceMgr("");
            delList.Add(itemPriceMgr.DeleteByProductId(Convert.ToInt32(product_Id)));

            PriceMasterMgr priceMaster = new PriceMasterMgr("");
            delList.Add(priceMaster.DeleteByProductId(Convert.ToInt32(product_Id)));

            ProductTagSetMgr proTagSetMgr = new ProductTagSetMgr("");
            delList.Add(proTagSetMgr.Delete(new ProductTagSet { product_id = product_Id }));

            ProductNoticeSetMgr proNoticeSetMgr = new ProductNoticeSetMgr("");
            delList.Add(proNoticeSetMgr.Delete(new ProductNoticeSet { product_id = product_Id }));

            ProductPictureMgr proPicMgr = new ProductPictureMgr("");
            delList.Add(proPicMgr.Delete(Convert.ToInt32(product_Id)));

            ProductSpecMgr proSpecMgr = new ProductSpecMgr("");
            delList.Add(proSpecMgr.Delete(product_Id));

            ProductCategorySetMgr proCategorySetMgr = new ProductCategorySetMgr("");
            delList.Add(proCategorySetMgr.Delete(new ProductCategorySet { Product_Id = product_Id }));

            #region 課程相關
            CourseProductMgr courProdMgr = new CourseProductMgr("");
            delList.Add(courProdMgr.Delete(product_Id));

            CourseDetailItemMgr courDetaItemMgr = new CourseDetailItemMgr("");
            delList.Add(courDetaItemMgr.Delete(product_Id));
            #endregion

            ProductItemMgr proItemMgr = new ProductItemMgr("");
            delList.Add(proItemMgr.Delete(new ProductItem { Product_Id = product_Id }));

            ProductStatusHistoryMgr proStatusHistoryMgr = new ProductStatusHistoryMgr("");
            delList.Add(proStatusHistoryMgr.Delete(new ProductStatusHistory { product_id = product_Id }));

            #region 推薦商品刪除  add by zhuoqin0830w  2015/10/08
            RecommendedProductAttributeMgr recommendedProductAttributeMgr = new RecommendedProductAttributeMgr("");
            delList.Add(recommendedProductAttributeMgr.DeleteProductAttribute(Convert.ToInt32(product_Id)));
            #endregion

            delList.Add(_productDao.Delete(product_Id));

            MySqlDao mySqlDao = new MySqlDao(connectionStr);
            return mySqlDao.ExcuteSqls(delList);
        }