Esempio n. 1
0
 private void cmbtrfadi_SelectedIndexChanged(object sender, EventArgs e)
 {
     //Seçilen türe göre tarifler getirilmeli.
     //Seçilen türün value değeri alınır. Yani value değerinde tarifturuIDsini tuttuğumuz için tarifturuID ye ulaşmış oluruz.
     if (cmbtrfadi.SelectedValue.ToString() != "")
     {
         int trfID = int.Parse(cmbtrfadi.SelectedValue.ToString());
         textBox1.Text = "";
         textBox2.Text = "";
         SqlCommand komut2 = new SqlCommand("select tarifadi,malzemeler,hazirlanisi from tarifler where tarifID=" + trfID + "", con);
         if (con.State == ConnectionState.Closed)
         {
             con.Open();
         }
         SqlDataReader dr = komut2.ExecuteReader();
         while (dr.Read())
         {
             tarif trf = new tarif();
             trf.Text         = dr[0].ToString();
             textBox1.Text    = dr[1].ToString();
             textBox2.Text    = dr[2].ToString();
             textBox3.Text    = "tarif adı \n" + trf + " \n malzemeler: \n" + textBox1 + "\n hazirlanisi" + textBox2;
             textBox3.Enabled = false;
         }
         con.Close();
     }
 }
Esempio n. 2
0
        private void tarifGösterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tarif frm4 = new tarif();

            frm4.Show();
        }