Exemplo n.º 1
0
 /// <summary>
 /// Delete function
 /// </summary>
 /// <param name="decPDCpayableMasterId"></param>
 public void DeleteFunction(decimal decPDCpayableMasterId)
 {
     try
     {
         PDCPayableMasterSP sppdcpayable = new PDCPayableMasterSP();
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         PartyBalanceSP spPartyBalance = new PartyBalanceSP();
         if (!spPartyBalance.PartyBalanceCheckReference(decPDCpayableVoucherTypeId, strVoucherNo))
         {
             sppdcpayable.PDCPayableMasterDelete(decPDCpayableMasterId, decPDCpayableVoucherTypeId, strVoucherNo);
             Messages.DeletedMessage();
         }
         else
         {
             Messages.InformationMessage("Reference exist. Cannot delete");
             txtVoucherDate.Focus();
         }
         if (PDCPayableRegisterObj != null)
         {
             this.Close();
             PDCPayableRegisterObj.Enabled = true;
         }
         else if (PDCpayableReportObj != null)
         {
             this.Close();
             PDCpayableReportObj.Enabled = true;
         }
         else if (frmVoucherSearch != null)
         {
             this.Close();
             frmVoucherSearch.GridFill();
         }
         else if (frmLedgerDetailsObj != null)
         {
             this.Close();
         }
         else if (frmDayBookObj != null)
         {
             this.Close();
         }
         else if (BillallocationObj != null)
         {
             this.Close();
         }
         else
         {
             ClearFunction();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP23:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }