private void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                int donorId = int.Parse(textBox1.Text.ToString());


                Medicalcondition k = new Medicalcondition();



                int result = k.DeleteMedicalcondition(donorId);
                if (result > 0)
                {
                    label2.Text = "Medicalcondition deleted";
                }
                else
                {
                    label2.Text = "Medicalcondition Not deleted";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void LISTToolStripMenuItem5_Click(object sender, EventArgs e)
 {
     try
     {
         Medicalcondition z = new Medicalcondition();
         dgvDonors.DataSource = z.ListMedicalconditions();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                int    donorId              = int.Parse(tb1.Text.ToString());
                string conditionCode        = tb2.Text;
                string conditionName        = tb3.Text;
                string conditionDescription = tb4.Text;



                Medicalcondition d = new Medicalcondition();

                d.DonorId              = donorId;
                d.ConditionCode        = conditionCode;
                d.ConditionName        = conditionName;
                d.ConditionDescription = conditionDescription;



                int result = d.AddMedicalcondition(d);
                if (result > 0)
                {
                    lblMessg.Text = "Medicalcondition Added";
                    tb1.Text      = "";
                    tb2.Text      = "";
                    tb3.Text      = "";
                    tb4.Text      = "";
                }
                else
                {
                    lblMessg.Text = "Medicalcondition Not Added";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                Medicalcondition s = new Medicalcondition();
                s.DonorId              = int.Parse(textBox1.Text.ToString());
                s.ConditionCode        = textBox2.Text.Trim();
                s.ConditionName        = textBox3.Text.Trim();
                s.ConditionDescription = textBox4.Text.Trim();



                int result = s.UpdateMedicalcondition(s);
                if (result > 0)
                {
                    MessageBox.Show("Update successsfully.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }