/// <summary> /// Function to check reference and delete based on parameter /// </summary> /// <param name="decServiceCategoryId"></param> /// <returns></returns> public decimal ServiceCategoryCheckReferenceAndDelete(decimal decServiceCategoryId) { decimal decReturnValue = 0; try { decReturnValue = spServiceCatogory.ServiceCategoryCheckReferenceAndDelete(decServiceCategoryId); } catch (Exception ex) { MessageBox.Show("SC5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(decReturnValue); }
/// <summary> /// Function to delete a servicecategory /// </summary> public void DeleteFunction() { try { ServiceCategorySP spServiceCategory = new ServiceCategorySP(); if (spServiceCategory.ServiceCategoryCheckReferenceAndDelete(decCategoryName) == -1) { Messages.ReferenceExistsMessage(); } else { spServiceCategory.ServiceCategoryDelete(Convert.ToDecimal(dgvServiceCategory.CurrentRow.Cells[1].Value.ToString())); Messages.DeletedMessage(); Clear(); } } catch (Exception ex) { MessageBox.Show("SC6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }