Beispiel #1
0
        /// <summary>
        ///设定三级类属性关键字  设置属性关键字,送商品类别属性中选择
        /// </summary>
        /// <param name="item"></param>
        public void AddPropertyKeywords(CategoryKeywords item)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("Keyword_CreatePropertyKeywords");

            dc.SetParameterValue <CategoryKeywords>(item);
            dc.ExecuteNonQuery();
        }
Beispiel #2
0
        /// <summary>
        ///更新三级类通用关键字
        /// </summary>
        /// <param name="item"></param>
        public void UpdateCommonKeyWords(CategoryKeywords item)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("Keyword_UpdateCommonKeywords");

            dc.SetParameterValue <CategoryKeywords>(item);
            dc.ExecuteNonQuery();
        }
Beispiel #3
0
        /// <summary>
        ///更新三级类通用关键字
        /// </summary>
        /// <param name="item"></param>
        public virtual void UpdateCommonKeyWords(CategoryKeywords item)
        {
            keywordDA.UpdateCommonKeyWords(item);
            ProductKeywordsQueue queue = new ProductKeywordsQueue();

            queue.C3SysNo      = item.Category3SysNo.Value;
            queue.CompanyCode  = item.CompanyCode;
            queue.ProductSysNo = 0;
            keywordDA.InsertProductKeywordsQueue(queue);
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (gridVM != null)
            {
                StringBuilder str = new StringBuilder();
                gridVM.ForEach(item =>
                {
                    if (item.IsChecked == true)
                    {
                        str.Append(item.SysNo.Value.ToString()).Append(',');
                    }
                });
                if (!string.IsNullOrEmpty(str.ToString()))
                {
                    CategoryKeywords item = EntityConvertorExtensions.ConvertVM <CategoryKeywordsVM, CategoryKeywords>(VM, (v, t) =>
                    {
                        //t.Keywords = new BizEntity.LanguageContent(ConstValue.BizLanguageCode, v.Keywords);
                        t.PropertyKeywords = str.ToString();//.TrimEnd(',');
                    });
                    if (VM.SysNo.HasValue)
                    {
                        facade.UpdatePropertyKeywords(item, (obj, args) =>
                        {
                            if (args.FaultsHandle())
                            {
                                return;
                            }

                            CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_UpdateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                        });
                    }
                    else
                    {
                        item.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
                        facade.AddPropertyKeywords(item, (obj, args) =>
                        {
                            if (args.FaultsHandle())
                            {
                                return;
                            }

                            CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_CreateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                        });
                    }
                }
                else
                {
                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_MoreThanOneRecord, MessageType.Warning);
                }
            }
            else
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_MoreThanOneRecord, MessageType.Information);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 是否存在该类别下的关键字
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool CheckCategoryKeywordsC3SysNo(CategoryKeywords item)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Keyword_CheckKeywordsC3SysNo");

            cmd.SetParameterValue <CategoryKeywords>(item);
            cmd.ExecuteNonQuery();
            if (((int)cmd.GetParameterValue("@SysNo")) == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationManager.Validate(this.LayoutRoot))
            {
                return;
            }
            CategoryKeywords item = EntityConvertorExtensions.ConvertVM <CategoryKeywordsVM, CategoryKeywords>(VM, (v, t) =>
            {
                t.CommonKeywords = new BizEntity.LanguageContent(ECCentral.Portal.Basic.ConstValue.BizLanguageCode, v.CommonKeywords);
            });

            if (VM.SysNo.HasValue)//更新
            {
                facade.UpdateCommonKeyWords(item, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_UpdateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                });
            }
            else
            {
                item.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
                facade.CheckCategoryKeywordsC3SysNo(item, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    if (args.Result)
                    {
                        CPApplication.Current.CurrentPage.Context.Window.Confirm(ResKeywords.Information_BUpdateCommonKeywords, (obj2, args2) =>
                        {
                            if (args2.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK)
                            {
                                facade.AddCommonKeyWords(item, (obj1, args1) =>
                                {
                                    if (args1.FaultsHandle())
                                    {
                                        return;
                                    }

                                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_CreateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                                });
                            }
                        });
                    }
                    else
                    {
                        facade.AddCommonKeyWords(item, (obj1, args1) =>
                        {
                            if (args1.FaultsHandle())
                            {
                                return;
                            }

                            CPApplication.Current.CurrentPage.Context.Window.Alert(ResKeywords.Information_CreateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);
                        });
                    }
                });
            }
        }
Beispiel #7
0
 public virtual bool CheckCategoryKeywordsC3SysNo(CategoryKeywords item)
 {
     return(categoryKeywordsAppService.CheckCategoryKeywordsC3SysNo(item));
 }
 /// <summary>
 ///更新三级类通用关键字
 /// </summary>
 /// <param name="item"></param>
 public virtual void UpdatePropertyKeywords(CategoryKeywords item)
 {
     ObjectFactory <CategoryKeywordsProcessor> .Instance.UpdatePropertyKeywords(item);
 }
 /// <summary>
 /// 是否存在该类别下的关键字
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public virtual bool CheckCategoryKeywordsC3SysNo(CategoryKeywords item)
 {
     return(ObjectFactory <CategoryKeywordsProcessor> .Instance.CheckCategoryKeywordsC3SysNo(item));
 }
        /// <summary>
        ///设置分类关键字的三级类别
        /// </summary>
        /// <param name="item"></param>
        //public virtual void SetC3OfCategoryKeywords(CategoryKeywords item)
        //{
        //    ObjectFactory<CategoryKeywordsProcessor>.Instance.SetC3OfCategoryKeywords(item);
        //}

        ///// <summary>
        ///// 加载分类关键字信息,包括通用关键字和属性关键字列表
        ///// </summary>
        ///// <returns></returns>
        //public virtual CategoryKeywords LoadCategoryKeywords(int sysNo)
        //{
        //    return ObjectFactory<CategoryKeywordsProcessor>.Instance.LoadCategoryKeywords(sysNo);
        //}

        #endregion

        #region  级类通用关键字(CommonKeyWords)
        /// <summary>
        ///设置通用关键字
        /// </summary>
        /// <param name="item"></param>
        public virtual void AddCommonKeyWords(CategoryKeywords item)
        {
            ObjectFactory <CategoryKeywordsProcessor> .Instance.AddCommonKeyWords(item);
        }
Beispiel #11
0
 public Category(IProject project, Guid guid)
     : base(project, guid)
 {
     Keywords = new CategoryKeywords(this);
 }
Beispiel #12
0
 public virtual void UpdatePropertyKeywords(CategoryKeywords item)
 {
     categoryKeywordsAppService.UpdatePropertyKeywords(item);
 }
Beispiel #13
0
 /// <summary>
 /// 是否存在该类别下的关键字
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public virtual bool CheckCategoryKeywordsC3SysNo(CategoryKeywords item)
 {
     return(keywordDA.CheckCategoryKeywordsC3SysNo(item));
 }
        /// <summary>
        /// 更新类通用关键字
        /// </summary>
        /// <param name="item"></param>
        /// <param name="callback"></param>
        public void UpdateCommonKeyWords(CategoryKeywords item, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/UpdateCommonKeyWords";

            restClient.Update(relativeUrl, item, callback);
        }
        /// <summary>
        /// 检查是否存在该通用关键字,是否需要覆盖
        /// </summary>
        /// <param name="item"></param>
        /// <param name="callback"></param>
        public void CheckCategoryKeywordsC3SysNo(CategoryKeywords item, EventHandler <RestClientEventArgs <bool> > callback)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/CheckCategoryKeywordsC3SysNo";

            restClient.Query <bool>(relativeUrl, item, callback);
        }
        /// <summary>
        /// 加载类别属性关键字
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="callback"></param>
        //public void LoadPropertyKeywords(int sysNo, EventHandler<RestClientEventArgs<PropertyKeywords>> callback)
        //{
        //    string relativeUrl = "/MKTService/KeywordsInfo/LoadPropertyKeywords";
        //    restClient.Query<PropertyKeywords>(relativeUrl, sysNo, callback);
        //}

        /// <summary>
        /// 添加类别属性关键字
        /// </summary>
        /// <param name="item"></param>
        /// <param name="callback"></param>
        public void AddPropertyKeywords(CategoryKeywords item, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/MKTService/KeywordsInfo/AddPropertyKeywords";

            restClient.Create(relativeUrl, item, callback);
        }
Beispiel #17
0
 public virtual void UpdateCommonKeyWords(CategoryKeywords item)
 {
     categoryKeywordsAppService.UpdateCommonKeyWords(item);
 }
Beispiel #18
0
 internal Category(IProject project, XmlElement xmlElement)
     : base(project, xmlElement)
 {
     Keywords = new CategoryKeywords(this);
     LoadXml();
 }
Beispiel #19
0
 public virtual void AddPropertyKeywords(CategoryKeywords item)
 {
     categoryKeywordsAppService.AddPropertyKeywords(item);
 }