/// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSaveAdd_Click(object sender, RoutedEventArgs e)
        {
            //CheckHtml
            if (string.IsNullOrEmpty(tbKeywords.Text))
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_KeywordsIsNotNull, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning);
            }

            else if (StringUtility.CheckHtml(tbKeywords.Text))
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_KeywordsDonotInclude, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning);
            }

            else if (!UtilityHelper.CheckScript(tbKeywords.Text))
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_KeywordsDonotIncludeScript, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning);
            }

            else
            {
                //选择keyword0  或  1

                ProductPageKeywordsRsp rsp = new ProductPageKeywordsRsp();
                rsp.ProductList = productList;
                rsp.BatchAdd    = true;
                if (comKeywordsCategory.SelectedIndex == 0)
                {
                    rsp.ReplKeywords0 = tbKeywords.Text;
                }
                else
                {
                    rsp.ReplKeywords1 = tbKeywords.Text;
                }
                rsp.LanguageCode = ConstValue.BizLanguageCode;
                rsp.CompanyCode  = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
                facade.BatchUpdateProductPageKeywords(rsp, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_SettingSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                });
            }
        }
Esempio n. 2
0
        public virtual void UpdateProductBasicInfo(ProductInfo productInfo, ref ProductManagerInfo productManager)
        {
            #region PreCheck

            if (!productInfo.ProductBasicInfo.ProductCategoryInfo.SysNo.HasValue)
            {
                throw new BizException("请指定该商品三级类别");
            }

            if (productInfo.ProductBasicInfo.ProductManager.SysNo == 0)
            {
                throw new BizException("请指定该商品PM");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductTitle.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductTitle.Content))
            {
                throw new BizException("商品标题不能含有HTML标签/不能含有全角字符");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductBriefTitle.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductBriefTitle.Content))
            {
                throw new BizException("商品简名不能含有HTML标签/不能含有全角字符");
            }

            if (StringUtility.CheckHtml(productInfo.ProductBasicInfo.ProductBriefAddition.Content) || StringUtility.CheckInputType(productInfo.ProductBasicInfo.ProductBriefAddition.Content))
            {
                throw new BizException("商品简名附加不能含有HTML标签/不能含有全角字符");
            }

            if (String.IsNullOrEmpty(productInfo.ProductBasicInfo.ProductBriefTitle.Content) && String.IsNullOrEmpty(productInfo.ProductBasicInfo.ProductBriefAddition.Content))
            {
                throw new BizException("商品简名和商品简名附加不能同时为空");
            }

            #endregion

            using (var tran = new TransactionScope())
            {
                _productProcessor.UpdateProductBasicInfo(productInfo, ref productManager);
                tran.Complete();
            }
        }