Esempio n. 1
0
        /// <summary>
        /// cbFinalVoteType SelectionChanged EventHandler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">SelectionChangedEventArgs</param>
        private void cbFinalVoteType_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            RadComboBox voteComboBox = sender as RadComboBox;

            if (voteComboBox == null)
            {
                return;
            }
            VoterInfo voterInfo = voteComboBox.DataContext as VoterInfo;

            DataContextViewModelPresentationDecisionEntry.RaiseUpdateFinalVoteType(voterInfo);
        }
Esempio n. 2
0
        /// <summary>
        /// Raise IC Decision Recommendation update
        /// </summary>
        private void RaiseUpdateICDecisionRecommendation()
        {
            Boolean pfvChanged = false;

            if (this.cbPFVICDecision.SelectedItem == null)
            {
                return;
            }
            if (DataContextViewModelPresentationDecisionEntry.SecurityPFVMeasureCurrentPrices != null)
            {
                if (DataContextViewModelPresentationDecisionEntry
                    .SecurityPFVMeasureCurrentPrices[this.cbPFVICDecision.SelectedItem as String] == null)
                {
                    Prompt.ShowDialog("Error: missing current value of P/FV measure: " + this.cbPFVICDecision.SelectedItem as String);
                    this.cbPFVICDecision.SelectedValue = committeePFVMeasure;
                    this.txtbPFVICDecisionBuy.Text     = this.committeeBuyRange.ToString();
                    this.txtbPFVICDecisionSell.Text    = this.committeeSellRange.ToString();
                    return;
                }
            }

            if (this.cbPFVICDecision.SelectedItem as String != committeePFVMeasure)
            {
                pfvChanged = true;
            }

            committeePFVMeasure = this.cbPFVICDecision.SelectedItem as String;

            Decimal committeeBuyRange;

            if (!Decimal.TryParse(this.txtbPFVICDecisionBuy.Text, out committeeBuyRange))
            {
                this.txtbPFVICDecisionBuy.Text = committeeBuyRange.ToString();
                return;
            }

            Boolean buyRangeChanged = true;

            if (this.committeeBuyRange == committeeBuyRange)
            {
                buyRangeChanged = false;
            }
            this.committeeBuyRange = committeeBuyRange;

            Decimal committeeSellRange;

            if (!Decimal.TryParse(this.txtbPFVICDecisionSell.Text, out committeeSellRange))
            {
                this.txtbPFVICDecisionSell.Text = committeeSellRange.ToString();
                return;
            }

            Boolean sellRangeChanged = true;

            if (this.committeeSellRange == committeeSellRange)
            {
                sellRangeChanged = false;
            }
            this.committeeSellRange = committeeSellRange;

            if (pfvChanged || buyRangeChanged || sellRangeChanged)
            {
                DataContextViewModelPresentationDecisionEntry.UpdateICDecisionRecommendation(committeePFVMeasure, committeeBuyRange, committeeSellRange);
            }
        }