/// <summary> /// Function to delete particular details based on the parameter /// </summary> /// <param name="RoleId"></param> /// <returns></returns> public decimal RoleReferenceDelete(decimal RoleId) { decimal decRole = 0; try { decRole = spRole.RoleReferenceDelete(RoleId); } catch (Exception ex) { MessageBox.Show("RL6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(decRole); }
/// <summary> /// Delete Function /// </summary> public void DeleteFunction() { try { if (PublicVariables.isMessageDelete) { if (Messages.DeleteMessage()) { RoleInfo infoRole = new RoleInfo(); RoleSP spRole = new RoleSP(); if ((spRole.RoleReferenceDelete(decRoleId) == -1)) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); } } } else { RoleInfo infoRole = new RoleInfo(); RoleSP spRole = new RoleSP(); if (spRole.RoleReferenceDelete(decRoleId) == -1) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); } } } catch (Exception ex) { MessageBox.Show("RL:7" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }