private void button1_Click(object sender, EventArgs e)
        {
            towar.Kolichestvo += Convert.ToInt32(textBox1.Text);
            Postavshik postavshik = (Postavshik)comboBox1.SelectedItem;

            db.a(postavshik, towar, Convert.ToInt32(textBox1.Text));
            db.Save();
            Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Postavshik postavshik = new Postavshik {
                Name = textBox7.Text, Tel_Postavshiks = new List <string>()
            };

            db.postavshiks.Add(postavshik);
            db.Save();
            Close();
        }
Beispiel #3
0
        public void a(Postavshik 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 button3_Click(object sender, EventArgs e)
        {
            if (comboBox2.SelectedItem == null)
            {
                return;
            }
            Postavshik postavshik = (Postavshik)comboBox2.SelectedItem;

            postavshik.Tel_Postavshiks.Add(textBox3.Text);
            db.Save();
            textBox3.Clear();
            show2();
        }
        private void удалитьToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (listView2.SelectedItems.Count == 0)
            {
                return;
            }
            string     tel1       = (string)listView2.SelectedItems[0].Tag;
            Postavshik postavshik = (Postavshik)comboBox2.SelectedItem;

            postavshik.Tel_Postavshiks.Remove(tel1);
            db.Save();
            show2();
        }
        void show2()
        {
            listView2.Items.Clear();
            if (comboBox2.SelectedItem == null)
            {
                return;
            }
            Postavshik name = (Postavshik)comboBox2.SelectedItem;

            foreach (var telefon in name.Tel_Postavshiks)
            {
                ListViewItem type1 = new ListViewItem(telefon);
                type1.Tag = telefon;
                listView2.Items.Add(type1);
            }
        }