public decimal CounterCheckReferenceAndDelete(decimal decCounterId) { decimal decReturnValue = 0; try { decReturnValue = spCounter.CounterCheckReferenceAndDelete(decCounterId); } catch (Exception ex) { MessageBox.Show("CBLL:5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(decCounterId); }
/// <summary> /// Function to delete /// </summary> public void DeleteFunction() { try { CounterSP spCounter = new CounterSP(); if (spCounter.CounterCheckReferenceAndDelete(decCounterId) <= 0) { Messages.ReferenceExistsMessage(); } else { spCounter.CounterDelete(Convert.ToDecimal(dgvCounter.CurrentRow.Cells[1].Value.ToString())); Messages.DeletedMessage(); Clear(); } } catch (Exception ex) { MessageBox.Show("CT6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }