Beispiel #1
0
        /// <summary>
        /// 买跌检测[买跌单]
        /// 定单类型为买跌时有效
        /// </summary>
        /// <param name="selData"></param>
        public void RecordRealWeight(MarketOrderData selData)
        {
            RecordRealWeightWindow window = new RecordRealWeightWindow()
            {
                Owner       = Application.Current.MainWindow,
                DataContext = this,
            };

            if (window.ShowDialog() == true)
            {
                if (selData.TotalWeight < window.RealWeight)
                {
                    MessageBox.Show("您输入的重量大于您的库存", "提示信息", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    ErrType err = _businessService.RecordRealWeight(selData.OrderID, window.RealWeight, _loginID, (int)_accType);
                    if (err.Err == ERR.SUCCESS)
                    {
                        selData.AllowStore = true;
                        MessageBox.Show("您可以入库了", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    else
                    {
                        MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
        }
Beispiel #2
0
        //买跌检测
        private void CommandBinding_Executed_RecordRealWeight(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            ManagementViewModel vm            = DataContext as ManagementViewModel;
            MarketOrderData     selectedOrder = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;

            vm.RecordRealWeight(selectedOrder);
        }
Beispiel #3
0
 private void AddBidQuantity(PlaceOrderData item, MarketOrderData marketData)
 {
     if (item.ClientId == ClientId)
     {
         marketData.MyBidQuantity = marketData.MyBidQuantity + item.Quantity;
     }
     marketData.MrktBidQuantity = marketData.MrktBidQuantity + item.Quantity;
 }
Beispiel #4
0
        private void CommandBinding_CanExecute_RecordRealWeight(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ManagementViewModel vm            = DataContext as ManagementViewModel;
            MarketOrderData     selectedOrder = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;

            e.CanExecute = true;
            //权限处理e.CanExecute = vm.AccountAuthority.CheckManage&&(selectedOrder.OrderType==TRANSACTION_TYPE.Recovery);
        }
Beispiel #5
0
        /// <summary>
        /// 历史订单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommandBinding_Executed_HistoryOrder(object sender, ExecutedRoutedEventArgs e)
        {
            MarketOrderData data      = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;
            OrderInfoWindow orderInfo = new OrderInfoWindow(data.TradeAccount);

            orderInfo.DataContext = this.DataContext;
            orderInfo.ShowDialog();
        }
Beispiel #6
0
        /// <summary>
        /// 为定单改变信息赋值
        /// </summary>
        private void AssignmentOrderChangedInfo( )
        {
            MarketOrderData selectedItem = DataContext as MarketOrderData;

            _orderChangedInfo.AllowMaxPriceDeviation = (CbDeviation.IsChecked == true ? AllowMaxPriceDiff : 0.0);
            //_orderChangedInfo.Count = DudCount.Value.HasValue ? DudCount.Value.Value : 0.0;
            _orderChangedInfo.OrderID       = selectedItem.OrderID;
            _orderChangedInfo.RealTimePrice = selectedItem.RealTimePrice;
            _orderChangedInfo.RealTimeTime  = selectedItem.OwnedProduct.RealTimeTime;
            _orderChangedInfo.TradeAccount  = selectedItem.TradeAccount;
        }
Beispiel #7
0
        private void CommandBinding_CanExecute_Warehousing(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ManagementViewModel vm = DataContext as ManagementViewModel;
            //e.CanExecute = vm.AccountAuthority.AllowWarehousingOrder;
            MarketOrderData selectedOrder = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;

            if (selectedOrder.AllowStore)
            {
                e.CanExecute = true;
            }
            //权限处理 e.CanExecute = vm.AccountAuthority.AllowWarehousingOrder;
            else
            {
                e.CanExecute = false;
            }
        }
Beispiel #8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            MarketOrderData data = this.DataContext as MarketOrderData;

            _orderChangedInfo.Count = data.OrderQuantity;
            Binding b = new Binding();

            b.Path   = new PropertyPath("Count");
            b.Source = _orderChangedInfo;
            b.Mode   = BindingMode.TwoWay;
            b.UpdateSourceTrigger     = UpdateSourceTrigger.PropertyChanged;
            b.NotifyOnValidationError = true;


            ValidationRule rule = new DoubleExactDivisionRule()
            {
                Dividend = data.Orderunit, MinValue = data.Orderunit, MaxValue = data.OrderQuantity
            };

            b.ValidationRules.Add(rule);
            this.DudCount.SetBinding(DoubleUpDown.ValueProperty, b);
        }