/// <summary>
 /// Function to fill the grid based on the search condition
 /// </summary>
 public void GridFill()
 {
     try
     {
         List<DataTable> Listobj = new List<DataTable>();
         MaterialReceiptBll spMaterialReceiptMaster = new MaterialReceiptBll();
         if (cmbOrderNo.SelectedIndex == 0 || cmbOrderNo.SelectedIndex == -1)
         {
             decOrderId = -1;
         }
         else
         {
             decOrderId = Convert.ToDecimal(cmbOrderNo.SelectedValue.ToString());
         }
         if (txtVoucherNo.Text.Trim() == string.Empty)
         {
             strInvoiceNo = string.Empty;
         }
         else
         {
             strInvoiceNo = txtVoucherNo.Text;
         }
         if (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1)
         {
             decLedgerId = -1;
         }
         else
         {
             decLedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
         }
         if (cmbVoucherType.SelectedIndex == 0 || cmbVoucherType.SelectedIndex == -1)
         {
             decVoucherTypeId = -1;
         }
         else
         {
             decVoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
         }
         if (txtProductCode.Text.Trim() == string.Empty)
         {
             strproductCode = string.Empty;
         }
         else
         {
             strproductCode = txtProductCode.Text;
         }
         if (cmbStatus.SelectedIndex == 0 || cmbStatus.SelectedIndex == -1)
         {
             strStatus = "All";
         }
         else
         {
             strStatus = cmbStatus.SelectedItem.ToString();
         }
         DateTime FromDate = this.dtpFromDate.Value;
         DateTime ToDate = this.dtpToDate.Value;
         Listobj = spMaterialReceiptMaster.MaterialReceiptReportViewAll(decOrderId, strInvoiceNo, decLedgerId, decVoucherTypeId, strproductCode, FromDate, ToDate, strStatus);
         dgvMaterialReceiptReport.DataSource = Listobj[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show("MRR5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }