示例#1
0
 /// <summary>
 /// Function to delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         if (spAccountLedger.AccountLedgerCheckReferences(decLedgerIdForEdit) == -1)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spAccountLedger.PartyBalanceDeleteByVoucherTypeVoucherNoAndReferenceType(decLedgerIdForEdit.ToString(), 1);
             spAccountLedger.LedgerPostingDeleteByVoucherTypeAndVoucherNo(decLedgerIdForEdit.ToString(), 1);
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Cus9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }