public void SalesReturnGrideFill() { try { decimal decvouchertypeId = 0; decimal decAgainstInvoiceNo = 0; decimal decLedgerId = 0; string strInvoiceNo = string.Empty; strInvoiceNo = (txtSalesReturnNumber.Text.Trim() == string.Empty) ? string.Empty : txtSalesReturnNumber.Text; decLedgerId = (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()); decAgainstInvoiceNo = (cmbInvoiceNo.SelectedIndex == 0 || cmbInvoiceNo.SelectedIndex == -1) ? 0 : Convert.ToDecimal(cmbInvoiceNo.SelectedValue.ToString()); decvouchertypeId = (cmpvoucherType.SelectedIndex == 0 || cmpvoucherType.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmpvoucherType.SelectedValue.ToString()); DateTime FromDate = this.dtpFromDate.Value; DateTime ToDate = this.dtpToDate.Value; DataTable dtblReg = new DataTable(); dtblReg = spSalesReturnMaster.SalesReturnRegisterGrideFill(FromDate, ToDate, decLedgerId, strInvoiceNo, decAgainstInvoiceNo, decvouchertypeId); dgvSalesReturnRegister.DataSource = dtblReg; } catch (Exception ex) { MessageBox.Show("SRR2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public List <DataTable> SalesReturnRegisterGrideFill(DateTime fromDate, DateTime toDate, decimal decLedgerId, string strInvoiceNo, decimal decAgainstInvoiceNo, decimal decvouchertypeId) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = spSalesReturnMaster.SalesReturnRegisterGrideFill(fromDate, toDate, decLedgerId, strInvoiceNo, decAgainstInvoiceNo, decvouchertypeId); } catch (Exception ex) { MessageBox.Show("AG1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }