/// <summary> /// Function to fill VoucherType combobox /// </summary> public void VoucherTypeComboFill() { try { RejectionOutBll bllRejectionOut = new RejectionOutBll(); List <DataTable> list = new List <DataTable>(); list = bllRejectionOut.VoucherTypeComboFillForRejectionOutReport(); cmbVoucherType.DataSource = list[0]; cmbVoucherType.ValueMember = "voucherTypeId"; cmbVoucherType.DisplayMember = "voucherTypeName"; cmbVoucherType.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show("ROREP05:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function toprint /// </summary> public void ReportPrint() { try { RejectionOutBll bllRejectionOut = new RejectionOutBll(); decimal decMaterialReceiptNo = 0; if (cmbMaterialReceiptNo.SelectedIndex != -1) { decMaterialReceiptNo = Convert.ToDecimal(cmbMaterialReceiptNo.SelectedValue.ToString()); } strVoucherNo = txtVoucherNo.Text; strProductCode = txtProductCode.Text; DataSet dsRejectionOut = bllRejectionOut.RejectionOutReportPrinting(decmaterialReceiptMasterId, 1, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), strVoucherNo, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), strProductCode, strProductName); frmReport frmReport = new frmReport(); frmReport.MdiParent = formMDI.MDIObj; frmReport.RejectionOutReportPrinting(dsRejectionOut); } catch (Exception ex) { MessageBox.Show("RORP03:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill the grid based on conditions /// </summary> public void GridFill() { try { //RejectionOutMasterSP spRejectionOutMaster = new RejectionOutMasterSP(); RejectionOutBll bllRejectionOut = new RejectionOutBll(); if (txtVoucherNo.Text.Trim() == string.Empty) { strVoucherNo = string.Empty; } else { strVoucherNo = txtVoucherNo.Text; } if (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1) { decLedgerId = 0; } else { decLedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()); } if (cmbVoucherType.SelectedIndex == 0 || cmbVoucherType.SelectedIndex == -1) { decVoucherTypeId = 0; } else { decVoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()); } if (cmbMaterialReceiptNo.SelectedIndex == 0 || cmbMaterialReceiptNo.SelectedIndex == -1) { decReceiptMasterId = 0; } else { decReceiptMasterId = Convert.ToDecimal(cmbMaterialReceiptNo.SelectedValue.ToString()); } if (txtProductCode.Text.Trim() == string.Empty) { strProductCode = string.Empty; } else { strProductCode = txtProductCode.Text; } if (txtProductName.Text.Trim() == string.Empty) { strProductName = string.Empty; } else { strProductName = txtProductName.Text; } DateTime FromDate = this.dtpFromDate.Value; DateTime ToDate = this.dtpToDate.Value; List <DataTable> list = bllRejectionOut.RejectionOutReportFill(strinvoiceNo, strProductCode, strProductName, decLedgerId, FromDate, ToDate, decReceiptMasterId, decVoucherTypeId); dgvRejectionOutReport.DataSource = list[0]; } catch (Exception ex) { MessageBox.Show("ROREP07:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }