Ejemplo n.º 1
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            sendemaildata data = new sendemaildata();

            data.name    = namebox.Text;
            data.text    = textbox.Text;
            data.address = addressbox.Text;
            data.url     = urlbox.Text;

            dbdata.jtttdata.Add(data);

            dbdata.SaveChanges();
            listBox1.DataSource = dbdata.jtttdata.ToList();
        }
Ejemplo n.º 2
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            senddata data;

            if (tabControl1.TabPages[tabControl1.SelectedIndex].Text == "Sprawdz strone")
            {
                data         = new sendemaildata();
                data.address = addressbox.Text;
            }
            else
            {
                data         = new sendinfodate();
                data.address = addressbox.Text;
                data.city    = citybox.Text;
                data.temp    = tempbox.Text;
            }

            if (tabControl2.TabPages[tabControl2.SelectedIndex].Text == "Wyslij email")
            {
                data.name   = namebox.Text;
                data.text   = textbox.Text;
                data.url    = urlbox.Text;
                data.option = "email";
            }
            else
            {
                data.name = namebox.Text;
                data.text = textbox.Text;
                data.url  = urlbox.Text;
            }


            dbdata.jtttdata.Add(data);
            dbdata.SaveChanges();
            listBox1.DataSource = dbdata.jtttdata.ToList();
        }