Ejemplo n.º 1
0
        void BrandRecommendedResult_LoadingDataSource(object sender, LoadingDataEventArgs e)
        {
            BrandRecommendedFacade facade = new BrandRecommendedFacade();

            facade.GetCategoryRelatedByQuery(model, e.PageSize, e.PageIndex, e.SortField, (obj, arg) =>
            {
                this.BrandRecommendedResult.ItemsSource = arg.Result.Rows;
                this.BrandRecommendedResult.TotalCount  = arg.Result.TotalCount;
            });
        }
Ejemplo n.º 2
0
 void BrandRecommendedMaintain_Loaded(object sender, RoutedEventArgs e)
 {
     facade           = new BrandRecommendedFacade();
     this.DataContext = Brand;
 }
Ejemplo n.º 3
0
        void CategoryList_Loaded(object sender, RoutedEventArgs e)
        {
            list  = new List <CategoryItem>();
            list1 = new List <CategoryItem>();
            list2 = new List <CategoryItem>();

            CodeNamePairHelper.GetList("MKT", "BrandRecommendType", CodeNamePairAppendItemType.None, (s, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                foreach (var item in arg.Result)
                {
                    CategoryItem citem = new CategoryItem()
                    {
                        Key = int.Parse(item.Code), Value = item.Name
                    };
                    list.Add(citem);
                }
                this.cbTopCatrory.ItemsSource       = list;
                this.cbTopCatrory.DisplayMemberPath = "Value";
                this.cbTopCatrory.SelectedValuePath = "Key";
                if (Level_No >= 0)
                {
                    this.cbTopCatrory.SelectedValue = Level_No;
                }
                else
                {
                    this.cbTopCatrory.SelectedIndex = 0;
                }
            });



            //一级类别bind
            list1.Add(new CategoryItem()
            {
                Key = -1, Value = "--所有--"
            });
            facade = new BrandRecommendedFacade();
            facade.GetCategory1List((obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                dynamic viewlist1 = arg.Result.Rows;
                if (viewlist1 != null)
                {
                    foreach (var item in viewlist1)
                    {
                        list1.Add(new CategoryItem()
                        {
                            Key = item.SysNo, Value = item.C1Name, ParentKey = 0
                        });
                    }
                }
                this.cbShow1Catrory.ItemsSource       = list1;
                this.cbShow1Catrory.DisplayMemberPath = "Value";
                this.cbShow1Catrory.SelectedValuePath = "Key";
                this.cbShow1Catrory.SelectedIndex     = 0;

                if (Level_No == 1 && Level_Code > 0)
                {
                    cbShow1Catrory.SelectedValue = Level_Code;
                }
            });
            //二级类别bind
            list2.Add(new CategoryItem()
            {
                Key = -1, Value = "--所有--"
            });
            facade.GetCategory2List((obj, arg) =>
            {
                if (arg.FaultsHandle())
                {
                    return;
                }
                dynamic viewlist2 = arg.Result.Rows;
                if (viewlist2 != null)
                {
                    foreach (var item in viewlist2)
                    {
                        list2.Add(new CategoryItem()
                        {
                            Key = item.SysNo, Value = item.C2Name, ParentKey = item.C1SysNo
                        });
                    }
                }
                this.cbShow2Catrory.ItemsSource       = list2;
                this.cbShow2Catrory.DisplayMemberPath = "Value";
                this.cbShow2Catrory.SelectedValuePath = "Key";
                this.cbShow2Catrory.SelectedIndex     = 0;
                if (Level_No == 2 && Level_Code > 0)
                {
                    cbShow2Catrory.SelectedValue = Level_Code;
                }
            });
        }