Пример #1
0
        private void FormDividend_Shown(object sender, EventArgs e)
        {
            boxSeek.Text = seektxt;

            boxAccount.Text = account;

            if (ThisAddIn.ListPapers != null)
            {
                var autoComplete = new AutoCompleteStringCollection();
                autoComplete.AddRange((from item in ThisAddIn.ListPapers select item.name).ToArray());
                boxSeek.AutoCompleteCustomSource = autoComplete;
            }

            if ((ThisAddIn.Currencies != null) && (ThisAddIn.Currencies.payload != null) && (ThisAddIn.Currencies.payload.instruments != null))
            {
                boxCurrency.DataSource = (from item in ThisAddIn.Currencies.payload.instruments select item.currency).ToList();
            }

            if (ThisAddIn.ListPapers != null)
            {
                ThisAddIn.Paper paper = ThisAddIn.ListPapers.FirstOrDefault(item => item.ticker == ticker);

                if ((paper != null) && (paper.currency != ""))
                {
                    boxCurrency.SelectedItem = paper.currency;
                }
            }

            btnSeek_Click(sender, e);
        }
Пример #2
0
        private void FormPortfolio_Shown(object sender, EventArgs e)
        {
            switch (operation)
            {
            case OperType.Buy:
                lbOperation.Text = "КУПИТЬ";
                this.Name        = "КУПИТЬ ценную бумагу";
                boxPlan.Checked  = false;
                boxPlan.Visible  = true;
                break;

            case OperType.PlanBuy:
                lbOperation.Text = "КУПИТЬ";
                this.Name        = "КУПИТЬ ценную бумагу";
                boxPlan.Checked  = true;
                boxPlan.Visible  = true;
                break;

            case OperType.Sell:
            default:
                lbOperation.Text = "ПРОДАТЬ";
                this.Name        = "ПРОДАТЬ ценную бумагу";
                boxPlan.Checked  = false;
                boxPlan.Visible  = false;
                break;
            }

            boxSeek.Text = seektxt;

            boxAccount.Text = account;

            if (ThisAddIn.ListPapers != null)
            {
                var autoComplete = new AutoCompleteStringCollection();
                autoComplete.AddRange((from item in ThisAddIn.ListPapers select item.name).ToArray());
                boxSeek.AutoCompleteCustomSource = autoComplete;
            }


            if ((ThisAddIn.Currencies != null) && (ThisAddIn.Currencies.payload != null) && (ThisAddIn.Currencies.payload.instruments != null))
            {
                boxCurrency.DataSource = (from item in ThisAddIn.Currencies.payload.instruments select item.currency).ToList();
            }

            if (ThisAddIn.ListPapers != null)
            {
                ThisAddIn.Paper paper = ThisAddIn.ListPapers.FirstOrDefault(item => item.ticker == ticker);

                if ((paper != null) && (paper.currency != ""))
                {
                    boxCurrency.SelectedItem = paper.currency;
                }
            }

            btnSeek_Click(sender, e);
        }