Beispiel #1
0
 private void cboDieuKien_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboDieuKien.Text == "Mã mượn trả")
     {
         CTMuonTra_DTOBindingSource.DataSource = CTMuonTra_BUS.LayDSMT();
         this.reportViewer1.RefreshReport();
         List <CTMuonTra_DTO> lst = CTMuonTra_BUS.LayDSMT();
         cboDanhSach.DataSource = lst;
         CTMuonTra_DTO CT = new CTMuonTra_DTO();
         CT.MaMuonTra = "TC";
         CT.MaMuonTra = "Tất cả";
         lst.Insert(0, CT);
         cboDanhSach.DisplayMember = "MaMuonTra";
     }
     else if (cboDieuKien.Text == "Tình trạng")
     {
         CTMuonTra_DTOBindingSource.DataSource = CTMuonTra_BUS.LayDSMT();
         this.reportViewer1.RefreshReport();
         List <CTMuonTra_DTO> lst = CTMuonTra_BUS.LayDSMT();
         cboDanhSach.DataSource = lst;
         CTMuonTra_DTO CT = new CTMuonTra_DTO();
         CT.DaTra = "TC";
         CT.DaTra = "Tất cả";
         lst.Insert(0, CT);
         cboDanhSach.DisplayMember = "DaTra";
     }
 }
        private void frmCTMuonTra_Load(object sender, EventArgs e)
        {
            List <CTMuonTra_DTO> lstCTMuonTra = CTMuonTra_BUS.LayDSMT();;

            dgvCTMuonTra.DataSource = lstCTMuonTra;
            hienthi(true);
            loadMaMT();
            loadMaSach();
            dgvCTMuonTra.Columns["ID"].HeaderText        = "STT";
            dgvCTMuonTra.Columns["ID"].Width             = 40;
            dgvCTMuonTra.Columns["MaMuonTra"].HeaderText = "Mã mượn";
            dgvCTMuonTra.Columns["MaMuonTra"].Width      = 100;
            dgvCTMuonTra.Columns["MaSach"].HeaderText    = "Tên sách";
            dgvCTMuonTra.Columns["MaSach"].Width         = 180;
            dgvCTMuonTra.Columns["DaTra"].HeaderText     = "Đã trả";
            dgvCTMuonTra.Columns["DaTra"].Width          = 75;
            dgvCTMuonTra.Columns["NgayTra"].HeaderText   = "Ngày trả";
            dgvCTMuonTra.Columns["NgayTra"].Width        = 90;
            dgvCTMuonTra.Columns["GhiChu"].HeaderText    = "Ghi chú";
            dgvCTMuonTra.Columns["GhiChu"].Width         = 200;
        }
Beispiel #3
0
        private void btnXem_Click(object sender, EventArgs e)
        {
            if (cboDanhSach.Text == "Tất cả")
            {
                CTMuonTra_DTOBindingSource.DataSource = CTMuonTra_BUS.LayDSMT();
                this.reportViewer1.RefreshReport();
            }
            else if (cboDieuKien.Text == "Tình trạng")
            {
                dieukien = "DaTra";
                CTMuonTra_DTOBindingSource.DataSource = CTMuonTra_BUS.TimKiem(dieukien, cboDanhSach.Text);

                this.reportViewer1.RefreshReport();
            }
            else if (cboDieuKien.Text == "Mã mượn trả")
            {
                dieukien = "MaMuonTra";
                CTMuonTra_DTOBindingSource.DataSource = CTMuonTra_BUS.TimKiem(dieukien, cboDanhSach.Text);

                this.reportViewer1.RefreshReport();
            }
        }