private void ChangePriceGrid_Click(object sender, Infragistics.Controls.Grids.CellClickedEventArgs e)
        {
            InstrumentForFloatingPLCalc instrumentForPL = e.Cell.Row.Data as InstrumentForFloatingPLCalc;

            this.InstrumentText.Text = instrumentForPL.InstrumentCode;
            this.BidText.Text        = instrumentForPL.Bid;
            this.SpreadText.Text     = instrumentForPL.SpreadPoint.ToString();
        }
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            if (!this.CheckData())
            {
                return;
            }
            InstrumentForFloatingPLCalc instrumentForPL = this._ChangePriceGrid.ActiveCell.Row.Data as InstrumentForFloatingPLCalc;
            int spreadPoint = int.Parse(this.SpreadText.Text);

            ConsoleClient.Instance.UpdateInstrumentForFloatingPLCalc(this._ExchangCode, instrumentForPL.InstrumentId, this.BidText.Text, spreadPoint, this.UpdateInstrumentForFloatingPLCalcCallback);
        }
        private void SetInstrumentForFloatingPLCalc()
        {
            InstrumentForFloatingPLCalc instrumentForPL = this._ChangePriceGrid.ActiveCell.Row.Data as InstrumentForFloatingPLCalc;

            if (instrumentForPL == null)
            {
                return;
            }

            instrumentForPL.Bid = this.BidText.Text;
            ExchangeSettingManager settingManager = App.MainFrameWindow.ExchangeDataManager.GetExchangeSetting(this._ExchangCode);
            InstrumentClient       instrument     = settingManager.GetInstrument(instrumentForPL.InstrumentId);

            if (instrument == null)
            {
                return;
            }
            int   spread   = int.Parse(this.SpreadText.Text);
            Price bidPrice = new Price(instrumentForPL.Bid, instrument.NumeratorUnit, instrument.Denominator);
            Price askPrice = bidPrice + spread;

            instrumentForPL.Ask         = askPrice.ToString();
            instrumentForPL.SpreadPoint = spread;
        }
Ejemplo n.º 4
0
        public static List<InstrumentForFloatingPLCalc> GetInstrumentForFloatingPLCalc(string exchangeCode,HashSet<Guid> accountIds,HashSet<Guid> instrumentIds)
        {
            string instrumentXmlString = GetInstrumentPermisstionString(instrumentIds);
            string accountXmlString = GetAccountPermisstionString(accountIds);
            List<InstrumentForFloatingPLCalc> instrumentForFloatingPLCalcList = new List<InstrumentForFloatingPLCalc>();
            string sql = string.Format("exec dbo.P_RptGetInstrumentForPLCalcForManager @xmlAccounts='{0}',@xmlInstruments='{1}'", accountXmlString, instrumentXmlString);
            DataAccess.GetInstance(exchangeCode).ExecuteReader(sql, CommandType.Text, delegate(SqlDataReader reader)
            {
                while (reader.Read())
                {
                    InstrumentForFloatingPLCalc entity = new InstrumentForFloatingPLCalc();
                    AccountReportDataHelper.ConvertReportEntity(entity, reader);
                    instrumentForFloatingPLCalcList.Add(entity);
                }
            });

            return instrumentForFloatingPLCalcList;
        }