/// <summary>
 /// Function to delete a company
 /// </summary>
  public void DeleteFunction()
  {
      try
      {
          decimal decCompanyIdForTemp = PublicVariables._decCurrentCompanyId;
          CompanySP spCompany = new CompanySP();
     
          PublicVariables._decCurrentCompanyId = 0;
          CompanySP spExCompany = new CompanySP();
          CompanyPathSP spExCompanyPath = new CompanyPathSP();
          spExCompany.CompanyDelete(decCompanyIdForTemp);
          spExCompanyPath.CompanyPathDelete(decCompanyIdForTemp);
          Messages.DeletedMessage();
          Application.Restart();
      }
      catch (Exception ex)
      {
          MessageBox.Show("CR12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
      }
  }