My app shows a menu of a restaurant where, after logging in with an email and password from the database, the client guides you to a computer that calculates Kcal after certain dates. I would like to be able to put the result in the same database and the same data that the client used as the image.
[
This is for an application I have for a contest
private void button1_Click(object sender, EventArgs e)
{
ani = Convert.ToInt32(textBox1.Text);
cm = Convert.ToInt32(textBox2.Text);
kg = Convert.ToInt32(textBox3.Text);
s = ani + cm + kg;
if (s < 250) label_mesaj.Text = "1800";
else if (s >= 250 && s <= 275) label_mesaj.Text = "2200";
else label_mesaj.Text = "2500";
}
private void button2_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand("insert into Clienti(parola,nume,prenume,adresa,email)values('" + textBox4.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox6.Text + "')", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
}
This is code that add to my database new clients after a registration, so i don't know how to remember that "id_clienti" I expect that "label_mesaj" to show on the "kcal_zilnice" in the database after LogIn with the same data.