public void RemoveYear() { try { FormHelpers.CursorWait(true); var recyear = mgridYearList.SelectedRows[0].Cells["colYear"].Value.ToString(); if (MessageHelpers.ShowQuestion("Are you sure you want to remove this year?") == DialogResult.Yes) { var RemovingisSuccess = false; var msg = "Removing"; fxsp = yearbal.CheckFXSPYear(Convert.ToInt32(recyear)); cat = yearbal.CheckCatYear(Convert.ToInt32(recyear)); if (yearbal.Remove(Convert.ToInt32(recyear))) { RemovingisSuccess = true; } if (RemovingisSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }