예제 #1
0
 void UCAddPayType_Loaded(object sender, RoutedEventArgs e)
 {
     facade = new PayTypeFacade(CPApplication.Current.CurrentPage);
     if (_sysNo.HasValue)
     {
         facade.LoadPayType(_sysNo, (obj, args) =>
         {
             VM        = args.Result;
             VM.IsEdit = true;
             LayoutRoot.DataContext = VM;
             if (VM.IsNetEnum == SYNStatus.Yes)
             {
                 VM.IsNetPay = true;
             }
             comIsNet.SelectionChanged += new SelectionChangedEventHandler(comIsNet_SelectionChanged);
         });
     }
     else
     {
         VM = new PayTypeVM()
         {
             IsEdit = false, IsNetEnum = SYNStatus.No
         };
         LayoutRoot.DataContext         = VM;
         comIsPayWhenRecv.SelectedIndex = 0;
         comIsOnlineShow.SelectedIndex  = 0;
     }
 }
예제 #2
0
        private void LoadListBoxData()
        {
            PayTypeFacade             commonDataFacade = new PayTypeFacade(this);
            OrderCheckItemQueryFilter queryFilter      = new OrderCheckItemQueryFilter();

            queryFilter.PagingInfo = new PagingInfo
            {
                PageSize  = int.MaxValue,
                PageIndex = 0,
                SortBy    = ""
            };
            queryFilter.ReferenceType = "PT";

            OrderCheckItemFacade facade = new OrderCheckItemFacade(this);

            facade.QueryOrderCheckItem(queryFilter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                rightList = DynamicConverter <OrderCheckItemVM> .ConvertToVMList(args.Result.Rows);
                ListBox_SelectedPayTypeList.ItemsSource = rightList;

                commonDataFacade.GetPayTypeList((obj2, args2) =>
                {
                    leftList = args2.Result;
                    if (rightList != null && leftList != null)
                    {
                        foreach (OrderCheckItemVM p in rightList)
                        {
                            leftList.Remove(leftList.Where(x => x.SysNo.ToString() == p.ReferenceContent).FirstOrDefault());
                        }
                    }
                    ListBox_PayTypeList.ItemsSource = leftList;
                });
            });
        }