コード例 #1
0
        /// <summary>
        /// 更新产品Keywords0
        /// </summary>
        /// <param name="item"></param>
        public void UpdateProductPageKeywords(ProductPageKeywords item)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("ProductKeywords_UpdateProductKeywords");

            dc.SetParameterValue <ProductPageKeywords>(item);
            dc.ExecuteNonQuery();
        }
コード例 #2
0
        /// <summary>
        /// 删除或添加产品页面关键字
        /// </summary>
        /// <param name="productList"></param>
        /// <param name="batchAdd"></param>
        /// <param name="key0"></param>
        /// <param name="key1"></param>
        /// <param name="languageCode"></param>
        /// <param name="companyCode"></param>
        public virtual void BatchUpdateProductPageKeywords(List <string> productList, bool batchAdd, string key0, string key1, string languageCode, string companyCode)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                foreach (string productSysNo in productList)
                {
                    string[] strList = new string[3];
                    //先拆分
                    strList[0] = productSysNo.Split(',')[0].Trim();
                    strList[1] = productSysNo.Split(',')[1].Trim();
                    strList[2] = productSysNo.Split(',')[2].Trim();

                    //判断是更新k1还是k0
                    if (key1 != null)
                    {
                        strList[1] = SetKeywordsvValue(strList[1], batchAdd, key1.Trim());
                        if (String.IsNullOrEmpty(strList[0]) || strList[1].Length > 400)
                        {
                            continue;
                        }
                    }

                    if (key0 != null)
                    {
                        strList[2] = SetKeywordsvValue(strList[2], batchAdd, key0.Trim());


                        if (String.IsNullOrEmpty(strList[0]) || strList[2].Length > 200)
                        {
                            continue;
                        }
                    }
                    ProductPageKeywords keywords = new ProductPageKeywords();
                    keywords.Keywords     = new LanguageContent(languageCode, strList[1].ToString());
                    keywords.Keywords0    = new LanguageContent(languageCode, strList[2].ToString());
                    keywords.ProductSysNo = int.Parse(strList[0].ToString());
                    keywords.CompanyCode  = companyCode;
                    keywordDA.UpdateProductPageKeywords(keywords);
                    ExternalDomainBroker.UpdateProductExKeyKeywords(int.Parse(keywords.ProductSysNo.ToString()), keywords.Keywords.ToString()
                                                                    , keywords.Keywords0.ToString(), ServiceContext.Current.UserSysNo, keywords.CompanyCode);
                }
                scope.Complete();
            }
        }
コード例 #3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ProductPageKeywords item = EntityConvertorExtensions.ConvertVM <ProductKeywordsQueryVM, ProductPageKeywords>(VM, (v, t) =>
            {
                t.Keywords  = new BizEntity.LanguageContent(ECCentral.Portal.Basic.ConstValue.BizLanguageCode, v.Keywords1);
                t.Keywords0 = new BizEntity.LanguageContent(ECCentral.Portal.Basic.ConstValue.BizLanguageCode, v.Keywords0);
                //t.Keywords2 = new BizEntity.LanguageContent(ECCentral.Portal.Basic.ConstValue.BizLanguageCode, v.Keywords2);
            });

            item.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            facade.UpdateProductPageKeywords(item, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_UpdateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
            });
        }
コード例 #4
0
        /// <summary>
        /// 更新产品Keywords0
        /// </summary>
        /// <param name="item"></param>
        public virtual void UpdateProductPageKeywords(ProductPageKeywords item)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                keywordDA.UpdateProductPageKeywords(item);

                /*2012-12-31 update bug95058  jack.g.tang
                 * 修改目的:ProductSysNo可能为null
                 * 解决办法:为null时 根据productId取得ProducuSysNo
                 */
                int?productSysNo = item.ProductSysNo;
                if (item.ProductSysNo == null || item.ProductSysNo == 0)
                {
                    productSysNo = ExternalDomainBroker.GetProductInfo(item.ProductId).SysNo;
                }
                ExternalDomainBroker.UpdateProductExKeyKeywords(
                    (int)productSysNo, item.Keywords.ToString()
                    , item.Keywords0.ToString(), ServiceContext.Current.UserSysNo, item.CompanyCode);
                scope.Complete();
            }
        }
コード例 #5
0
 /// <summary>
 /// 更新产品Keywords0
 /// </summary>
 /// <param name="item"></param>
 public virtual void UpdateProductPageKeywords(ProductPageKeywords item)
 {
     ObjectFactory <ProductPageKeywordsProcessor> .Instance.UpdateProductPageKeywords(item);
 }
コード例 #6
0
 public virtual void UpdateProductPageKeywords(ProductPageKeywords item)
 {
     productPageKeywordsAppService.UpdateProductPageKeywords(item);
 }
コード例 #7
0
        /// <summary>
        /// 添加产品页面关键字
        /// </summary>
        /// <param name="item"></param>
        /// <param name="callback"></param>
        public void AddProductPageKeywords(ProductPageKeywords item, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/AddProductPageKeywords";

            restClient.Create(relativeUrl, item, callback);
        }