Example #1
0
        public SOReceiveInfoDetail(SOReceiverInfoVM soReceiverInfoVM)
        {
            InitializeComponent();

            soReceiverInfoVM.IsDefault        = false;
            gbSOReceiveInfoDetail.DataContext = soReceiverInfoVM;
            #region 加载收货地址列表
            new OtherDomainQueryFacade().QueryCustomerShippingAddress(soReceiverInfoVM.CustomerSysNo.Value, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                if (args.Result != null)
                {
                    var list = args.Result.Convert <ShippingAddressInfo, SOReceiverInfoVM>();
                    if (list.Count > 0)
                    {
                        cmbSelectReceiveAddressBreif.ItemsSource   = list;
                        cmbSelectReceiveAddressBreif.SelectedIndex = 0;
                    }
                }
            });
            #endregion
        }
Example #2
0
        private void btnSOReveice_Confirm_Click(object sender, RoutedEventArgs e)
        {
            SOReceiverInfoVM model = gbSOReceiveInfoDetail.DataContext as SOReceiverInfoVM;

            if (model != null)
            {
                //更新地址
                new OtherDomainQueryFacade().UpdateCustomerShippingAddress(model.ConvertVM <SOReceiverInfoVM, ShippingAddressInfo>()
                                                                           , (obj, args) => {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    //由父窗口执行数据加载操作
                    CloseDialog(new ResultEventArgs
                    {
                        DialogResult = DialogResultType.OK,
                        Data         = model
                    });
                });
            }
        }