Beispiel #1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            areaDeliveryFacade = new AreaDeliveryFacade(this);
            commonFacade       = new CommonDataFacade(this);
            queryFilterVM      = new AreaDeliveryQueryFilterVM();
            this.gridSearchCondition.DataContext = queryFilterVM;

            areaDeliveryFacade.QueryWHAreaList((s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                args.Result.Insert(0, new Service.Common.Restful.ResponseMsg.AreaDelidayResponse()
                {
                    WHArea = null, City = ResAreaDelivery.ComboBox_PleaseSelect
                });
                comCity.ItemsSource   = args.Result;
                comCity.SelectedIndex = 0;
            });
        }
        void UCAddPayType_Loaded(object sender, RoutedEventArgs e)
        {
            facade = new AreaDeliveryFacade(CPApplication.Current.CurrentPage);
            //加载Combox数据
            facade.QueryWHAreaList((s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                comWHArea.ItemsSource = args.Result;
                //新增时,默认为"null"选项
                if (!_sysNo.HasValue)
                {
                    comWHArea.SelectedIndex = comWHArea.Items.Count - 1;
                }
            });

            if (_sysNo.HasValue)
            {
                facade.GetAreaDeliveryInfoByID(_sysNo, (obj, args) =>
                {
                    VM        = args.Result;
                    VM.IsEdit = true;
                    LayoutRoot.DataContext = VM;
                });
            }
            else
            {
                VM = new AreaDeliveryInfoVM()
                {
                    IsEdit = false
                };
                LayoutRoot.DataContext = VM;
            }
        }