/// <summary>
        /// delete function
        /// </summary>
        public void DeleteFunction()
        {
            try
            {
                AccountLedgerInfo infoAccountLedger = new AccountLedgerInfo();
                AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
                if (bllAccountLedger.SupplierCheckreferenceAndDelete(Convert.ToDecimal(strLedgerId.ToString())) == -1)
                {
                    Messages.ReferenceExistsMessage();

                }
                else
                {
                    bllAccountLedger.PartyBalanceDeleteByVoucherTypeVoucherNoAndReferenceType(decLedger.ToString(), 1);
                    bllAccountLedger.LedgerPostingDeleteByVoucherTypeAndVoucherNo(decLedger.ToString(), 1);
                    bllAccountLedger.AccountLedgerDelete(decLedger);
                    Messages.DeletedMessage();
                    Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SUP11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }