Exemplo n.º 1
0
        private void frmchitietmuonsach_Load(object sender, EventArgs e)
        {
            ChiTietPhieuMuon chitiet = new ChiTietPhieuMuon();

            cbbmasach.DataSource     = da.Convert(da.Query("Select ten from Sach"));
            cbbnhaxuatban.DataSource = da.Convert(da.Query("select ten from Nhaxuatban"));
            cbbtacgia.DataSource     = da.Convert(da.Query("select ten from Tacgia"));
            cbbtheloai.DataSource    = da.Convert(da.Query("select ten from TheLoai"));
            List <Object> lst = new List <object>();

            lst = da.Convert(da.Query("select max(ma) from PhieuMuon"));
            txtphieumuon.Text = lst[0].ToString();
            if (txtphieumuon.Text != null)
            {
                chitiet.phieumuonma           = txtphieumuon.Text;
                DSChitietphieumuon.DataSource = da.Query("DanhSachChiTietPhieuMuon", new SqlParameter("@phieumuonma", chitiet.phieumuonma));
            }
        }