private void btnRmReleaseDetail_Click(object sender, EventArgs e) { if (relOrderService.Delete(relOrder.ReleaseOrderId)) { RelOrderList.Remove(relOrder); dgvReleaseDetail.DataSource = null; dgvReleaseDetail.DataSource = RelOrderList; My.MyProject.Forms.FrmUpdateReqStatus.RelReq = InboundRequestService.GetVWById(RelReq.InboundRequestId); CalculateQtys(); CheckButtons(); } }
private void btnDeleteRelease_Click(object sender, EventArgs e) { var relService = new ReleaseOrderService(); var result = My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("Are you sure of this?", "Release Order: " + SelectedReleaseOrder.ReleaseNumber + " - " + SelectedReleaseOrder.RelOrder + Constants.vbNewLine + "Are you sure you want to delete this release? This can not be undone", My.Resources.Resources.warning, this); if (result == DialogResult.Yes) { if (relService.Delete(SelectedReleaseOrder.ReleaseOrderId)) { var list = ReleaseOrderService.GetAllVWByReleaseId(SelectedReleaseOrder.ReleaseId); ReleaseOrderList = new SortableBindingList <VW_ReleaseOrder>(list); VWReleaseOrderBindingSource.DataSource = ReleaseOrderList; Close(); } else { My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Release Order not deleted.", "Something went wrong and the release order was not deleted. Please try again.", this); } } }