/// <summary>
 /// Function to delete account group
 /// </summary>
 public void Delete()
 {
     try
     {
         if (isDefault == true)
         {
             Messages.InformationMessage("Can't delete build in account group");
         }
         //else if (PublicVariables.isMessageDelete)
         //{
         else if (Messages.DeleteConfirmation())
         {
             AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
             AccountGroupSP   spAccountGroup   = new AccountGroupSP();
             if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
             {
                 Messages.ReferenceExistsMessage();
             }
             else
             {
                 Messages.DeletedMessage();
                 btnSave.Text      = "Save";
                 btnDelete.Enabled = false;
                 Clear();
             }
         }
         //}
         //else
         //{
         //    AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
         //    AccountGroupSP spAccountGroup = new AccountGroupSP();
         //    if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
         //    {
         //        Messages.ReferenceExistsMessage();
         //    }
         //    else
         //    {
         //        Messages.DeletedMessage();
         //        btnSave.Text = "Save";
         //        btnDelete.Enabled = false;
         //        Clear();
         //    }
         //}
     }
     catch (Exception ex)
     {
         MessageBox.Show("AG10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #2
0
 /// <summary>
 /// Function to delete account group
 /// </summary>
 public void Delete()
 {
     try
     {
         if (isDefault == true)
         {
             Messages.InformationMessage("Can't delete build in account group");
         }
         //else if (PublicVariables.isMessageDelete)
         //{
         else if (Messages.DeleteConfirmation())
         {
             AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
             AccountGroupSP   spAccountGroup   = new AccountGroupSP();
             if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
             {
                 Messages.ReferenceExistsMessage();
             }
             else
             {
                 Messages.DeletedMessage();
                 btnSave.Text      = "Save";
                 btnDelete.Enabled = false;
                 Clear();
             }
         }
         //}
         //else
         //{
         //    AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
         //    AccountGroupSP spAccountGroup = new AccountGroupSP();
         //    if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
         //    {
         //        Messages.ReferenceExistsMessage();
         //    }
         //    else
         //    {
         //        Messages.DeletedMessage();
         //        btnSave.Text = "Save";
         //        btnDelete.Enabled = false;
         //        Clear();
         //    }
         //}
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "AG7:" + ex.Message;
     }
 }
 /// <summary>
 /// Function to delete account group
 /// </summary>
 public void Delete()
 {
     try
     {
         if (isDefault == true)
         {
             Messages.InformationMessage("Can't delete build in account group");
         }
         //else if (PublicVariables.isMessageDelete)
         //{
         else if (Messages.DeleteConfirmation())
         {
             AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
             AccountGroupSP spAccountGroup = new AccountGroupSP();
             if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
             {
                 Messages.ReferenceExistsMessage();
             }
             else
             {
                 Messages.DeletedMessage();
                 btnSave.Text = "Save";
                 btnDelete.Enabled = false;
                 Clear();
             }
         }
         //}
         //else
         //{
         //    AccountGroupInfo InfoAccountGroup = new AccountGroupInfo();
         //    AccountGroupSP spAccountGroup = new AccountGroupSP();
         //    if ((spAccountGroup.AccountGroupReferenceDelete(decAccountGroupIdForEdit) == -1))
         //    {
         //        Messages.ReferenceExistsMessage();
         //    }
         //    else
         //    {
         //        Messages.DeletedMessage();
         //        btnSave.Text = "Save";
         //        btnDelete.Enabled = false;
         //        Clear();
         //    }
         //}
     }
     catch (Exception ex)
     {
         MessageBox.Show("AG10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }