Example #1
0
 public Form3(DB dB, Tovar tovar)
 {
     InitializeComponent();
     this.dB               = dB;
     this.tovar            = tovar;
     textBox1.Text         = tovar.Name;
     textBox3.Text         = tovar.Number.ToString();
     textBox2.Text         = tovar.Kolihestvo;
     dateTimePicker1.Value = tovar.Data;
     textBox4.Text         = tovar.Availability;
 }
Example #2
0
        private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                return;
            }
            Tovar tovar = (Tovar)listView1.SelectedItems[0].Tag;

            dB.tovars.Remove(tovar);
            show();
            dB.Save();
        }
Example #3
0
        private void редактироватьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                return;
            }
            Tovar tovar = (Tovar)listView1.SelectedItems[0].Tag;
            Form3 form2 = new Form3(dB, tovar);

            form2.ShowDialog();
            show();
            dB.Save();
        }
Example #4
0
File: Form2.cs Project: Pupsik45/-
        private void button1_Click(object sender, EventArgs e)
        {
            Tovar tovar = new Tovar();

            tovar.Name         = textBox1.Text;
            tovar.Number       = Convert.ToInt32(textBox3.Text);
            tovar.Kolihestvo   = textBox2.Text;
            tovar.Data         = dateTimePicker1.Value;
            tovar.Availability = textBox4.Text;
            dB.tovars.Add(tovar);
            dB.Save();
            Close();
        }