private void donationDelete_Click(object sender, EventArgs e) { BloodDonationsDGV.Rows.RemoveAt(BloodDonationsDGV.SelectedRows[0].Index); donationDelete.Enabled = false; donationAdd.Tag = "a"; donationAdd.Text = "Add"; DonationID_textbox.Clear(); }
private void clear_button_Click(object sender, EventArgs e) { DonationID_textbox.Clear(); donationAdd.Tag = "a"; donationAdd.Text = "Add"; fn.Clear(); mi.Clear(); ln.Clear(); sf.Clear(); }
private void donationAdd_Click(object sender, EventArgs e) { if (donationAdd.Tag.ToString() == "a") { int a; a = dh.getDonationIDPrimaryKey(DonationID_textbox.Text); if (a != -1) { int index = BloodDonationsDGV.Rows.Add(); BloodDonationsDGV.Rows[index].Cells[0].Value = a; BloodDonationsDGV.Rows[index].Cells[1].Value = DonationID_textbox.Text; DonationID_textbox.Clear(); donationAdd.Enabled = false; } else { Notification.Show(State.InnvalidDononationID); } } else { int a; a = dh.getDonationIDPrimaryKey(DonationID_textbox.Text); if (a != -1) { BloodDonationsDGV.SelectedRows[0].Cells[0].Value = donationPK.Text; BloodDonationsDGV.SelectedRows[0].Cells[1].Value = DonationID_textbox.Text; DonationID_textbox.Clear(); donationAdd.Tag = "a"; donationAdd.Text = "Add"; donationDelete.Enabled = false; } else { Notification.Show(State.InnvalidDononationID); } } }