Пример #1
0
 private void frmSach_Load(object sender, EventArgs e)
 {
     tblSACH    = new XLSACH();
     tblTHELOAI = new XLTHELOAI();
     tblKESACH  = new XLKESACH();
     LoadDGVSach();
     LoadCBOKeSach();
     LoadCBOTheLoai();
     maskedMaSach.DataBindings.Add("text", tblSACH, "MaSach", true);
     txtTenSach.DataBindings.Add("text", tblSACH, "TenSach", true);
     cboKeSach.DataBindings.Add("SelectedValue", tblSACH, "KeSach", true);
     cboTheLoai.DataBindings.Add("SelectedValue", tblSACH, "TheLoai", true);
     txtNhaXB.DataBindings.Add("text", tblSACH, "NhaXB", true);
     txtDonGia.DataBindings.Add("text", tblSACH, "DonGia", true);
     txtGiaGoc.DataBindings.Add("text", tblSACH, "GiaGoc", true);
     nudSoLuong.DataBindings.Add("value", tblSACH, "SoLuong", true, DataSourceUpdateMode.OnValidation);
     txtNamXB.DataBindings.Add("text", tblSACH, "NamXB", true);
     pHinh.DataBindings.Add("Image", tblSACH, "Hinh", true);
     SACH = this.BindingContext[tblSACH];
     enaButton();
 }
Пример #2
0
        private void frmTimKiemSach_Load(object sender, EventArgs e)
        {
            tblSACH    = new XLSACH();
            tblTHELOAI = new XLTHELOAI();
            tblKESACH  = new XLKESACH();
            LoaddgvDSSach();
            LoadCBOKeSach();
            LoadCBOTheLoai();
            txtMaSach.DataBindings.Add("text", tblSACH, "MaSach", true);
            txtTenSach.DataBindings.Add("text", tblSACH, "TenSach", true);
            cboKeSach.DataBindings.Add("SelectedValue", tblSACH, "KeSach", true);
            cboTheLoai.DataBindings.Add("SelectedValue", tblSACH, "TheLoai", true);
            txtNhaXB.DataBindings.Add("text", tblSACH, "NhaXB", true);
            txtDonGia.DataBindings.Add("text", tblSACH, "DonGia", true);
            nudSoLuong.DataBindings.Add("value", tblSACH, "SoLuong", true);
            txtNamXB.DataBindings.Add("text", tblSACH, "NamXB", true);
            pHinh.DataBindings.Add("Image", tblSACH, "Hinh", true);
            SACH            = this.BindingContext[tblSACH];
            gTTSach.Enabled = false;

            radTimTheoTen.Checked = true;
        }