public override void OnPageLoad(object sender, EventArgs e) { facade = new ProductKeywordsQueryFacade(this); filter = new ProductKeywordsQueryFilter(); model = new ProductKeywordsQueryVM(); model.ChannelID = "1"; model.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; comProductStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All); this.DataContext = model; facade.GetProductKeywordsEditUserList(Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode, (s, args) => { if (args.FaultsHandle()) { return; } List <UserInfo> userList = args.Result; userList.Insert(0, new UserInfo { SysNo = null, UserName = ResCommonEnum.Enum_All }); comEditUser.ItemsSource = userList; }); base.OnPageLoad(sender, e); }
private void UCEditProductKeywords_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCEditProductKeywords_Loaded); facade = new ProductKeywordsQueryFacade(CPApplication.Current.CurrentPage); if (VM != null) { VM.ChannelID = "1"; LayoutRoot.DataContext = VM; } }
public UCSelectCategoryProperty() { InitializeComponent(); this.Loaded += (sender, e) => { model = new SelectCategoryPropertyVM(); facade = new ProductKeywordsQueryFacade(CPApplication.Current.CurrentPage); model.CategoryProperty = (from p in model.CategoryPropertyList where p.PropertySysNo == -1 select p).FirstOrDefault(); //默认绑定请选择 model.PropertyValue = (from p in model.PropertyValueList where p.PropertyValueSysNo == -1 select p).FirstOrDefault(); //默认绑定请选择 this.DataContext = model; }; this.cboProperty.SelectionChanged += (sender, e) => { //获取属性值 if (model.CategoryProperty != null) { if (model.CategoryProperty.PropertySysNo == -1) { model.InputValue = null; txtInput.IsEnabled = false; } else { txtInput.IsEnabled = true; } facade.GetPropertyValueByPropertySysNo(model.CategoryProperty.PropertySysNo, (obj, arg) => { if (arg.FaultsHandle()) { return; } List <PropertyValueVM> tempData = new List <PropertyValueVM>() { new PropertyValueVM() { PropertyValueSysNo = -1, PropertyValueDescription = "--请选择--" } }; foreach (var item in arg.Result.Rows) { tempData.Add(new PropertyValueVM() { PropertyValueSysNo = item.ValueSysNo, PropertyValueDescription = item.ValueDescription }); } model.PropertyValueList = tempData; model.PropertyValue = (from p in model.PropertyValueList where p.PropertyValueSysNo == -1 select p).FirstOrDefault();//默认绑定请选择 }); } }; }
private void UCBatchSetProductPageKeywords_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCBatchSetProductPageKeywords_Loaded); facade = new ProductKeywordsQueryFacade(CPApplication.Current.CurrentPage); ECCentral.Portal.Basic.Utilities.CodeNamePairHelper.GetList("MKT", "KeywordsListForProductPageKeywords", (obj, args) => { if (args.FaultsHandle()) { return; } comKeywordsCategory.ItemsSource = args.Result; comKeywordsCategory.SelectedIndex = 0; }); if (BatchAdd) { btnSaveDelete.Visibility = Visibility.Collapsed; } else { btnSaveAdd.Visibility = Visibility.Collapsed; } }