public List <DataTable> JournalRegisterSearch(string strVoucherNo, string strFromDate, string strToDate) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = spJournalMaster.JournalRegisterSearch(strVoucherNo, strFromDate, strToDate); } catch (Exception ex) { MessageBox.Show("JVBLL12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }
/// <summary> /// Function to fill Datagridview /// </summary> public void SearchRegister() { try { if (txtFromDate.Text != string.Empty && txtToDate.Text != string.Empty) { if (Convert.ToDateTime(txtToDate.Text) < Convert.ToDateTime(txtFromDate.Text)) { MessageBox.Show("Todate should be greater than fromdate", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); SetDate(); } } string strVoucherNo = txtVoucherNo.Text; string strToDate = string.Empty; string strFromDate = string.Empty; if (txtToDate.Text == string.Empty) { strToDate = DateTime.Now.ToString(); } else { strToDate = txtToDate.Text; } if (txtFromDate.Text == string.Empty) { strFromDate = DateTime.Now.ToString(); } else { strFromDate = txtFromDate.Text; } JournalMasterSP spjournalMasterSp = new JournalMasterSP(); dgvJournalRegister.DataSource = spjournalMasterSp.JournalRegisterSearch(strVoucherNo, strFromDate, strToDate); } catch (Exception ex) { MessageBox.Show("JREG3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }