Пример #1
0
        /// <summary>
        /// Delete Function
        /// </summary>
        /// <param name="decMasterId"></param>
        public void Delete(decimal decMasterId)
        {
            try
            {
                PaymentMasterSP SpPaymentMaster = new PaymentMasterSP();
                PartyBalanceSP SpPartyBalance = new PartyBalanceSP();

                if (!SpPartyBalance.PartyBalanceCheckReference(decPaymentVoucherTypeId, strVoucherNo))
                {
                    SpPaymentMaster.PaymentVoucherDelete(decPaymentmasterId, decPaymentVoucherTypeId, strVoucherNo);
                    Messages.DeletedMessage();
                    if (frmPaymentRegisterObj != null)
                    {
                        this.Close();
                        frmPaymentRegisterObj.CallFromPaymentVoucher(this);
                    }
                    else if (frmPaymentReportObj != null)
                    {
                        this.Close();
                        frmPaymentReportObj.CallFromPaymentVoucher(this);
                    }
                    else if (frmLedgerDetailsObj != null)
                    {
                        this.Close();
                    }
                    if (_frmVoucherSearch != null)
                    {
                        this.Close();
                        _frmVoucherSearch.GridFill();
                    }
                    if (frmDayBookObj != null)
                    {
                        this.Close();
                    }
                    if (frmBillallocationObj != null)
                    {
                        this.Close();
                    }

                }
                else
                {
                    Messages.InformationMessage("Reference exist. Cannot delete");
                    txtDate.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PV19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #2
0
 /// <summary>
 /// Delete function, deleting all are the details here
 /// </summary>
 /// <param name="SalesMasterId"></param>
 public void DeleteFunction(decimal SalesMasterId)
 {
     SalesMasterSP spSalesMaster = new SalesMasterSP();
     try
     {
         PartyBalanceSP spPartyBalance = new PartyBalanceSP();
         if (!spSalesMaster.SalesReturnCheckReferenceForSIDelete(decSalesInvoiceIdToEdit))
         {
             if (!spPartyBalance.PartyBalanceCheckReference(DecSalesInvoiceVoucherTypeId, strVoucherNo))
             {
                 spSalesMaster.SalesInvoiceDelete(decSalesInvoiceIdToEdit, DecSalesInvoiceVoucherTypeId, strVoucherNo);
                 Messages.DeletedMessage();
                 if (frmSalesinvoiceRegisterObj != null)
                 {
                     this.Close();
                     frmSalesinvoiceRegisterObj.Enabled = true;
                 }
                 else if (frmSalesReportObj != null)
                 {
                     this.Close();
                     frmSalesReportObj.Enabled = true;
                 }
                 else if (objVoucherSearch != null)
                 {
                     this.Close();
                     objVoucherSearch.GridFill();
                 }
                 else if (frmDayBookObj != null)
                 {
                     this.Close();
                 }
                 else if (frmledgerDetailsObj != null)
                 {
                     this.Close();
                 }
                 else
                 {
                     Clear();
                 }
             }
             else
             {
                 Messages.InformationMessage("Reference exist. Cannot delete");
                 txtDate.Focus();
             }
         }
         else
         {
             Messages.InformationMessage("Reference exist. Cannot delete");
             txtDate.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 85" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #3
0
        /// <summary>
        /// function to delete voucher
        /// </summary>
        /// <param name="decJournalMasterId"></param>
        public void DeleteFunction(decimal decJournalMasterId)
        {
            try
            {
                JournalMasterSP spJournalMaster = new JournalMasterSP();
                PartyBalanceSP spPartyBalance = new PartyBalanceSP();

                if (!spPartyBalance.PartyBalanceCheckReference(decJournalVoucherTypeId, strVoucherNo))
                {
                    spJournalMaster.JournalVoucherDelete(decJournalMasterId, decJournalVoucherTypeId, strVoucherNo);

                    Messages.DeletedMessage();
                    if (journalRegisterObj != null)
                    {
                        this.Close();
                        journalRegisterObj.Enabled = true;
                    }
                    else if (frmJournalReportObj != null)
                    {
                        this.Close();
                        frmJournalReportObj.Enabled = true;
                    }
                    else if (frmLedgerDetailsObj != null)
                    {
                        this.Close();
                    }
                    else if (objVoucherSearch != null)
                    {
                        this.Close();
                        objVoucherSearch.GridFill();
                    }
                    else if (frmDayBookObj != null)
                    {
                        this.Close();
                    }
                    else if (frmBillallocationObj != null)
                    {
                        this.Close();
                    }
                    else
                    {
                        clear();
                    }
                }
                else
                {
                    Messages.InformationMessage("Reference exist. Cannot delete");
                    txtDate.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("JV19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Пример #4
0
 /// <summary>
 /// Delete Function, Checking the References and Check other forms are opend or not
 /// </summary>
 /// <param name="decPDCReceivableMasterId"></param>
 public void DeleteFunction(decimal decPDCReceivableMasterId)
 {
     try
     {
         PDCReceivableMasterSP sppdcreceivable = new PDCReceivableMasterSP();
         PartyBalanceSP spPartyBalance = new PartyBalanceSP();
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         if (!spPartyBalance.PartyBalanceCheckReference(decPDCReceivableVoucherTypeId, strVoucherNo))
         {
             sppdcreceivable.PDCReceivableDeleteMaster(decPDCReceivableMasterId, decPDCReceivableVoucherTypeId, strVoucherNo);
             Messages.DeletedMessage();
         }
         else
         {
             Messages.InformationMessage("Reference exist. Cannot delete");
             txtVoucherDate.Focus();
         }
         if (PDCReceivableRegisterObj != null)
         {
             this.Close();
             PDCReceivableRegisterObj.Show();
         }
         else if (PDCReceivableReportObj != null)
         {
             this.Close();
             PDCReceivableReportObj.Show();
         }
         else if (frmLedgerDetailsObj != null)
         {
             this.Close();
             frmLedgerDetailsObj.Show();
         }
         else if (objVoucherSearch != null)
         {
             this.Close();
             objVoucherSearch.GridFill();
         }
         else
         {
             ClearFunction();
         }
         if (frmDayBookObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR20:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }