Ejemplo n.º 1
0
        /// <summary>
        /// Clear button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            try
            {
                ClearFunctions();
                if (objfrmSalesInvoiceRegister != null)
                {
                    objfrmSalesInvoiceRegister.Close();
                    objfrmSalesInvoiceRegister = null;
                }
                if (frmSalesReportObj != null)
                {
                    frmSalesReportObj.Close();
                    frmSalesReportObj = null;
                }
                if (frmDayBookObj != null)
                {
                    frmDayBookObj.Close();
                    frmDayBookObj = null;
                }
                if (frmAgeingObj != null)
                {
                    frmAgeingObj.Close();
                    frmAgeingObj = null;
                }
                if (objVoucherSearch != null)
                {
                    objVoucherSearch.Close();
                    objVoucherSearch = null;
                }
                if (frmledgerDetailsObj != null)
                {
                    frmledgerDetailsObj.Enabled = true;
                    frmledgerDetailsObj = null;
                }
                if (frmAgeingObj != null)
                {
                    frmAgeingObj.Enabled = true;
                    frmAgeingObj = null;
                }

                this.BringToFront();
            }
            catch (Exception ex)
            {
                MessageBox.Show("POS : 71" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Function to call this form from frmLedgerDetails to view details and for updation 
 /// </summary>
 /// <param name="LedgerDetailsObj"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails LedgerDetailsObj, decimal decMasterId)
 {
     try
     {
         base.Show();
         frmledgerDetailsObj = LedgerDetailsObj;
         frmledgerDetailsObj.Enabled = false;
         decSalesMasterId = decMasterId;
         DetailsFillForEdit();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PO: 62" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// When doubleclicking on the grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            decimal decVouchertypeId = 0;
            string strVoucherNo = string.Empty;
            try
            {
                if (dgvReport.CurrentRow.Index == e.RowIndex)
                {
                    if ((dgvReport.CurrentRow.Cells["voucherTypeId"].Value != null && dgvReport.CurrentRow.Cells["voucherTypeId"].Value.ToString() != string.Empty))
                    {
                        int inI = dgvReport.CurrentCell.RowIndex;
                        foreach (DataGridViewRow dgv in dgvReport.Rows)
                        {
                            if (dgv.Cells["VoucherNo"].Value != null && dgv.Cells["VoucherNo"].Value.ToString() != string.Empty &&
                                   dgv.Cells["voucherTypeId"].Value != null && dgv.Cells["voucherTypeId"].Value.ToString() != string.Empty)
                            {
                                strVoucherType = dgv.Cells["VoucherType"].Value.ToString();
                                decVouchertypeId = Convert.ToDecimal(dgv.Cells["voucherTypeId"].Value.ToString());
                                strVoucherNo = dgv.Cells["VoucherNo"].Value.ToString();
                            }
                            else
                            {
                                if (dgv.Cells["ledgerId"].Value.ToString() != string.Empty)
                                {
                                    decledgerId = decimal.Parse(dgv.Cells["ledgerId"].Value.ToString());
                                    strVoucherType = dgv.Cells["Account Ledger"].Value.ToString();
                                    frmLedgerDetails frmLedger = new frmLedgerDetails();
                                    frmLedger = Application.OpenForms["frmLedgerDetails"] as frmLedgerDetails;
                                    if (frmLedger == null)
                                    {
                                        frmLedger = new frmLedgerDetails();
                                        frmLedger.MdiParent = formMDI.MDIObj;
                                        frmLedger.callFromAgeing(this, decledgerId);
                                        this.Enabled = false;
                                    }
                                }

                            }
                            if (dgv.Index == inI)
                            {
                                break;
                            }
                        }
                        if (strVoucherType == "Payment Voucher")
                        {
                            PaymentVoucherBll BllPaymentVoucher = new PaymentVoucherBll();
                            decMasterId = BllPaymentVoucher.paymentMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPaymentVoucher frmPaymentVoucher = new frmPaymentVoucher();
                            frmPaymentVoucher = Application.OpenForms["frmPaymentVoucher"] as frmPaymentVoucher;
                            if (frmPaymentVoucher == null)
                            {
                                frmPaymentVoucher = new frmPaymentVoucher();
                                frmPaymentVoucher.MdiParent = formMDI.MDIObj;
                                frmPaymentVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Receipt Voucher")
                        {
                            RecieptVoucherBll bllRecieptVoucher = new RecieptVoucherBll();
                            //ReceiptMasterSP spRecieptMaster = new ReceiptMasterSP();
                            decMasterId = bllRecieptVoucher.ReceiptMasterIdView(decVouchertypeId, strVoucherNo);
                            frmReceiptVoucher frmReceiptVoucher = new frmReceiptVoucher();
                            frmReceiptVoucher = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher;
                            if (frmReceiptVoucher == null)
                            {
                                frmReceiptVoucher = new frmReceiptVoucher();
                                frmReceiptVoucher.MdiParent = formMDI.MDIObj;
                                frmReceiptVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Journal Voucher")
                        {
                            JournalVoucherBll bllJournalMaster = new JournalVoucherBll();
                            decMasterId = bllJournalMaster.JournalMasterIdView(decVouchertypeId, strVoucherNo);
                            frmJournalVoucher frmJournalVoucher = new frmJournalVoucher();
                            frmJournalVoucher = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher;
                            if (frmJournalVoucher == null)
                            {
                                frmJournalVoucher = new frmJournalVoucher();
                                frmJournalVoucher.MdiParent = formMDI.MDIObj;
                                frmJournalVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "PDC Receivable")
                        {
                            PDCRecivebleBll BllPDCReciveble = new PDCRecivebleBll();
                            decMasterId = BllPDCReciveble.PdcReceivableMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPdcReceivable frmPdcReceivable = new frmPdcReceivable();
                            frmPdcReceivable = Application.OpenForms["frmPdcReceivable"] as frmPdcReceivable;
                            if (frmPdcReceivable == null)
                            {
                                frmPdcReceivable = new frmPdcReceivable();
                                frmPdcReceivable.MdiParent = formMDI.MDIObj;
                                frmPdcReceivable.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "PDC Payable")
                        {
                            PDCPayableBll BllPDCPayable = new PDCPayableBll();
                            decMasterId = BllPDCPayable.PdcPayableMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPdcPayable frmPdcPayable = new frmPdcPayable();
                            frmPdcPayable = Application.OpenForms["frmPdcPayable"] as frmPdcPayable;
                            if (frmPdcPayable == null)
                            {
                                frmPdcPayable = new frmPdcPayable();
                                frmPdcPayable.MdiParent = formMDI.MDIObj;
                                frmPdcPayable.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Sales Invoice")
                        {
                            //SalesMasterSP spMaster = new SalesMasterSP();
                            SalesInvoiceBll BllSalesInvoice = new SalesInvoiceBll();
                            decMasterId = BllSalesInvoice.SalesMasterIdViewByvoucherNoAndVoucherType(decVouchertypeId, strVoucherNo);
                            //SalesMasterSP spSalesMaster = new SalesMasterSP();
                            bool blPOS = BllSalesInvoice.DayBookSalesInvoiceOrPOS(decMasterId, decVouchertypeId);
                            frmSalesInvoice frmSalesInvoice = new frmSalesInvoice();
                            frmPOS frmPOS = new frmPOS();
                            if (blPOS == true)
                            {
                                frmPOS = Application.OpenForms["frmPOS"] as frmPOS;
                                if (frmPOS == null)
                                {
                                    frmPOS = new frmPOS();
                                    frmPOS.MdiParent = formMDI.MDIObj;
                                    frmPOS.callFromAgeing(this, decMasterId);
                                    this.Enabled = false;
                                }
                            }
                            else
                            {
                                frmSalesInvoice = Application.OpenForms["frmSalesInvoice"] as frmSalesInvoice;
                                if (frmSalesInvoice == null)
                                {
                                    frmSalesInvoice = new frmSalesInvoice();
                                    frmSalesInvoice.MdiParent = formMDI.MDIObj;
                                    frmSalesInvoice.callFromAgeing(this, decMasterId);
                                    this.Enabled = false;
                                }
                            }
                        }
                        else if (strVoucherType == "Purchase Invoice")
                        {
                            PurchaseInvoiceBll BllPurchaseInvoice = new PurchaseInvoiceBll();
                            decMasterId = BllPurchaseInvoice.PurchaseMasterIdViewByvoucherNoAndVoucherType(decVouchertypeId, strVoucherNo);
                            frmPurchaseInvoice objpurchase = new frmPurchaseInvoice();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                        else if (strVoucherType == "Credit Note")
                        {
                            CreditNoteBll BllCreditNoteMaster = new CreditNoteBll();
                            decMasterId = BllCreditNoteMaster.CreditNoteMasterIdView(decVouchertypeId, strVoucherNo);
                            frmCreditNote objpurchase = new frmCreditNote();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                        else if (strVoucherType == "Debit Note")
                        {
                            //DebitNoteMasterSP spDebitNote = new DebitNoteMasterSP();
                            DebitNoteBll bllDebitNote = new DebitNoteBll();
                            decMasterId = bllDebitNote.DebitNoteMasterIdView(decVouchertypeId, strVoucherNo);
                            frmDebitNote objpurchase = new frmDebitNote();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("AR17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// On form closing
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPurchaseInvoice_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (frmPurchaseInvoiceRegisterObj != null)
         {
             frmPurchaseInvoiceRegisterObj.Enabled = true;
             frmPurchaseInvoiceRegisterObj.GridFill();
             frmPurchaseInvoiceRegisterObj = null;
         }
         if (frmPurchaseReportObj != null)
         {
             frmPurchaseReportObj.Enabled = true;
             frmPurchaseReportObj.GridFill();
             frmPurchaseReportObj = null;
         }
         if (frmDayBookObj != null)
         {
             frmDayBookObj.Enabled = true;
             frmDayBookObj.dayBookGridFill();
             frmDayBookObj = null;
         }
         if (frmLedgerDetailsObj != null)
         {
             frmLedgerDetailsObj.Enabled = true;
             frmLedgerDetailsObj.LedgerDetailsView();
             frmLedgerDetailsObj = null;
         }
         if (objVoucherProduct != null)
         {
             objVoucherProduct.Enabled = true;
             objVoucherProduct.FillGrid();
             objVoucherProduct = null;
         }
         if (objVoucherSearch != null)
         {
             objVoucherSearch.Enabled = true;
             objVoucherSearch.GridFill();
             objVoucherSearch = null;
         }
         if (frmAgeingObj != null)
         {
             frmAgeingObj.Enabled = true;
             frmAgeingObj.FillGrid();
             frmAgeingObj = null;
         }
         if (vatReturnReportobj != null)
         {
             vatReturnReportobj.Enabled = true;
             vatReturnReportobj.GridFill();
             vatReturnReportobj = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PI67:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// On form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmJournalVoucher_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                if (journalRegisterObj != null)
                {
                    journalRegisterObj.Enabled = true;
                    journalRegisterObj.SearchRegister();
                }
                else if (frmJournalReportObj != null)
                {
                    frmJournalReportObj.Enabled = true;
                    frmJournalReportObj.Search();
                }
                if (frmBillallocationObj != null)
                {
                    frmBillallocationObj.Enabled = true;
                    frmBillallocationObj.BillAllocationGridFill();
                }
                if (frmDayBookObj != null)
                {
                    frmDayBookObj.Enabled = true;
                    frmDayBookObj.dayBookGridFill();
                    frmDayBookObj = null;
                }
                if (frmAgeingObj != null)
                {
                    frmAgeingObj.Enabled = true;
                    frmAgeingObj.FillGrid();
                    frmAgeingObj = null;
                }
                if (objVoucherSearch != null)
                {
                    objVoucherSearch.Enabled = true;
                    objVoucherSearch.GridFill();
                }
                if (frmLedgerDetailsObj != null)
                {
                    frmLedgerDetailsObj.Enabled = true;
                    frmLedgerDetailsObj.LedgerDetailsView();
                    frmLedgerDetailsObj = null;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("JV56:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Function to call this form from frmLedgerDetails to view details and for updation
 /// </summary>
 /// <param name="frmledgerdetails"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails frmledgerdetails, decimal decMasterId)
 {
     try
     {
         frmLedgerDetailsObj = frmledgerdetails;
         frmLedgerDetailsObj.Enabled = false;
         base.Show();
         isInEditMode = true;
         btnDelete.Enabled = true;
         decPDCReceivableEditId = decMasterId;
         FillFunction();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR30:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// When doubleclicking on the grid
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvAccountGroupWiseReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             decimal decLedgerId = Convert.ToDecimal(dgvAccountGroupWiseReport.Rows[e.RowIndex].Cells["dgvtxtLedgerId"].Value.ToString());
             if (Convert.ToInt32(dgvAccountGroupWiseReport.Rows[e.RowIndex].Cells["dgvtxtAccountGroupId"].Value.ToString()) != -2)
             {
                 decAccountGroupId = Convert.ToDecimal(dgvAccountGroupWiseReport.Rows[e.RowIndex].Cells["dgvtxtAccountGroupId"].Value.ToString());
                 arrlstGroupId.Add(decAccountGroupId);
                 GridFill();
             }
             else if (Convert.ToInt32(dgvAccountGroupWiseReport.Rows[e.RowIndex].Cells["dgvtxtLedgerId"].Value.ToString()) != 0)
             {
                 frmLedgerDetails frmLedgerDetailsObj = new frmLedgerDetails();
                 frmLedgerDetailsObj.MdiParent = formMDI.MDIObj;
                 
                 frmLedgerDetailsObj.CallFromAccountGroupWiseReport(this, decLedgerId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text));
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("AGWREP21:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Function to load the form while calling from LedgerDetails form
        /// </summary>
        /// <param name="frmLedgerDetails"></param>
        /// <param name="decMasterId"></param>
        public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId)
        {
            try
            {
                base.Show();
                frmLedgerDetailsObj = frmLedgerDetails;
                frmLedgerDetailsObj.Enabled = false;
                isEditMode = true;
                btnDelete.Enabled = true;
                decJournalMasterIdForEdit = decMasterId;
                FillFunction();
            }
            catch (Exception ex)
            {
                MessageBox.Show("JV38:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Ejemplo n.º 9
0
 /// <summary>
 /// Form closing event, checking the other opend form status
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmSalesReturn_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (objFromSalesReturnRegister != null)
         {
             objFromSalesReturnRegister.SalesReturnGrideFill();
             objFromSalesReturnRegister.Enabled = true;
         }
         if (objFromSalesReturnReport != null)
         {
             objFromSalesReturnReport.SalesReturnReportGrideFill();
             objFromSalesReturnReport.Enabled = true;
         }
         if (frmDayBookObj != null)
         {
             frmDayBookObj.Enabled = true;
             frmDayBookObj.dayBookGridFill();
             frmDayBookObj = null;
         }
         if (frmAgeingObj != null)
         {
             frmAgeingObj.Enabled = true;
             frmAgeingObj.FillGrid();
             frmAgeingObj = null;
         }
         if (frmLedgerDetailsObj != null)
         {
             frmLedgerDetailsObj.Enabled = true;
             frmLedgerDetailsObj.LedgerDetailsView();
             frmLedgerDetailsObj = null;
         }
         if (objVoucherSearch != null)
         {
             objVoucherSearch.Enabled = true;
             objVoucherSearch.GridFill();
             objVoucherSearch = null;
         }
         if (objVoucherProduct != null)
         {
             objVoucherProduct.Enabled = true;
             objVoucherProduct.FillGrid();
             objVoucherProduct = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SR80:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// When doubleclicking on the grid
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvAccountLedgerReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             if (dgvAccountLedgerReport.CurrentRow != null)
             {
                 decimal decLedgerId = Convert.ToDecimal(dgvAccountLedgerReport.CurrentRow.Cells["dgvtxLedgerId"].Value.ToString());
                 frmLedgerDetails frmLedgerDetailsObj = new frmLedgerDetails();
                 frmLedgerDetailsObj.MdiParent = formMDI.MDIObj;
                 frmLedgerDetailsObj.CallFromAccountLedgerReport(this, decLedgerId, dtFromDate, dtTodate);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ALREP15:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 ///  Function to call this form from frmLedgerDetails to view details and for updation
 /// </summary>
 /// <param name="frmLedgerDetails"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId)
 {
     try
     {
         base.Show();
         frmLedgerDetailsObj = frmLedgerDetails;
         frmLedgerDetailsObj.Enabled = false;
         salesReturnMasterId = decMasterId;
         isFromSalesReturnReport = true;
         isInvoiceFill = true;
         FillRegisterOrReport();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SR71:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Form closing, Checking the other forms is opend or not
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPdcPayable_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (PDCPayableRegisterObj != null)
         {
             PDCPayableRegisterObj.Enabled = true;
             PDCPayableRegisterObj.GridSearchRegister();
         }
         if (PDCpayableReportObj != null)
         {
             PDCpayableReportObj.Enabled = true;
             PDCpayableReportObj.Search();
         }
         if (BillallocationObj != null)
         {
             BillallocationObj.Enabled = true;
             BillallocationObj.BillAllocationGridFill();
         }
         if (frmDayBookObj != null)
         {
             frmDayBookObj.Enabled = true;
             frmDayBookObj.dayBookGridFill();
             frmDayBookObj = null;
         }
         if (frmAgeingObj != null)
         {
             frmAgeingObj.Enabled = true;
             frmAgeingObj.FillGrid();
         }
         if (frmLedgerDetailsObj != null)
         {
             frmLedgerDetailsObj.Activate();
             frmLedgerDetailsObj.Enabled = true;
             frmLedgerDetailsObj.LedgerDetailsView();
             frmLedgerDetailsObj = null;
         }
         if (frmVoucherSearch != null)
         {
             frmVoucherSearch.Enabled = true;
             frmVoucherSearch.GridFill();
         }
         if (frmChequeReportObj != null)
         {
             frmChequeReportObj.Enabled = true;
             frmChequeReportObj.ChequeReportFillGrid();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP48:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// On clear button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnClear_Click(object sender, EventArgs e)
 {
     try
     {
         Clear();
         if (frmAgeingObj != null)
         {
             frmAgeingObj.Close();
             frmAgeingObj = null;
         }
         if (frmDayBookObj != null)
         {
             frmDayBookObj.Close();
             frmDayBookObj = null;
         }
         if (frmLedgerDetailsObj != null)
         {
             frmLedgerDetailsObj.Close();
             frmLedgerDetailsObj = null;
         }
         if (frmLedgerPopupObj != null)
         {
             frmLedgerPopupObj.Close();
             frmLedgerPopupObj = null;
         }
         if (frmProductSearchPopupObj != null)
         {
             frmProductSearchPopupObj.Close();
             frmProductSearchPopupObj = null;
         }
         if (frmPurchaseInvoiceRegisterObj != null)
         {
             frmPurchaseInvoiceRegisterObj.Close();
             frmPurchaseInvoiceRegisterObj = null;
         }
         if (frmPurchaseReportObj != null)
         {
             frmPurchaseReportObj.Close();
             frmPurchaseReportObj = null;
         }
         if (vatReturnReportobj != null)
         {
             vatReturnReportobj.Close();
             vatReturnReportobj = null;
         }
         if (objVoucherSearch != null)
         {
             objVoucherSearch.Close();
             objVoucherSearch = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PI106:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Function for frmLedgerdetails
 /// </summary>
 /// <param name="frmLedgerDetails"></param>
 /// <param name="decMasterId"></param>
 /// <param name="isFromReport"></param>
 public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId, bool isFromReport)
 {
     try
     {
         base.Show();
         frmLedgerDetailsObj = frmLedgerDetails;
         decPurchaseReturnMasterId = decMasterId;
         isFromPurchaseReturn = isFromReport;
         isInvoiceFil = true;
         FillRegisterOrReport();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:64" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Enables the object of other forms on Form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAdvancePayment_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                if (frmAdvanceRegisterObj != null)
                {
                    frmAdvanceRegisterObj.Enabled = true;

                    frmAdvanceRegisterObj.Clear();
                }
                if (objVoucherSearch != null)
                {
                    objVoucherSearch.Enabled = true;
                    objVoucherSearch.GridFill();
                    objVoucherSearch.Activate();
                }
                if (frmDayBookObj != null)
                {
                    frmDayBookObj.Enabled = true;
                    frmDayBookObj.dayBookGridFill();
                    frmDayBookObj.Activate();
                    frmDayBookObj = null;
                }
                if (frmLedgerDetailsObj != null)
                {
                    frmLedgerDetailsObj.Enabled = true;
                    frmLedgerDetailsObj.LedgerDetailsView();
                    frmLedgerDetailsObj.Activate();
                    frmLedgerDetailsObj = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("AP26:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Function to call this form from frmLedgerDetails to view details and for updation
 /// </summary>
 /// <param name="LedgerDetailsObj"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails LedgerDetailsObj, decimal decMasterId)
 {
     try
     {
         IsSetGridValueChange = false;
         base.Show();
         frmledgerDetailsObj = LedgerDetailsObj;
         frmledgerDetailsObj.Enabled = false;
         decSalesInvoiceIdToEdit = decMasterId;
         FillRegisterOrReport();
         IsSetGridValueChange = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 83" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to call this form from frmLedgerDetails to view details for updation
        /// </summary>
        /// <param name="frmLedgerDetails"></param>
        /// <param name="decMasterId"></param>
        public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId)
        {
            try
            {
                base.Show();
                decAdvancePaymentEditId = decMasterId;
                frmLedgerDetailsObj = frmLedgerDetails;
                frmLedgerDetailsObj.Enabled = false;
                fillFunction();

            }
            catch (Exception ex)
            {
                MessageBox.Show("AP21:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 18
0
 /// <summary>
 /// On Clear button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnClear_Click(object sender, EventArgs e)
 {
     try
     {
         clear();
         if (frmJournalReportObj != null)
         {
             frmJournalReportObj.Close();
             frmJournalReportObj = null;
         }
         if (journalRegisterObj != null)
         {
             journalRegisterObj.Close();
             journalRegisterObj = null;
         }
         if (frmDayBookObj != null)
         {
             frmDayBookObj.Close();
             frmDayBookObj = null;
         }
         if (frmAgeingObj != null)
         {
             frmAgeingObj.Close();
             frmAgeingObj = null;
         }
         if (frmLedgerDetailsObj != null)
         {
             frmLedgerDetailsObj.Enabled = true;
             frmLedgerDetailsObj = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("JV47:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Function to call this form from frmLedgerDetails to view details and for updation
        /// </summary>
        /// <param name="frmLedgerDetails"></param>
        /// <param name="decMasterId"></param>
        public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId)
        {
            try
            {

                base.Show();
                frmLedgerDetailsObj = frmLedgerDetails;
                frmLedgerDetailsObj.Enabled = false;
                isInEditMode = true;
                btnDelete.Enabled = true;
                decPDCClearanceEditId = decMasterId;
                PDCClearanceMasterSP spPDCClearance = new PDCClearanceMasterSP();
                decMasterIdEdit = spPDCClearance.PDCClearanceAgainstIdUnderClearanceId(decPDCClearanceEditId);
                FillFunction();
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC15:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Clear button click and checking the other forms is opend or not and close it if its opend
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            try
            {
                Clear();
                if (frmAgeingObj != null)
                {
                    frmAgeingObj.Close();
                    frmAgeingObj = null;
                }
                if (frmChequeReportObj != null)
                {
                    frmChequeReportObj.Close();
                    frmChequeReportObj = null;
                }
                if (frmContraRegisterObj != null)
                {
                    frmContraRegisterObj.Close();
                    frmContraRegisterObj = null;
                }

                if (frmContraReportObj != null)
                {
                    frmContraReportObj.Close();
                    frmContraReportObj = null;
                }
                if (frmCurrencyObj != null)
                {
                    frmCurrencyObj.Close();
                    frmCurrencyObj = null;
                }
                if (frmDayBookObj != null)
                {
                    frmDayBookObj.Close();
                    frmDayBookObj = null;
                }
                if (frmLedgerDetailsObj != null)
                {
                    frmLedgerDetailsObj.Close();
                    frmLedgerDetailsObj = null;
                }
                if (frmLedgerPopupObj != null)
                {
                    frmLedgerPopupObj.Close();
                    frmLedgerPopupObj = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CV:40" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// When doubleclicking on the grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvReport_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            decimal decVouchertypeId = 0;
            string  strVoucherNo     = string.Empty;

            try
            {
                if (dgvReport.CurrentRow.Index == e.RowIndex)
                {
                    if ((dgvReport.CurrentRow.Cells["voucherTypeId"].Value != null && dgvReport.CurrentRow.Cells["voucherTypeId"].Value.ToString() != string.Empty))
                    {
                        int inI = dgvReport.CurrentCell.RowIndex;
                        foreach (DataGridViewRow dgv in dgvReport.Rows)
                        {
                            if (dgv.Cells["VoucherNo"].Value != null && dgv.Cells["VoucherNo"].Value.ToString() != string.Empty &&
                                dgv.Cells["voucherTypeId"].Value != null && dgv.Cells["voucherTypeId"].Value.ToString() != string.Empty)
                            {
                                strVoucherType   = dgv.Cells["VoucherType"].Value.ToString();
                                decVouchertypeId = Convert.ToDecimal(dgv.Cells["voucherTypeId"].Value.ToString());
                                strVoucherNo     = dgv.Cells["VoucherNo"].Value.ToString();
                            }
                            else
                            {
                                if (dgv.Cells["ledgerId"].Value.ToString() != string.Empty)
                                {
                                    decledgerId    = decimal.Parse(dgv.Cells["ledgerId"].Value.ToString());
                                    strVoucherType = dgv.Cells["Account Ledger"].Value.ToString();
                                    frmLedgerDetails frmLedger = new frmLedgerDetails();
                                    frmLedger = Application.OpenForms["frmLedgerDetails"] as frmLedgerDetails;
                                    if (frmLedger == null)
                                    {
                                        frmLedger           = new frmLedgerDetails();
                                        frmLedger.MdiParent = formMDI.MDIObj;
                                        frmLedger.callFromAgeing(this, decledgerId);
                                        this.Enabled = false;
                                    }
                                }
                            }
                            if (dgv.Index == inI)
                            {
                                break;
                            }
                        }
                        if (strVoucherType == "Payment Voucher")
                        {
                            PaymentMasterSP spPaymentMaster = new PaymentMasterSP();
                            decMasterId = spPaymentMaster.paymentMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPaymentVoucher frmPaymentVoucher = new frmPaymentVoucher();
                            frmPaymentVoucher = Application.OpenForms["frmPaymentVoucher"] as frmPaymentVoucher;
                            if (frmPaymentVoucher == null)
                            {
                                frmPaymentVoucher           = new frmPaymentVoucher();
                                frmPaymentVoucher.MdiParent = formMDI.MDIObj;
                                frmPaymentVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Receipt Voucher")
                        {
                            ReceiptMasterSP spRecieptMaster = new ReceiptMasterSP();
                            decMasterId = spRecieptMaster.ReceiptMasterIdView(decVouchertypeId, strVoucherNo);
                            frmReceiptVoucher frmReceiptVoucher = new frmReceiptVoucher();
                            frmReceiptVoucher = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher;
                            if (frmReceiptVoucher == null)
                            {
                                frmReceiptVoucher           = new frmReceiptVoucher();
                                frmReceiptVoucher.MdiParent = formMDI.MDIObj;
                                frmReceiptVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Journal Voucher")
                        {
                            JournalMasterSP spJournalMaster = new JournalMasterSP();
                            decMasterId = spJournalMaster.JournalMasterIdView(decVouchertypeId, strVoucherNo);
                            frmJournalVoucher frmJournalVoucher = new frmJournalVoucher();
                            frmJournalVoucher = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher;
                            if (frmJournalVoucher == null)
                            {
                                frmJournalVoucher           = new frmJournalVoucher();
                                frmJournalVoucher.MdiParent = formMDI.MDIObj;
                                frmJournalVoucher.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "PDC Receivable")
                        {
                            PDCReceivableMasterSP spPdcRecievabl = new PDCReceivableMasterSP();
                            decMasterId = spPdcRecievabl.PdcReceivableMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPdcReceivable frmPdcReceivable = new frmPdcReceivable();
                            frmPdcReceivable = Application.OpenForms["frmPdcReceivable"] as frmPdcReceivable;
                            if (frmPdcReceivable == null)
                            {
                                frmPdcReceivable           = new frmPdcReceivable();
                                frmPdcReceivable.MdiParent = formMDI.MDIObj;
                                frmPdcReceivable.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "PDC Payable")
                        {
                            PDCPayableMasterSP spPdcPayable = new PDCPayableMasterSP();
                            decMasterId = spPdcPayable.PdcPayableMasterIdView(decVouchertypeId, strVoucherNo);
                            frmPdcPayable frmPdcPayable = new frmPdcPayable();
                            frmPdcPayable = Application.OpenForms["frmPdcPayable"] as frmPdcPayable;
                            if (frmPdcPayable == null)
                            {
                                frmPdcPayable           = new frmPdcPayable();
                                frmPdcPayable.MdiParent = formMDI.MDIObj;
                                frmPdcPayable.callFromAgeing(this, decMasterId);
                                this.Enabled = false;
                            }
                        }
                        else if (strVoucherType == "Sales Invoice")
                        {
                            SalesMasterSP spMaster = new SalesMasterSP();
                            decMasterId = spMaster.SalesMasterIdViewByvoucherNoAndVoucherType(decVouchertypeId, strVoucherNo);
                            SalesMasterSP   spSalesMaster   = new SalesMasterSP();
                            bool            blPOS           = spSalesMaster.DayBookSalesInvoiceOrPOS(decMasterId, decVouchertypeId);
                            frmSalesInvoice frmSalesInvoice = new frmSalesInvoice();
                            frmPOS          frmPOS          = new frmPOS();
                            if (blPOS == true)
                            {
                                frmPOS = Application.OpenForms["frmPOS"] as frmPOS;
                                if (frmPOS == null)
                                {
                                    frmPOS           = new frmPOS();
                                    frmPOS.MdiParent = formMDI.MDIObj;
                                    frmPOS.callFromAgeing(this, decMasterId);
                                    this.Enabled = false;
                                }
                            }
                            else
                            {
                                frmSalesInvoice = Application.OpenForms["frmSalesInvoice"] as frmSalesInvoice;
                                if (frmSalesInvoice == null)
                                {
                                    frmSalesInvoice           = new frmSalesInvoice();
                                    frmSalesInvoice.MdiParent = formMDI.MDIObj;
                                    frmSalesInvoice.callFromAgeing(this, decMasterId);
                                    this.Enabled = false;
                                }
                            }
                        }
                        else if (strVoucherType == "Purchase Invoice")
                        {
                            PurchaseMasterSP spPurchaseMaster = new PurchaseMasterSP();
                            decMasterId = spPurchaseMaster.PurchaseMasterIdViewByvoucherNoAndVoucherType(decVouchertypeId, strVoucherNo);
                            frmPurchaseInvoice objpurchase = new frmPurchaseInvoice();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent   = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                        else if (strVoucherType == "Credit Note")
                        {
                            CreditNoteMasterSP spCreditNoteMaster = new CreditNoteMasterSP();
                            decMasterId = spCreditNoteMaster.CreditNoteMasterIdView(decVouchertypeId, strVoucherNo);
                            frmCreditNote objpurchase = new frmCreditNote();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent   = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                        else if (strVoucherType == "Debit Note")
                        {
                            DebitNoteMasterSP spDebitNote = new DebitNoteMasterSP();
                            decMasterId = spDebitNote.DebitNoteMasterIdView(decVouchertypeId, strVoucherNo);
                            frmDebitNote objpurchase = new frmDebitNote();
                            objpurchase.WindowState = FormWindowState.Normal;
                            objpurchase.MdiParent   = formMDI.MDIObj;
                            objpurchase.callFromAgeing(this, decMasterId);
                            this.Enabled = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "AR17:" + ex.Message;
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Function to call this form from frmLedgerDetails to view and update
        /// </summary>
        /// <param name="frmLedgerDetails"></param>
        /// <param name="decMasterId"></param>
        public void CallFromLedgerDetails(frmLedgerDetails frmLedgerDetails, decimal decMasterId)
        {
            try
            {
                isEditMode = true;
                decIsEditModeMasterId = decMasterId;
                base.Show();
                btnDelete.Enabled = true;
                btnSave.Text = "Update";
                frmLedgerDetailsObj = frmLedgerDetails;
                frmLedgerDetailsObj.Enabled = false;
                FillFunction();

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

        }
Ejemplo n.º 23
0
        /// <summary>
        /// On Clear button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, EventArgs e)
        {
            try
            {
                clear();
                if (frmAgeingObj != null)
                {
                    frmAgeingObj.Close();
                    frmAgeingObj = null;
                }
                if (frmBillallocationObj != null)
                {
                    frmBillallocationObj.Close();
                    frmBillallocationObj = null;
                }
                if (frmCurrencyObj != null)
                {
                    frmCurrencyObj.Close();
                    frmCurrencyObj = null;
                }
                if (frmCreditNoteReportObj != null)
                {
                    frmCreditNoteReportObj.Close();
                    frmCreditNoteReportObj = null;
                }
                if (CreditNoteRegisterObj != null)
                {
                    CreditNoteRegisterObj.Close();
                    CreditNoteRegisterObj = null;
                }

                if (frmLedgerDetailsObj != null)
                {
                    frmLedgerDetailsObj.Close();
                    frmLedgerDetailsObj = null;
                }

                if (frmPartyBalanceObj != null)
                {
                    frmPartyBalanceObj.Close();
                    frmPartyBalanceObj = null;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("CRNT:51" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Function to call this form from frmLedgerDetails to view details and for updation
 /// </summary>
 /// <param name="ledgerDetailsObj"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails ledgerDetailsObj, decimal decMasterId)
 {
     try
     {
         base.Show();
         frmLedgerDetailsObj = ledgerDetailsObj;
         frmLedgerDetailsObj.Enabled = false;
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         isEditMode = true;
         txtVoucherDate.Select();
         this.decMasterId = decMasterId;
         FillFunction();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV36 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Function to call this form from frmLedgerDetails to view details and for updation
 /// </summary>
 /// <param name="LedgerDetailsObj"></param>
 /// <param name="decMasterId"></param>
 public void CallFromLedgerDetails(frmLedgerDetails LedgerDetailsObj, decimal decMasterId)
 {
     try
     {
         base.Show();
         frmLedgerDetailsObj = LedgerDetailsObj;
         frmLedgerDetailsObj.Enabled = false;
         decPurchaseMasterId = decMasterId;
         FillRegisterOrReport();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PI63:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }