Beispiel #1
0
        private void frmBorrowBooks_Load(object sender, EventArgs e)
        {
            foreach (SachDTO s in sachBUS.LayDSSach())
            {
                ListViewItem item = new ListViewItem(s.MaSach);

                item.SubItems.Add(s.TenSach);
                item.SubItems.Add(s.TenTacGia);
                lsvSach.Items.Add(item);
            }
        }
Beispiel #2
0
        private void frmBooks_Load(object sender, EventArgs e)
        {
            //load vao datagridview
            dataSach.AutoGenerateColumns = false;
            dataSach.DataSource          = sachBUS.LayDSSach();

            //load vao combobox Dau Sach
            cbbDauSach.DataSource    = dausachBUS.LayDSDauSach();
            cbbDauSach.DisplayMember = "TenDauSach";
            cbbDauSach.ValueMember   = "MaDauSach";

            cbbDauSach.SelectedIndex = 0;
        }
Beispiel #3
0
        private void frmNhapSach_Load(object sender, EventArgs e)
        {
            rdoNhapMoi.Checked = true;
            NhapSachMoi();
            MaNhap = nhapSachBUS.phatSinhMa();
            dtgv_Sach.AutoGenerateColumns = false;
            dtgv_Sach.DataSource          = sachBUS.LayDSSach();
            txtMaNhap.Text = MaNhap;

            //
            cbbDauSach.DataSource    = dauSachBUS.LayDSDauSach();
            cbbDauSach.DisplayMember = "TenDauSach";
            cbbDauSach.ValueMember   = "MaDauSach";
        }
Beispiel #4
0
        void HienthiSach()
        {
            lsvSach.Items.Clear();
            DataTable dt = _sachContext.LayDSSach();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListViewItem lvi = lsvSach.Items.Add(dt.Rows[i][0].ToString());
                lvi.SubItems.Add(dt.Rows[i][1].ToString());
                lvi.SubItems.Add(dt.Rows[i][2].ToString());
                lvi.SubItems.Add(dt.Rows[i][3].ToString());
                lvi.SubItems.Add(dt.Rows[i][4].ToString());
                lvi.SubItems.Add(dt.Rows[i][5].ToString());
            }
        }
Beispiel #5
0
        private void frmSearchBooks_Load(object sender, EventArgs e)
        {
            dataSach.AutoGenerateColumns = false;
            dataSach.DataSource          = sachBUS.LayDSSach();

            //
            cbbTheLoai.DataSource    = theloaiBUS.LayDSTheLoai();
            cbbTheLoai.DisplayMember = "TenTheLoai";
            cbbTheLoai.ValueMember   = "MaTheLoai";

            DataGridViewComboBoxColumn dtgvcol = (DataGridViewComboBoxColumn)MaTheLoai;


            dtgvcol.DataSource    = theloaiBUS.LayDSTheLoai();
            dtgvcol.DisplayMember = "TenTheLoai";
            dtgvcol.ValueMember   = "MaTheLoai";

            DataGridViewCheckBoxColumn dtgvchk = (DataGridViewCheckBoxColumn)SachHiem;

            dtgvchk.TrueValue  = 0;
            dtgvchk.FalseValue = 1;
        }