示例#1
0
 public void AddCar(Car c)
 {
     listView1.Items.Add(c.ID.ToString(), c.ToString(), CarImageIndex(c));
     if (currentFilter != IdentityFilter.get())
     {
         ReloadData(parent.cars);
     }
     else
     {
         int count = int.Parse(toolStripStatusLabel1.Text);
         toolStripStatusLabel1.Text = (++count).ToString();
     }
 }
示例#2
0
 public void EditCar(Car c)
 {
     foreach (ListViewItem i in listView1.Items)
     {
         if (i.Name == c.ID.ToString())
         {
             i.Text       = c.ToString();
             i.ImageIndex = CarImageIndex(c);
         }
     }
     if (currentFilter != IdentityFilter.get())
     {
         ReloadData(parent.cars);
     }
 }
示例#3
0
 public void DeleteCar(Car c)
 {
     foreach (ListViewItem i in listView1.Items)
     {
         if (i.Name == c.ID.ToString())
         {
             listView1.Items.Remove(i);
         }
     }
     if (currentFilter != IdentityFilter.get())
     {
         ReloadData(parent.cars);
     }
     else
     {
         int count = int.Parse(toolStripStatusLabel1.Text);
         toolStripStatusLabel1.Text = (--count).ToString();
     }
 }
示例#4
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == 0)
     {
         currentFilter = IdentityFilter.get();
         ReloadData(parent.cars);
     }
     else if (comboBox1.SelectedIndex == 1)
     {
         currentFilter = before100;
         ReloadData(parent.cars);
     }
     else if (comboBox1.SelectedIndex == 2)
     {
         currentFilter = after100;
         ReloadData(parent.cars);
     }
     else
     {
     }
 }
示例#5
0
 public CarView(ParentView parent_)
 {
     InitializeComponent();
     parent        = parent_;
     currentFilter = IdentityFilter.get();
 }