Ejemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            CashTransactionBL bl         = new CashTransactionBL();
            string            searchText = ddlTranType.Text;

            var lstCashTran = new List <CashTransactionDTO>();

            if (ddlTranType.Text == "BOTH")
            {
                lstCashTran           = bl.GetCashTransaction().Where(et => Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) >= Convert.ToDateTime(dtStartDate.Text) && Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) <= Convert.ToDateTime(dtEndDate.Text)).ToList();
                dgCashTran.DataSource = lstCashTran;
            }
            else
            {
                lstCashTran = bl.GetCashTransaction().Where(et => Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) >= Convert.ToDateTime(dtStartDate.Text) && Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) <= Convert.ToDateTime(dtEndDate.Text)).ToList()
                              .Where(
                    efu => efu.TransactionType.ToUpper().Contains(ddlTranType.Text.ToUpper())
                    ).ToList();
                dgCashTran.DataSource = lstCashTran;
            }

            if (ddlType.Text != "" && ddlType.Text != "BOTH")
            {
                lstCashTran           = lstCashTran.Where(efu => efu.Type.ToUpper().Contains(ddlType.Text.ToUpper())).ToList();
                dgCashTran.DataSource = lstCashTran;
            }

            if (ddlStatus.Text != "")
            {
                lstCashTran           = lstCashTran.Where(efu => efu.Status.ToUpper().Contains(ddlStatus.Text.ToUpper())).ToList();
                dgCashTran.DataSource = lstCashTran;
            }
        }
Ejemplo n.º 2
0
        private void LoadDefaultValues()
        {
            CashTransactionBL bl = new CashTransactionBL();
            var lstCashTran      = bl.GetCashTransaction().Where(et => Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) >= Convert.ToDateTime(dtStartDate.Text) && Convert.ToDateTime(Convert.ToDateTime(et.TransactionDate).ToShortDateString()) <= Convert.ToDateTime(dtEndDate.Text)).ToList();

            dgCashTran.DataSource = lstCashTran;
        }
Ejemplo n.º 3
0
        private void PopulateValues()
        {
            CashTransactionBL bl = new CashTransactionBL();
            var etr = bl.GetCashTransaction().FirstOrDefault(et => et.CashTransactionID == _CashTransactionID);

            ddlTranType.Text         = "";
            ddlTranType.SelectedText = etr.TransactionType;
            txtAmount.Text           = etr.Amount.ToString();
            txtComments.Text         = etr.Description;;
            dtTranDate.Text          = etr.TransactionDate.ToShortDateString();
            ddlType.Text             = "";
            ddlType.SelectedText     = etr.Type;
            ddlStatus.SelectedText   = etr.Status;
        }