private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (BsfGlobal.FindPermission("Location-Delete") == false) { MessageBox.Show("No Rights to Location-Edit"); return; } bool status = false; int CityId = Convert.ToInt32(TransView.GetFocusedRowCellValue("CityId")); status = m_oCity.CheckCity(CityId); if (status == false) { MessageBox.Show("Already Used, Do Not Delete", "Vendor", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (reply == DialogResult.Yes) { m_oCity.DeleteCity(CityId); TransView.DeleteRow(TransView.FocusedRowHandle); } } }
private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int StateId = Convert.ToInt32(TransView.GetFocusedRowCellValue("StateId")); bool status = m_oState.CheckState(StateId); if (status == false) { MessageBox.Show("Already Used, Do Not Delete", "Vendor", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (reply == DialogResult.Yes) { m_oState.DeleteState(StateId); TransView.DeleteRow(TransView.FocusedRowHandle); } } }