Esempio n. 1
0
        void LoadData()
        {
            try
            {
                dtNhaXuatBan = new DataTable();
                dtNhaXuatBan.Clear();
                DataSet ds = dbNXB.LayNhaXuatBan();
                dtNhaXuatBan = ds.Tables[0];

                gcNhaXuatBan.DataSource = dtNhaXuatBan;

                them = false;

                MaNXB        = "";
                TenNXB       = "";
                DiaChi       = "";
                SDT          = "";
                NgayThanhLap = "";

                this.btnThem.Enabled  = true;
                this.btnXoa.Enabled   = true;
                this.btnInfor.Enabled = true;
                this.btnTable.Enabled = true;
                this.btnTroVe.Enabled = true;

                this.btnTable.Enabled = false;
            }
            catch (SqlException)
            {
                XtraMessageBox.Show("Không lấy được nội dung trong table NhaXuatBan. Lỗi rồi!!!");
            }
        }
Esempio n. 2
0
        void LoadData()
        {
            try
            {
                dtSach = new DataTable();
                dtSach.Clear();
                DataSet dsSach = dbSach.LaySach();
                dtSach = dsSach.Tables[0];

                gcSach.DataSource = dtSach;

                dtNgonNguSach = new DataTable();
                dtNgonNguSach.Clear();
                DataSet dsNgonNguSach = dbNgonNgu.LayNgonNguSach();
                dtNgonNguSach = dsNgonNguSach.Tables[0];

                glueMaNgonNgu.DataSource    = dtNgonNguSach;
                glueMaNgonNgu.DisplayMember = "MaNgonNgu";
                glueMaNgonNgu.ValueMember   = "MaNgonNgu";

                dtTacGia = new DataTable();
                dtTacGia.Clear();
                DataSet dsTacGia = dbTG.LayTacGia();
                dtTacGia = dsTacGia.Tables[0];

                glueMaTG.DataSource    = dtTacGia;
                glueMaTG.DisplayMember = "MaTG";
                glueMaTG.ValueMember   = "MaTG";

                dtTheLoai = new DataTable();
                dtTheLoai.Clear();
                DataSet dsTheLoai = dbTheLoai.LayTheLoai();
                dtTheLoai = dsTheLoai.Tables[0];

                glueMaTL.DataSource    = dtTheLoai;
                glueMaTL.DisplayMember = "MaTL";
                glueMaTL.ValueMember   = "MaTL";

                dtNhaXuatBan = new DataTable();
                dtNhaXuatBan.Clear();
                DataSet dsNhaXuatBan = dbNhaXuatBan.LayNhaXuatBan();
                dtNhaXuatBan = dsNhaXuatBan.Tables[0];

                glueMaNXB.DataSource    = dtNhaXuatBan;
                glueMaNXB.DisplayMember = "MaNXB";
                glueMaNXB.ValueMember   = "MaNXB";

                dtViTriSach = new DataTable();
                dtViTriSach.Clear();
                DataSet dsViTriSach = dbVT.LayViTriSach();
                dtViTriSach = dsViTriSach.Tables[0];

                glueMaVT.DataSource    = dtViTriSach;
                glueMaVT.DisplayMember = "MaVT";
                glueMaVT.ValueMember   = "MaVT";



                them = false;

                MaSach                    = "";
                TenSach                   = "";
                MaTL                      = "";
                SoLuong                   = "";
                MaNXB                     = "";
                NamNXB                    = "";
                GiaSach                   = 0;
                this.pic1.Image           = null;
                this.pic1.BackgroundImage = null;

                this.btnThem.Enabled  = true;
                this.btnXoa.Enabled   = true;
                this.btnInfor.Enabled = true;
                this.btnTable.Enabled = true;
                this.btnTroVe.Enabled = true;

                this.btnTable.Enabled = false;
            }
            catch (SqlException)
            {
                XtraMessageBox.Show("Không lấy được nội dung trong table Sach. Lỗi rồi!!!");
            }
        }