/// <summary> /// Delete Function /// </summary> public void DeleteFunction() { try { if (PublicVariables.isMessageDelete) { if (Messages.DeleteMessage()) { UserInfo infoUser = new UserInfo(); UserSP spUser = new UserSP(); if ((spUser.UserCreationReferenceDelete(decUserId) == -1)) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); GridFill(); } } } else { UserInfo infoUser = new UserInfo(); UserSP spUser = new UserSP(); if ((spUser.UserCreationReferenceDelete(decUserId) == -1)) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "UC:9" + ex.Message; } }
/// <summary> /// Delete Function /// </summary> public void DeleteFunction() { try { if (PublicVariables.isMessageDelete) { if (Messages.DeleteMessage()) { UserInfo infoUser = new UserInfo(); UserSP spUser = new UserSP(); if ((spUser.UserCreationReferenceDelete(decUserId) == -1)) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); GridFill(); } } } else { UserInfo infoUser = new UserInfo(); UserSP spUser = new UserSP(); if ((spUser.UserCreationReferenceDelete(decUserId) == -1)) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; ClearFunction(); } } } catch (Exception ex) { MessageBox.Show("UC:9" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }