Exemplo n.º 1
0
        private void btnAddNew_Click(object sender, RoutedEventArgs e)
        {
            //TODO Does Name exist?

            if (txtStation.Text != string.Empty)
            {
                MediaInvestment tmpMediaInvestment = BuildMediaInvestment(null);

                m_MediaInvestmentList.Add(tmpMediaInvestment);

                //Remove and Add new total
                this.RemoveTotal();
                this.AddTotal();

                ResetDisplay();

                this.lvMediaInvestment.SelectedItem = this.lvMediaInvestment.Items[this.lvMediaInvestment.Items.Count - 2];
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("Station name can not be blank.", "Station Name Error");
            }
        }
        private void ImportPlanA()
        {
            foreach (MediaInvestment sourceMediaInvestment in PlanAMediaInvestmentList)
            {
                if (sourceMediaInvestment.Station != "Total")
                {
                    MediaInvestment tmpMediaInvestment = CopyMediaInvestment(sourceMediaInvestment);
                    MediaInvestmentList.Add(tmpMediaInvestment);

                    //Remove and Add new total
                    this.RemoveTotal();
                    this.AddTotal();

                    lvMediaInvestment.Items.Refresh();
                    lvMediaInvestment.SelectedItem = tmpMediaInvestment;
                }
            }
        }
 public void AddTotal()
 {
     _MediaInvestments.Add(TotalMediaInvestment());
 }