Ejemplo n.º 1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            facade                   = new SearchedKeywordsQueryFacade(this);
            model                    = new SearchedKeywordsQueryVM();
            filter                   = new SearchedKeywordsFilter();
            model.CompanyCode        = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode;
            model.ChannelID          = "1";
            QuerySection.DataContext = model;

            facade.LoadEditUsers(Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                List <UserInfo> list = args.Result;
                UserInfo user        = new UserInfo();
                user.UserName        = "******";
                list.Add(user);
                this.comEditUserList.ItemsSource = list;
            });

            comCreateUserType.ItemsSource = EnumConverter.GetKeyValuePairs <KeywordsOperateUserType>(EnumConverter.EnumAppendItemType.All);
            cbShowStatus.ItemsSource      = new List <KeyValuePair <ADStatus?, string> >()
            {
                new KeyValuePair <ADStatus?, string>(null, "--所有--"),
                new KeyValuePair <ADStatus?, string>(ADStatus.Active, "展示"),
                new KeyValuePair <ADStatus?, string>(ADStatus.Deactive, "屏蔽"),
            };


            //CodeNamePairHelper.GetList("MKT", "CreateUserType", (s, args) =>
            //{
            //    if (args.FaultsHandle()) return;
            //    this.CreateUserType.ItemsSource = args.Result;
            //    this.CreateUserType.SelectedIndex = 0;
            //});
            //Newegg.Oversea.Silverlight.Controls.Data.DataGridTextColumn status = QueryResultGrid.Columns[3] as Newegg.Oversea.Silverlight.Controls.Data.DataGridTextColumn;
            //status.Binding.ConverterParameter = typeof(ADStatus);
            btnVoidItem.IsEnabled   = false;
            btnDeleteItem.IsEnabled = false;
            base.OnPageLoad(sender, e);
        }
Ejemplo n.º 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;
            }
        }