示例#1
0
        /// <summary>
        /// Function to Update values in PDCPayableMaster Table
        /// </summary>
        /// <param name="pdcpayablemasterinfo"></param>
        public void PDCPayableMasterEdit(PDCPayableMasterInfo pdcpayablemasterinfo)
        {
            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("PDCPayableMasterEdit", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@pdcPayableMasterId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.PdcPayableMasterId;
                sprmparam       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.VoucherNo;
                sprmparam       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.InvoiceNo;
                sprmparam       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.SuffixPrefixId;
                sprmparam       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
                sprmparam.Value = pdcpayablemasterinfo.Date;
                sprmparam       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.LedgerId;
                sprmparam       = sccmd.Parameters.Add("@amount", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.Amount;
                sprmparam       = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.ChequeNo;
                sprmparam       = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
                sprmparam.Value = pdcpayablemasterinfo.ChequeDate;
                sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.Narration;
                sprmparam       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.UserId;
                sprmparam       = sccmd.Parameters.Add("@bankId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.BankId;
                sprmparam       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.VoucherTypeId;
                sprmparam       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
                sprmparam.Value = pdcpayablemasterinfo.FinancialYearId;

                sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.Extra1;
                sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam.Value = pdcpayablemasterinfo.Extra2;
                sccmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqlcon.Close();
            }
        }
示例#2
0
 /// <summary>
 /// Function to insert values to PDCPayableMaster Table
 /// </summary>
 /// <param name="pdcpayablemasterinfo"></param>
 /// <returns></returns>
 public decimal PDCPayableMasterAdd(PDCPayableMasterInfo pdcpayablemasterinfo)
 {
     decimal decIdentity = 0;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("PDCPayableMasterAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.VoucherNo;
         sprmparam = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.InvoiceNo;
         sprmparam = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.SuffixPrefixId;
         sprmparam = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam.Value = pdcpayablemasterinfo.Date;
         sprmparam = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.LedgerId;
         sprmparam = sccmd.Parameters.Add("@amount", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.Amount;
         sprmparam = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.ChequeNo;
         sprmparam = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
         sprmparam.Value = pdcpayablemasterinfo.ChequeDate;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.Narration;
         sprmparam = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.UserId;
         sprmparam = sccmd.Parameters.Add("@bankId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.BankId;
         sprmparam = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.VoucherTypeId;
         sprmparam = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
         sprmparam.Value = pdcpayablemasterinfo.FinancialYearId;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = pdcpayablemasterinfo.Extra2;
         decIdentity = Convert.ToDecimal(sccmd.ExecuteScalar().ToString());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
     return decIdentity;
 }
示例#3
0
        /// <summary>
        /// Function to get particular values from PDCPayableMaster table based on the parameter
        /// </summary>
        /// <param name="pdcPayableMasterId"></param>
        /// <returns></returns>
        public PDCPayableMasterInfo PDCPayableMasterView(decimal pdcPayableMasterId)
        {
            PDCPayableMasterInfo pdcpayablemasterinfo = new PDCPayableMasterInfo();
            SqlDataReader        sdrreader            = null;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("PDCPayableMasterView", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@pdcPayableMasterId", SqlDbType.Decimal);
                sprmparam.Value = pdcPayableMasterId;
                sdrreader       = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    pdcpayablemasterinfo.PdcPayableMasterId = decimal.Parse(sdrreader[0].ToString());
                    pdcpayablemasterinfo.VoucherNo          = sdrreader[1].ToString();
                    pdcpayablemasterinfo.InvoiceNo          = sdrreader[2].ToString();
                    pdcpayablemasterinfo.SuffixPrefixId     = decimal.Parse(sdrreader[3].ToString());
                    pdcpayablemasterinfo.Date            = DateTime.Parse(sdrreader[4].ToString());
                    pdcpayablemasterinfo.LedgerId        = decimal.Parse(sdrreader[5].ToString());
                    pdcpayablemasterinfo.Amount          = decimal.Parse(sdrreader[6].ToString());
                    pdcpayablemasterinfo.ChequeNo        = sdrreader[7].ToString();
                    pdcpayablemasterinfo.ChequeDate      = DateTime.Parse(sdrreader[8].ToString());
                    pdcpayablemasterinfo.Narration       = sdrreader[9].ToString();
                    pdcpayablemasterinfo.UserId          = decimal.Parse(sdrreader[10].ToString());
                    pdcpayablemasterinfo.BankId          = decimal.Parse(sdrreader[11].ToString());
                    pdcpayablemasterinfo.VoucherTypeId   = decimal.Parse(sdrreader[12].ToString());
                    pdcpayablemasterinfo.FinancialYearId = decimal.Parse(sdrreader[13].ToString());
                    pdcpayablemasterinfo.ExtraDate       = DateTime.Parse(sdrreader[14].ToString());
                    pdcpayablemasterinfo.Extra1          = sdrreader[15].ToString();
                    pdcpayablemasterinfo.Extra2          = sdrreader[16].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                sqlcon.Close();
            }
            return(pdcpayablemasterinfo);
        }
示例#4
0
 /// <summary>
 /// Function to get particular values from PDCPayableMaster table based on the parameter
 /// </summary>
 /// <param name="pdcPayableMasterId"></param>
 /// <returns></returns>
 public PDCPayableMasterInfo PDCPayableMasterView(decimal pdcPayableMasterId)
 {
     PDCPayableMasterInfo pdcpayablemasterinfo = new PDCPayableMasterInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("PDCPayableMasterView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@pdcPayableMasterId", SqlDbType.Decimal);
         sprmparam.Value = pdcPayableMasterId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             pdcpayablemasterinfo.PdcPayableMasterId = decimal.Parse(sdrreader[0].ToString());
             pdcpayablemasterinfo.VoucherNo = sdrreader[1].ToString();
             pdcpayablemasterinfo.InvoiceNo = sdrreader[2].ToString();
             pdcpayablemasterinfo.SuffixPrefixId = decimal.Parse(sdrreader[3].ToString());
             pdcpayablemasterinfo.Date = DateTime.Parse(sdrreader[4].ToString());
             pdcpayablemasterinfo.LedgerId = decimal.Parse(sdrreader[5].ToString());
             pdcpayablemasterinfo.Amount = decimal.Parse(sdrreader[6].ToString());
             pdcpayablemasterinfo.ChequeNo = sdrreader[7].ToString();
             pdcpayablemasterinfo.ChequeDate = DateTime.Parse(sdrreader[8].ToString());
             pdcpayablemasterinfo.Narration = sdrreader[9].ToString();
             pdcpayablemasterinfo.UserId = decimal.Parse(sdrreader[10].ToString());
             pdcpayablemasterinfo.BankId = decimal.Parse(sdrreader[11].ToString());
             pdcpayablemasterinfo.VoucherTypeId = decimal.Parse(sdrreader[12].ToString());
             pdcpayablemasterinfo.FinancialYearId = decimal.Parse(sdrreader[13].ToString());
             pdcpayablemasterinfo.ExtraDate = DateTime.Parse(sdrreader[14].ToString());
             pdcpayablemasterinfo.Extra1 = sdrreader[15].ToString();
             pdcpayablemasterinfo.Extra2 = sdrreader[16].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return pdcpayablemasterinfo;
 }
示例#5
0
        /// <summary>
        /// Ledger Posting Function, here saving the curresponding details into the ledger
        /// </summary>
        public void LedgerPostingAdd()
        {
            try
            {
                string strstatus = cmbStatus.Text.ToString();
                LedgerPostingInfo InfoPosting = new LedgerPostingInfo();
                LedgerPostingSP SpLedgerPosting = new LedgerPostingSP();
                AccountLedgerSP SpLedger = new AccountLedgerSP();
                LedgerPostingInfo infoLedgerPosting = new LedgerPostingInfo();
                PDCClearanceMasterSP sppdcClearance = new PDCClearanceMasterSP();
                PDCPayableMasterInfo infoPDCPayable = new PDCPayableMasterInfo();
                PDCPayableMasterSP spPDCPayable = new PDCPayableMasterSP();
                PDCReceivableMasterInfo infoPDCReceivable = new PDCReceivableMasterInfo();
                PDCReceivableMasterSP spPDCReceivable = new PDCReceivableMasterSP();
                strVoucherType = sppdcClearance.TypeOfVoucherReturnUnderVoucherName(cmbvouchertype.Text.ToString());
                if (strVoucherType == "PDC Payable")
                {
                    infoPDCPayable = spPDCPayable.PDCPayableMasterView(Convert.ToDecimal(cmbInvoiceNo.SelectedValue.ToString()));
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = Convert.ToDateTime(txtVoucherDate.Text.ToString());
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text.ToString());
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    if (strstatus == "Cleared")
                    {

                        infoLedgerPosting.LedgerId = infoPDCPayable.BankId;
                        infoLedgerPosting.Debit = 0;
                        infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    }
                    else if (strstatus == "Bounced")
                    {
                        infoLedgerPosting.LedgerId = infoPDCPayable.LedgerId;
                        infoLedgerPosting.Debit = 0;
                        infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    }
                    SpLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.VoucherNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = Convert.ToDateTime(txtVoucherDate.Text.ToString());
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text);
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.LedgerId = 6;
                    infoLedgerPosting.Debit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.Credit = 0;
                    SpLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                }
                else if (strVoucherType == "PDC Receivable")
                {
                    infoPDCReceivable = spPDCReceivable.PDCReceivableMasterView(Convert.ToDecimal(cmbInvoiceNo.SelectedValue.ToString()));
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.LedgerId = 7;
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.Debit = 0;
                    infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text.ToString());
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    SpLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.Date = PublicVariables._dtCurrentDate;
                    if (strstatus == "Cleared")
                    {
                        infoLedgerPosting.LedgerId = infoPDCReceivable.BankId;
                    }
                    else if (strstatus == "Bounced")
                    {
                        infoLedgerPosting.LedgerId = infoPDCReceivable.LedgerId;
                    }
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.Debit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.Credit = 0;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text);
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    SpLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#6
0
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SettingsSP spSettings = new SettingsSP();
         DateValidation Objdatevalidation = new DateValidation();
         OtherDateValidationFunction ObjotherdateValidation = new OtherDateValidationFunction();
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         PartyBalanceSP spPartyBalance = new PartyBalanceSP();
         Objdatevalidation.DateValidationFunction(txtVoucherDate);
         ObjotherdateValidation.DateValidationFunction(txtChequeDate, false);
         DataTable dtblMaster = new DataTable();
         PDCPayableMasterInfo InfoPayable = new PDCPayableMasterInfo();
         PDCPayableMasterSP SpPayable = new PDCPayableMasterSP();
         InfoPayable.VoucherNo = strVoucherNo;
         InfoPayable.InvoiceNo = txtvoucherNo.Text.Trim();
         InfoPayable.Date = DateTime.Parse(txtVoucherDate.Text);
         InfoPayable.LedgerId = Convert.ToDecimal(cmbAccountLedger.SelectedValue.ToString());
         InfoPayable.Amount = decimal.Parse(txtAmount.Text);
         InfoPayable.Narration = txtNarration.Text;
         InfoPayable.ChequeNo = txtcheckNo.Text;
         if (txtChequeDate.Text != string.Empty)
             InfoPayable.ChequeDate = Convert.ToDateTime(txtChequeDate.Text);
         else
             InfoPayable.ChequeDate = DateTime.Now;
         InfoPayable.UserId = PublicVariables._decCurrentUserId;
         InfoPayable.VoucherTypeId = decPDCpayableVoucherTypeId;
         if (cmbBank.SelectedValue != null && cmbBank.SelectedValue.ToString() != string.Empty)
         {
             InfoPayable.BankId = Convert.ToDecimal(cmbBank.SelectedValue.ToString());
         }
         else
             InfoPayable.ExtraDate = DateTime.Now;
         InfoPayable.Extra1 = string.Empty;
         InfoPayable.Extra2 = string.Empty;
         if (!isInEditMode)
         {
             decimal decIdentity = SpPayable.PDCPayableMasterAdd(InfoPayable);
             LedgerPosting();
             PartyBalanceAddOrEdit();
             Messages.SavedMessage();
             if (cbxPrint.Checked)
             {
                 if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                 {
                     PrintForDotMatrix(decIdentity);
                 }
                 else
                 {
                     Print(decIdentity);
                 }
             }
             ClearFunction();
         }
         else
         {
             decimal decIdentity = decPDCpayableEditId;
             InfoPayable.PdcPayableMasterId = decPDCpayableEditId;
             SpPayable.PDCPayableMasterEdit(InfoPayable);
             LedgerPostingSP spLedgerPosting = new LedgerPostingSP();
             spLedgerPosting.LedgerPostingDeleteByVoucherNoVoucherTypeIdAndLedgerId(strVoucherNo, decPDCpayableVoucherTypeId, 12);
             spPartyBalance.PartyBalanceDeleteByVoucherTypeAndVoucherNo(decPDCpayableVoucherTypeId, strVoucherNo);
             PartyBalanceAddOrEdit();
             LedgerPostingEdit(decPDCpayableEditId);
             Messages.UpdatedMessage();
             if (cbxPrint.Checked)
             {
                 if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                 {
                     PrintForDotMatrix(decIdentity);
                 }
                 else
                 {
                     Print(decIdentity);
                 }
             }
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#7
0
 /// <summary>
 /// Fill function for updation
 /// </summary>
 public void FillFunction()
 {
     try
     {
         PDCPayableMasterInfo infopdcpayable = new PDCPayableMasterInfo();
         PDCPayableMasterSP spPdcpayable = new PDCPayableMasterSP();
         infopdcpayable = spPdcpayable.PDCPayableMasterView(decPDCpayableEditId);
         txtvoucherNo.ReadOnly = false;
         strVoucherNo = infopdcpayable.VoucherNo;
         strInvoiceNo = infopdcpayable.InvoiceNo;
         txtvoucherNo.Text = strInvoiceNo;
         decSufixprefixPdcpayableID = infopdcpayable.SuffixPrefixId;
         decPDCpayableVoucherTypeId = infopdcpayable.VoucherTypeId;
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decPDCpayableVoucherTypeId);
         if (isAutomatic)
         {
             txtvoucherNo.ReadOnly = true;
         }
         else
         {
             txtvoucherNo.ReadOnly = false;
         }
         if (infopdcpayable.PdcPayableMasterId != 0)
         {
             txtvoucherNo.Text = infopdcpayable.InvoiceNo;
             dtpVoucherDate.Value = infopdcpayable.Date;
             txtVoucherDate.Text = dtpVoucherDate.Value.ToString("dd-MMM-yyyy");
             txtNarration.Text = infopdcpayable.Narration;
             cmbAccountLedger.SelectedValue = infopdcpayable.LedgerId;
             txtAmount.Text = infopdcpayable.Amount.ToString();
             if (infopdcpayable.BankId != 0)
                 cmbBank.SelectedValue = infopdcpayable.BankId;
             else
                 cmbBank.SelectedValue = string.Empty;
             txtcheckNo.Text = infopdcpayable.ChequeNo;
             txtChequeDate.Text = infopdcpayable.ChequeDate.ToString("dd-MMM-yyyy");
             btnSave.Text = "Update";
             PartyBalanceSP SpPartyBalance = new PartyBalanceSP();
             DataTable dtbl1 = new DataTable();
             dtbl1 = SpPartyBalance.PartyBalanceViewByVoucherNoAndVoucherType(decPDCpayableVoucherTypeId, strVoucherNo, infopdcpayable.Date);
             dtblPartyBalance = dtbl1;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP22:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }