/// <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);
                });
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除或添加产品页面关键字
        /// </summary>
        /// <param name="rsp"></param>
        /// <param name="callback"></param>
        public void BatchUpdateProductPageKeywords(ProductPageKeywordsRsp rsp, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/BatchUpdateProductPageKeywords";

            restClient.Update(relativeUrl, rsp, callback);
        }