Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            SaveInf Q = new SaveInf();

            Q.Load();
            txt1.Text            = Q.name;
            txt2.Text            = Q.number.ToString();
            txt3.Text            = ((float)Q.size).ToString();
            textBox1.Text        = Q.weight.ToString();
            dateTimePicker1.Text = Q.date;
            comboBox1.Text       = Q.type;
            numericUpDown1.Value = Q.count;
            comboBox2.Text       = Q.producer;
        }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txt1.Text != "" && txt2.Text != "" && txt3.Text != "" &&
         textBox1.Text != "" && comboBox1.Text != "" &&
         comboBox2.Text != "")
     {
         SaveInf Q = new SaveInf(txt1.Text, Convert.ToInt16(txt2.Text), Convert.ToSingle(txt3.Text),
                                 Convert.ToSingle(textBox1.Text), dateTimePicker1.Text, comboBox1.Text,
                                 Convert.ToInt16(numericUpDown1.Value), comboBox2.Text);
         Q.Save();
         listBox1.Items.Clear();
         listBox1.Items.Add(Q);
     }
     else
     {
         label10.Text = "Заполнены не все поля!";
     }
 }