/// <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) { formMDI.infoError.ErrorString = "RL:7" + ex.Message; } }
/// <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); } }