private void btnLogOut_Click(object sender, EventArgs e) { PestForm areYouSure = new PestForm(); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { this.Close(); } }
private void btnUTCrudDelete_Click(object sender, EventArgs e) { int userTypeIndex = dgvUTTable.CurrentCell.RowIndex; UserTypeEntity userType = AllUserTypes.ElementAt(userTypeIndex); PestForm areYouSure = new PestForm(userType); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { dgvUTTable.Rows.RemoveAt(userTypeIndex); dgvUTTable.Invalidate(); } }
private void btnCommentCrudDelete_Click(object sender, EventArgs e) { int commentIndex = dgvCommentTable.CurrentCell.RowIndex; CommentEntity comment = AllComments.ElementAt(commentIndex); PestForm areYouSure = new PestForm(comment); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { dgvCommentTable.Rows.RemoveAt(commentIndex); dgvCommentTable.Invalidate(); } }
private void btnCategoryDelete_Click(object sender, EventArgs e) { int catIndex = dgvCategoryTable.CurrentCell.RowIndex; CategoryEntity cat = AllCategories.ElementAt(catIndex); PestForm areYouSure = new PestForm(cat); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { dgvCategoryTable.Rows.RemoveAt(catIndex); dgvCategoryTable.Invalidate(); } }
private void btnPlaceDelete_Click(object sender, EventArgs e) { int placeIndex = dgvPlaceTable.CurrentCell.RowIndex; PlaceEntity place = AllPlaces.ElementAt(placeIndex); PestForm areYouSure = new PestForm(place); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { dgvPlaceTable.Rows.RemoveAt(placeIndex); dgvPlaceTable.Invalidate(); } }
private void btnInfoDelete_Click(object sender, EventArgs e) { int infoIndex = dgvInfoTable.CurrentCell.RowIndex; InfoEntity info = AllInfos.ElementAt(infoIndex); PestForm areYouSure = new PestForm(info); areYouSure.ShowDialog(); if (areYouSure.DialogResult == DialogResult.Yes) { dgvInfoTable.Rows.RemoveAt(infoIndex); dgvInfoTable.Invalidate(); } }