Example #1
0
        /// <summary>
        /// 编辑自动匹配关键字
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void hlEdit_Click(object sender, RoutedEventArgs e)
        {
            SearchedKeywordsVM    item        = this.QueryResultGrid.SelectedItem as SearchedKeywordsVM;
            UCAddSearchedKeywords usercontrol = new UCAddSearchedKeywords();

            usercontrol.SysNo  = item.SysNo.Value;
            usercontrol.Dialog = Window.ShowDialog(ResKeywords.Title_EditSearchedKeywords, usercontrol, (obj, args) =>
            {
                QueryResultGrid.Bind();
            });
        }
Example #2
0
        private void UCAddSearchedKeywords_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= new RoutedEventHandler(UCAddSearchedKeywords_Loaded);
            facade  = new SearchedKeywordsQueryFacade(CPApplication.Current.CurrentPage);
            cbShowStatus.ItemsSource = new List <KeyValuePair <ADStatus?, string> >()
            {
                new KeyValuePair <ADStatus?, string>(ADStatus.Active, "展示"),
                new KeyValuePair <ADStatus?, string>(ADStatus.Deactive, "屏蔽"),
            };
            comCreateUserType.ItemsSource = EnumConverter.GetKeyValuePairs <KeywordsOperateUserType>();
            if (SysNo > 0)
            {
                isAdd = false;
                tbKeywords.IsEnabled = false;
                facade.LoadSearchedKeywords(SysNo, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }

                    vm                     = args.Result.Convert <SearchedKeywords, SearchedKeywordsVM>();
                    vm.ChannelID           = "1";
                    LayoutRoot.DataContext = vm;
                    lstChannel.IsEnabled   = false;
                });
            }
            else
            {
                vm = new SearchedKeywordsVM();
                vm.CreateUserType = KeywordsOperateUserType.MKTUser;
                vm.Status         = ADStatus.Active;
                vm.ChannelID      = "1";
                //cbShowStatus.SelectedIndex = 1;
                //comCreateUserType.SelectedIndex = 1;
                LayoutRoot.DataContext      = vm;
                comCreateUserType.IsEnabled = true;
            }
        }