private void addButton_Click(object sender, EventArgs e) { addMember addMemberOBj = new addMember(); addMemberOBj.mID = int.Parse(mIDTextBox.Text); addMemberOBj.name = nameTextBox.Text; addMemberOBj.contactNo = contactNoTextBox.Text; addMemberOBj.email = emailTextBox.Text; addMemberOBj.address = addressTextBox.Text; addMemberBL addMemberBLOBj = new addMemberBL(); bool result = addMemberBLOBj.ValidateNewMemberAndSendToDA(addMemberOBj); if (result) { MessageBox.Show("Succesful Added!!!!"); CleanTextBar(); this.PopulateGridView(); //tSSLabel1.Text = "Succesfull!!"; // label1.Text = rowsAffected + " Rows Succesfull!!!!!!!!!!"; } else { MessageBox.Show("ERROR!!", "Alert!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } }
private void deleteButton_Click(object sender, EventArgs e) { addMember addMemberOBj = new addMember(); addMemberOBj.mID = int.Parse(mIDTextBox.Text); addMemberOBj.name = nameTextBox.Text; addMemberOBj.contactNo = contactNoTextBox.Text; addMemberOBj.email = emailTextBox.Text; addMemberOBj.address = addressTextBox.Text; addMemberBL addMemberBLOBj = new addMemberBL(); bool result = addMemberBLOBj.DeleteMemberFromBL(addMemberOBj); if (result) { MessageBox.Show("Succesfully Delete!!!!"); CleanTextBar(); this.PopulateGridView(); } else { MessageBox.Show("ERROR!!", "Alert!!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); } }
private void PopulateGridView() { DataTable dt = new DataTable(); addMemberBL addMemberBLOBj = new addMemberBL(); dt = addMemberBLOBj.GetExistingdMemberBL(); memberDataGridView.DataSource = dt; }