Exemple #1
0
 /// <summary>
 /// Function to fill datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         DataTable dtblRejectionOutRegister = new DataTable();
         if (txtRejectionOutNo.Text.Trim() == string.Empty)
         {
             strInvoiceNo = string.Empty;
         }
         else
         {
             strInvoiceNo = txtRejectionOutNo.Text;
         }
         if (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1)
         {
             decLedgerId = -1;
         }
         else
         {
             decLedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
         }
         DateTime FromDate = this.dtpFromDate.Value;
         DateTime ToDate   = this.dtpToDate.Value;
         dtblRejectionOutRegister           = spRejectionOutMaster.RejectionOutMasterSearch(strInvoiceNo, decLedgerId, FromDate, ToDate);
         dgvRejectionOutRegister.DataSource = dtblRejectionOutRegister;
         if (dgvRejectionOutRegister.Columns.Count > 0)
         {
             dgvRejectionOutRegister.Columns["dgvtxtBillAmount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ROREG03:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        public List <DataTable> RejectionOutMasterSearch(string strInvoiceNo, decimal decLedgerId, DateTime FromDate, DateTime ToDate)
        {
            List <DataTable> listobj = new List <DataTable>();

            try
            {
                listobj = spRejectionOutMaster.RejectionOutMasterSearch(strInvoiceNo, decLedgerId, FromDate, ToDate);
            }
            catch (Exception ex)
            {
                MessageBox.Show("RO14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(listobj);
        }