/// <summary>
        /// 刪除組合商品的父商品和子商品價格數據
        /// </summary>
        /// <param name="delTemp"></param>
        /// <returns></returns>
        public bool comboPriceDeleteByVendor(ProductComboTemp delTemp)
        {
            ArrayList sqls = new ArrayList();
            try
            {
                //刪除item_price_temp子商品的數據中的數據
                ItemPriceTempMgr itemPriceMgr = new ItemPriceTempMgr("");
                sqls.Add(itemPriceMgr.DeleteByVendor(delTemp.Parent_Id, delTemp.Combo_Type, delTemp.Writer_Id));

                //刪除price_master_temp中的數據
                PriceMasterTempMgr priceMasterTempMgr = new PriceMasterTempMgr("");
                sqls.Add(priceMasterTempMgr.DeleteByVendor(new PriceMasterTemp { writer_Id = delTemp.Writer_Id, product_id = delTemp.Parent_Id, combo_type = delTemp.Combo_Type }));

                return _mySql.ExcuteSqls(sqls);
            }
            catch (Exception ex)
            {
                throw new Exception("ProductComboTempMgr.comboPriceDeleteByVendor-->" + ex.Message + sqls.ToString(), ex);
            }
        }
Exemple #2
0
        /// <summary>
        /// 刪除供應商商品數據
        /// </summary>
        /// <returns></returns>
        public bool DeleteVendorProductTemp(int writerId, int combo_type, string product_Id)
        {
            try
            {
                ArrayList sqls = new ArrayList();
                sqls.Add(DeleteProductTemp(new ProductTemp { Writer_Id = writerId, Combo_Type = combo_type, Product_Id = product_Id }));

                ProductItemTempMgr proItemTempMgr = new ProductItemTempMgr("");
                sqls.Add(proItemTempMgr.DeleteVendorSql(new ProductItemTemp { Writer_Id = writerId, Product_Id = product_Id }));

                ProductNoticeSetTempMgr proNoticeSetTempMgr = new ProductNoticeSetTempMgr("");
                sqls.Add(proNoticeSetTempMgr.DeleteVendor(new ProductNoticeSetTemp { Writer_Id = writerId, Combo_Type = combo_type, product_id = product_Id }));

                ProductTagSetTempMgr proTagSetTempMgr = new ProductTagSetTempMgr("");
                sqls.Add(proTagSetTempMgr.DeleteVendor(new ProductTagSetTemp { Writer_Id = writerId, Combo_Type = combo_type, product_id = product_Id }));

                ProductSpecTempMgr proSpecTempMgr = new ProductSpecTempMgr("");
                sqls.Add(proSpecTempMgr.TempDeleteByVendor(new ProductSpecTemp { Writer_Id = writerId, product_id = product_Id }));

                ProductPictureTempImplMgr proPicTempMgr = new ProductPictureTempImplMgr("");
                sqls.Add(proPicTempMgr.DeleteByVendor(new ProductPictureTemp { writer_Id = writerId, combo_type = combo_type, product_id = product_Id }));

                ProductCategorySetTempMgr proCateSetTempMgr = new ProductCategorySetTempMgr("");
                sqls.Add(proCateSetTempMgr.TempDeleteByVendor(new ProductCategorySetTemp { Writer_Id = writerId, Combo_Type = combo_type, Product_Id = product_Id }));

                ItemPriceTempMgr itemPriceMgr = new ItemPriceTempMgr("");
                sqls.Add(itemPriceMgr.DeleteByVendor(product_Id.ToString(), combo_type, writerId));

                PriceMasterTempMgr priceMasterTempMgr = new PriceMasterTempMgr("");
                sqls.Add(priceMasterTempMgr.DeleteByVendor(new PriceMasterTemp { writer_Id = writerId, product_id = product_Id, combo_type = combo_type }));

                ProductComboTempMgr proComboTempMgr = new ProductComboTempMgr("");
                sqls.Add(proComboTempMgr.TempDeleteByVendor(new ProductComboTemp { Writer_Id = writerId, Parent_Id = product_Id }));

                MySqlDao mySqlDao = new MySqlDao(connStr);
                return mySqlDao.ExcuteSqls(sqls);
            }
            catch (Exception ex)
            {
                throw new Exception("ProductTempMg.DeleteTemp-->" + ex.Message, ex);
            }
        }