/// <summary> /// Function to fill Datagridview /// </summary> public void Search() { try { List <DataTable> ListPDCClearnceRegister = new List <DataTable>(); PDCClearanceBll BllPDCClearance = new PDCClearanceBll(); ListPDCClearnceRegister = BllPDCClearance.PDCClearanceRegisterSearch(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpTodate.Value.ToString()), cmbAccountLedger.Text, cmbVouchertype.Text, txtCheckno.Text.Trim(), Convert.ToDecimal(cmbBank.SelectedValue), cmbStatus.Text); dgvClearanceSearch.DataSource = ListPDCClearnceRegister[0]; } catch (Exception ex) { MessageBox.Show("PCREG6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Search function to fill the grid based on condition /// </summary> public void ReportSearch() { try { PDCClearanceBll BllPDCClearance = new PDCClearanceBll(); List <DataTable> ListPDCClearnceReport = new List <DataTable>(); ListPDCClearnceReport = BllPDCClearance.PDCClearanceReportSearch(Convert.ToDateTime(dtpFrmDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbAccountLedger.Text.ToString(), cmbVoucherType.Text.ToString(), txtVoucherNo.Text.ToString()); DGVClraranceReport.DataSource = ListPDCClearnceReport[0]; } catch (Exception ex) { MessageBox.Show("PCREP5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// print button click, call the print function /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (DGVClraranceReport.RowCount > 0) { PDCClearanceBll BllPDCClearance = new PDCClearanceBll(); DataSet dsPDCClearance = new DataSet(); dsPDCClearance = BllPDCClearance.PDCClearanceReportPrinting(Convert.ToDateTime(dtpFrmDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbAccountLedger.Text.ToString(), cmbVoucherType.Text.ToString(), txtVoucherNo.Text.ToString(), 1); frmReport frmreport = new frmReport(); frmreport.MdiParent = formMDI.MDIObj; frmreport.PDCClearanceReportPrinting(dsPDCClearance); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("PCREP12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill VoucherType combobox /// </summary> public void VoucherTypeComboFill() { try { isDontExecuteVoucherType = true; List <DataTable> listObj = new List <DataTable>(); PDCClearanceBll BllPDCClearance = new PDCClearanceBll(); cmbVouchertype.DataSource = null; listObj = BllPDCClearance.VouchertypeComboFill(); DataRow dr = listObj[0].NewRow(); dr["voucherTypeId"] = 0; dr["voucherTypeName"] = "All"; listObj[0].Rows.InsertAt(dr, 0); cmbVouchertype.DataSource = listObj[0]; cmbVouchertype.ValueMember = "voucherTypeId"; cmbVouchertype.DisplayMember = "voucherTypeName"; cmbVouchertype.SelectedIndex = 0; isDontExecuteVoucherType = false; } catch (Exception ex) { MessageBox.Show("PCREG4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }