/// <summary>
        /// delete function
        /// </summary>
        public void DeleteFunction()
        {
            try
            {
                VoucherTypeTaxBll BllVoucherTypeTax = new VoucherTypeTaxBll();
                VoucherTypeBll BllVoucherType = new VoucherTypeBll();

                if (BllVoucherType.CheckForDefaultVoucherType(decVoucherTypeId) == false)
                {
                    if (BllVoucherType.VoucherTypeChechReferences(decVoucherTypeId) == false)
                    {
                        BllVoucherType.VoucherTypeDelete(decVoucherTypeId);
                        BllVoucherTypeTax.DeleteVoucherTypeTaxUsingVoucherTypeId(decVoucherTypeId);
                        Messages.DeletedMessage();
                        SearchGridFill();
                    }
                    else
                    {
                        Messages.ReferenceExistsMessage();
                    }
                }
                else
                {
                    Messages.InformationMessage("You can't delete default voucher types");
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("VT11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }