/// <summary> /// Function to fill Datagridview /// </summary> public void SearchRegister() { try { string strVoucherNo = txtVoucherNo.Text.ToString(); string strToDate = string.Empty; if (txtToDate.Text == string.Empty) { strToDate = txtFromDate.Text.ToString(); } else { strToDate = txtToDate.Text.ToString(); } string strFromDate = txtFromDate.Text; DataTable dtbl = new DataTable(); DebitNoteMasterSP spDebitNoteMaster = new DebitNoteMasterSP(); dtbl = spDebitNoteMaster.DebitNoteRegisterSearch(strVoucherNo, strFromDate, strToDate); dgvDebitNoteRegister.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("DNTREG2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public List <DataTable> DebitNoteRegisterSearch(string strVoucherNo, string strFromDate, string strToDate) { List <DataTable> listObj = new List <DataTable>(); try { listObj = spDebitNoteMaster.DebitNoteRegisterSearch(strVoucherNo, strFromDate, strToDate); } catch (Exception ex) { MessageBox.Show("DNBLL:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(listObj); }