Exemple #1
0
        private void Button11_Click(object sender, EventArgs e)
        {
            TreatmentInformationReport t1 = new TreatmentInformationReport();

            this.Hide();
            t1.Show();
        }
Exemple #2
0
 private void Button7_Click(object sender, EventArgs e)
 {
     try
     {
         m.Close();
         m.Open();
         SqlCommand cmd = new SqlCommand("delete from [dbo].[treatment] where Tid='" + textBox1.Text + "'", m);
         int        a   = cmd.ExecuteNonQuery();
         if (a > 0)
         {
             MessageBox.Show("Deleted");
             textBox1.Clear();
             this.Hide();
             TreatmentInformationReport f1 = new TreatmentInformationReport();
             f1.Show();
         }
         else
         {
             MessageBox.Show("Invalid");
         }
         m.Close();
     }
     catch
     {
     }
 }
Exemple #3
0
        private void Button9_Click(object sender, EventArgs e)
        {
            try
            {
                m.Close();
                m.Open();
                SqlCommand cmd = new SqlCommand("update [dbo].[treatment] set Tname = '" + textBox3.Text + "', Symptom = '" + textBox4.Text + "', Pname = '" + textBox5.Text + "', Frname = '" + textBox6.Text + "' where Tid='" + textBox1.Text + "'", m);
                int        a   = cmd.ExecuteNonQuery();
                if (a > 0)
                {
                    MessageBox.Show("Updated");
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox4.Clear();
                    textBox5.Clear();
                    textBox6.Clear();

                    this.Hide();
                    TreatmentInformationReport f1 = new TreatmentInformationReport();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("Invalid");
                }
                m.Close();
            }
            catch
            {
                MessageBox.Show("Error!!");
            }
        }