public decimal ProductGroupReferenceDelete(decimal ProductGroupId)
        {
            decimal decReturnValue = 0;

            try
            {
                decReturnValue = spProductGroup.ProductGroupReferenceDelete(ProductGroupId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AL27:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decReturnValue);
        }
Esempio n. 2
0
 /// <summary>
 /// Function to delete productgroup
 /// </summary>
 private void Delete()
 {
     try
     {
         if (PublicVariables.isMessageDelete)
         {
             if (Messages.DeleteMessage() == true)
             {
                 ProductGroupInfo InfoProductGroup = new ProductGroupInfo();
                 ProductGroupSP   spProductGroup   = new ProductGroupSP();
                 if ((spProductGroup.ProductGroupReferenceDelete(decId) == -1))
                 {
                     Messages.ReferenceExistsMessage();
                 }
                 else
                 {
                     Messages.DeletedMessage();
                     btnSave.Text      = "Save";
                     btnDelete.Enabled = false;
                     ProductGroupUnderComboFillForSearch();
                     Clear();
                 }
             }
         }
         else
         {
             ProductGroupInfo InfoProductGroup = new ProductGroupInfo();
             ProductGroupSP   spProductGroup   = new ProductGroupSP();
             if ((spProductGroup.ProductGroupReferenceDelete(decId) == -1))
             {
                 Messages.ReferenceExistsMessage();
             }
             else
             {
                 Messages.DeletedMessage();
                 btnSave.Text      = "Save";
                 btnDelete.Enabled = false;
                 Clear();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PG6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }