示例#1
0
        private void tkSach_Load(object sender, EventArgs e)
        {
            cboTheLoai.DataSource    = tlBUS.LayDSTL();
            cboTheLoai.DisplayMember = "TenTL";
            cboTheLoai.ValueMember   = "MaTL";

            grid_sach.DataSource     = csBUS.LayDSTheoMa(txt_MaTuaSach.Text);
            grid_ttsach.DataSource   = tsBUS.LayDS_TuaSach();
            cboTheLoai.SelectedIndex = -1;
            cboTheLoai.SelectedValue = "";
            binding();
            hien_anh();
        }
示例#2
0
        private void ttTuaSach_Load(object sender, EventArgs e)
        {
            // Load combobox Mã tủ sách
            cboTuSach.Properties.DataSource    = tuBUS.LayDSTS();
            cboTuSach.Properties.DisplayMember = "TuSach";
            cboTuSach.Properties.ValueMember   = "MaTuSach";
            // Load combobox Mã tựa sách
            cboMaTuaSach.Properties.DataSource    = tsBUS.LayDSTuaSach();
            cboMaTuaSach.Properties.DisplayMember = "TuaSach";
            cboMaTuaSach.Properties.ValueMember   = "MaTuaSach";
            // Load combobox Mã TL
            cboTheLoai.Properties.DataSource    = tlBUS.LayDSTL();
            cboTheLoai.Properties.DisplayMember = "TenTL";
            cboTheLoai.Properties.ValueMember   = "MaTL";
            // Load combobox Mã TG
            cboTacGia.Properties.DataSource    = tgBUS.LayDSTG();
            cboTacGia.Properties.DisplayMember = "HoTenTG";
            cboTacGia.Properties.ValueMember   = "MaTG";

            //Load DataGrid
            TuaSach_DTO ts = LayMaTuaSach();

            grid_tuasach.DataSource    = tsBUS.LayDanhSachTuaSach();
            grid_tacgiasach.DataSource = tgtsBUS.LayDSTGS(txtMaTuaSach.Text);
            panel_ts.Enabled           = false;
            panel_tgs.Enabled          = false;
            bt_themtgs.Enabled         = true;
            bt_suatgs.Enabled          = true;
            bt_xoatgs.Enabled          = true;

            bt_themts.Enabled = true;
            bt_suats.Enabled  = true;
            bt_xoats.Enabled  = true;
            binding();
            hien_anh();
        }