예제 #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);
        }
예제 #2
0
        public HttpResponseBase ParentListQuery()
        {
            string json = string.Empty;
            try
            {
                if (!string.IsNullOrEmpty(Request.Form["ProductId"]))
                {
                    uint product_id = uint.Parse(Request.Form["ProductId"]);
                    IProductComboImplMgr _comboMgr = new ProductComboMgr(connectionString);
                    string parent_list = _comboMgr.GetParentList(Convert.ToInt32(product_id));
                    json = "{success:true,data:" + JsonConvert.SerializeObject(parent_list) + "}";
                }
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "[]";
            }

            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }