Example #1
0
        private void costDrivers_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var registry       = new CostDriverRegistry();
            var costDriverName = costDrivers.SelectedValue.ToString();
            var costDriver     = registry.GetCostDriver(costDriverName);

            costDriverRatings.ItemsSource = costDriver.GetRatings();
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            var costDriversRegistry = new CostDriverRegistry();
            var costDriversList     = costDriversRegistry.GetAllCostDrivers();

            this.CostDrivers         = new ObservableCollection <CostDriverRow>();
            CostDriverDg.ItemsSource = CostDrivers;
            costDrivers.ItemsSource  = costDriversList.Select(i => i.Name).ToList();
            EAFLabel.Content         = "1.0";
        }
Example #3
0
        private void AddCostdriver_Click(object sender, RoutedEventArgs e)
        {
            var costDriversRegistry = new CostDriverRegistry();

            if (costDrivers.SelectedIndex != -1 && costDriverRatings.SelectedIndex != -1)
            {
                CostDrivers.Add(new CostDriverRow()
                {
                    Attribute = costDrivers.SelectedValue.ToString(),
                    Rate      = costDriverRatings.SelectedValue.ToString(),
                    Value     = costDriversRegistry.GetCostDriver(costDrivers.SelectedValue.ToString())
                                .RatingValue[(CostDriverRating)Enum.Parse(typeof(CostDriverRating), costDriverRatings.SelectedValue.ToString())]
                });
                if (this._calculator != null)
                {
                    EAFLabel.Content = this._calculator.CalculateEAF(CostDrivers.Select(i => i.Value).ToList());
                }
            }
        }