/// <summary>
        /// These function for generating the voucher no automatically if its automatic with preffix and sufix
        /// </summary>
        public void VoucherNumberGeneration()
        {
            try
            {
                TransactionsGeneralFillBll obj = new TransactionsGeneralFillBll();
                //ContraMasterSP spContraMaster = new ContraMasterSP();
                ContraVoucherDetailsBll bllContraVoucherDetails = new ContraVoucherDetailsBll();
                if (strVoucherNo == string.Empty)
                {
                    strVoucherNo = "0";
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecContraVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpContraVoucherDate.Value, tableName);
                if (Convert.ToDecimal(strVoucherNo) != bllContraVoucherDetails.ContraVoucherMasterGetMaxPlusOne(DecContraVoucherTypeId))
                {
                    strVoucherNo = bllContraVoucherDetails.ContraVoucherMasterGetMax(DecContraVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecContraVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpContraVoucherDate.Value, tableName);
                    if (bllContraVoucherDetails.ContraVoucherMasterGetMax(DecContraVoucherTypeId) == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecContraVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpContraVoucherDate.Value, tableName);
                    }
                }
                if (isAutomatic)
                {
                    SuffixPrefixSettingsBll BllSuffixPrefixSettings = new SuffixPrefixSettingsBll();

                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                    infoSuffixPrefix = BllSuffixPrefixSettings.GetSuffixPrefixDetails(DecContraVoucherTypeId, dtpContraVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    decContraSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CV:08" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }