Example #1
0
        public void LoadThanhToan()
        {
            List <HDTC> dts;

            if (cbFMonth.SelectedItem != null && cbFYear.SelectedItem != null)
            {
                dts = ThanhToanBUS.LoadThanhToan().Where(x =>
                                                         x.THANG.ToString() == cbFMonth.SelectedItem.ToString() &&
                                                         x.NAM.ToString() == cbFYear.SelectedItem.ToString()
                                                         ).ToList();
            }
            else
            {
                dts = ThanhToanBUS.LoadThanhToan();
            }

            string keyword = tbKeyword.Text;

            gvThanhToan.DataSource = dts.Where(x =>
                                               keyword.Length == 0 ||
                                               x.KHACHHANG.ToString().Contains(keyword) ||
                                               x.IDSIM.Contains(keyword) ||
                                               x.ThanhToan.Contains(keyword)
                                               ).ToList();
        }