private void button1_Click(object sender, EventArgs e) { towar.Kolichestvo -= Convert.ToInt32(textBox1.Text); Zakashik zakashik = (Zakashik)comboBox1.SelectedItem; db.b(zakashik, towar, Convert.ToInt32(textBox1.Text)); db.Save(); Close(); }
private void button1_Click(object sender, EventArgs e) { Zakashik zakashik = new Zakashik { Name = textBox7.Text, Tel_Zakashiks = new List <string>() }; db.zakashiks.Add(zakashik); db.Save(); Close(); }
public void b(Zakashik postavshik, Towar towar, int kolishestvo) { History history = new History(); history.kto = postavshik.Name; history.skoka = kolishestvo.ToString(); string s = $"Вывезен {towar.Name}"; history.chto = s; historys.Add(history); Save(); }
private void button2_Click(object sender, EventArgs e) { if (comboBox1.SelectedItem == null) { return; } Zakashik zakashik = (Zakashik)comboBox1.SelectedItem; zakashik.Tel_Zakashiks.Add(textBox2.Text); db.Save(); textBox2.Clear(); show(); }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } string tel = (string)listView1.SelectedItems[0].Tag; Zakashik zakashik = (Zakashik)comboBox1.SelectedItem; zakashik.Tel_Zakashiks.Remove(tel); db.Save(); show(); }
void show() { listView1.Items.Clear(); if (comboBox1.SelectedItem == null) { return; } Zakashik name = (Zakashik)comboBox1.SelectedItem; foreach (var telefon in name.Tel_Zakashiks) { ListViewItem type1 = new ListViewItem(telefon); type1.Tag = telefon; listView1.Items.Add(type1); } }