/// <summary>
        /// Fill all the controlls while coming from other forms for update or delete
        /// </summary>
        public void FillFunction()
        {
            try
            {
                ContraVoucherDetailsBll bllContraVoucherDetails = new ContraVoucherDetailsBll();
                ContraMasterInfo infoContraMaster = new ContraMasterInfo();
                LedgerPostingBll BllLedgerPosting = new LedgerPostingBll();
                VoucherTypeBll BllVOucherType = new VoucherTypeBll();
                infoContraMaster = bllContraVoucherDetails.ContraMasterView(decMasterId);
                txtVoucherNo.ReadOnly = false;
                strVoucherNo = infoContraMaster.VoucherNo;
                txtVoucherNo.Text = infoContraMaster.InvoiceNo;
                strInvoiceNo = infoContraMaster.InvoiceNo;
                strInvoiceNo = infoContraMaster.InvoiceNo;
                decContraSuffixPrefixId = Convert.ToDecimal(infoContraMaster.SuffixPrefixId.ToString());
                DecContraVoucherTypeId = Convert.ToDecimal(infoContraMaster.VoucherTypeId.ToString());
                int inDecimalPlace = PublicVariables._inNoOfDecimalPlaces;
                txtNarration.Text = infoContraMaster.Narration;
                txtContraVoucherDate.Text = Convert.ToString(infoContraMaster.date);
                cmbBankAccount.SelectedValue = infoContraMaster.LedgerId;
                strVoucherNo = infoContraMaster.VoucherNo;
                if (infoContraMaster.Type == "Deposit")
                {
                    rbtnDeposit.Checked = true;
                }
                else
                {
                    rbtnWithdrawal.Checked = true;
                }
                isAutomatic = BllVOucherType.CheckMethodOfVoucherNumbering(DecContraVoucherTypeId);
                if (isAutomatic)
                {
                    txtVoucherNo.Enabled = false;
                }
                else
                {
                    txtVoucherNo.Enabled = true;
                }

                List<DataTable> listObj = new List<DataTable>();
                listObj = bllContraVoucherDetails.ContraDetailsViewWithMasterId(decMasterId);
                for (int i = 0; i < listObj[0].Rows.Count; i++)
                {
                    dgvContraVoucher.Rows.Add();
                    dgvContraVoucher.Rows[i].Cells["dgvcmbBankorCashAccount"].Value = Convert.ToDecimal(listObj[0].Rows[i]["ledgerId"].ToString());
                    dgvContraVoucher.Rows[i].Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(listObj[0].Rows[i]["exchangeRateId"].ToString());
                    dgvContraVoucher.Rows[i].Cells["dgvtxtAmount"].Value = Convert.ToDecimal(listObj[0].Rows[i]["amount"].ToString());

                    if (listObj[0].Rows[i]["chequeNo"].ToString() != string.Empty)
                    {
                        dgvContraVoucher.Rows[i].Cells["dgvtxtChequeNo"].Value = listObj[0].Rows[i]["chequeNo"].ToString();
                        if (listObj[0].Rows[i]["chequeDate"].ToString() == "01 Jan 1753")
                        {
                            dgvContraVoucher.Rows[i].Cells["dgvtxtChequeDate"].Value = null;
                        }
                        else
                        {
                            dgvContraVoucher.Rows[i].Cells["dgvtxtChequeDate"].Value = listObj[0].Rows[i]["chequeDate"].ToString();
                        }
                    }
                    dgvContraVoucher.Rows[i].Cells["dgvtxtDetailsId"].Value = listObj[0].Rows[i]["contraDetailsId"].ToString();
                    decimal decDetailsId1 = Convert.ToDecimal(listObj[0].Rows[i]["contraDetailsId"].ToString());
                    decimal decLedgerPostingId = BllLedgerPosting.LedgerPostingIdFromDetailsId(decDetailsId1, strVoucherNo, DecContraVoucherTypeId);
                    dgvContraVoucher.Rows[i].Cells["dgvtxtLedgerPostingId"].Value = decLedgerPostingId.ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CV:31" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }