Пример #1
0
        private void frmQuanLySach_Load(object sender, EventArgs e)
        {
            cmbTenTG.DataSource    = TacGiaBUS.GetList();
            cmbTenTG.DisplayMember = "TenTG";
            cmbTenTG.ValueMember   = "MaTG";

            comboBox4.DataSource    = NhaXuatBanBUS.GetList();
            comboBox4.DisplayMember = "TenNXB";
            comboBox4.ValueMember   = "MaNXB";

            cmbLoaiSach.DataSource    = TheLoaiBUS.GetList();
            cmbLoaiSach.DisplayMember = "TenTheLoai";
            cmbLoaiSach.ValueMember   = "MaLoai";

            cmbNgonNgu.DataSource    = NgonNguBUS.GetList();
            cmbNgonNgu.DisplayMember = "TenNgonNgu";
            cmbNgonNgu.ValueMember   = "MaNgonNgu";

            tbxTenSach.Text  = "";
            textBox2.Text    = "";
            cmbNgonNgu.Text  = "";
            cmbLoaiSach.Text = "";
            cmbTenTG.Text    = "";
            comboBox4.Text   = "";
        }
        void LoadData()
        {
            List <NhaXuatBan> nhaXuatBan    = new List <NhaXuatBan>();
            NhaXuatBanBUS     busNhaXuatBan = new NhaXuatBanBUS();

            nhaXuatBan = busNhaXuatBan.GetList();

            dataGrid.Items.Clear();

            id = 1;
            foreach (NhaXuatBan i in nhaXuatBan)
            {
                ThongTinNhaXuatBan thongTinNhaXuatBan = new ThongTinNhaXuatBan();
                thongTinNhaXuatBan.MaNhaXuatBan  = i.MaNXB;
                thongTinNhaXuatBan.TenNhaXuatBan = i.TenNXB;
                thongTinNhaXuatBan.DiaChi        = i.DiaChiNXB;
                thongTinNhaXuatBan.SoDienThoai   = i.SoDienThoai;

                dataGrid.IsReadOnly = true;
                dataGrid.Items.Add(thongTinNhaXuatBan);

                if (id < int.Parse(i.MaNXB))
                {
                    id = int.Parse(i.MaNXB);
                }
            }
        }
Пример #3
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (KiemTra() == "")
     {
         NhaXuatBanDTO NXB = new NhaXuatBanDTO();
         NXB.MaNXB     = txtMaNXB.Text;
         NXB.TenNXB    = txtTenNXB.Text;
         NXB.DiaChi    = txtDiaChi.Text;
         NXB.DienThoai = txtDienThoai.Text;
         if (NhaXuatBanBUS.ThemNXB(NXB) == true)
         {
             txtMaNXB.Text = NhaXuatBanBUS.GetIDNXB();
             txtTenNXB.ResetText();
             txtDiaChi.ResetText();
             txtDienThoai.ResetText();
             LoadData();
         }
         else
         {
             MessageBox.Show("Thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show(string.Format("{0}", KiemTra()), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #4
0
 public Form1()
 {
     InitializeComponent();
     dauSach    = new DauSachBUS();
     tacGia     = new TacGiaBUS();
     theLoai    = new TheLoaiBUS();
     nhaXuatBan = new NhaXuatBanBUS();
 }
 private void frmPhieuNhapSach_Load(object sender, EventArgs e)
 {
     cboNXB.DataSource              = NhaXuatBanBUS.DanhSachNXB();
     cboNXB.DisplayMember           = "TenNXB";
     cboNXB.ValueMember             = "MaNXB";
     dgvDanhSach.AllowUserToAddRows = false;
     dtkNgayNhap.Value              = DateTime.Now;
     dgvDanhSach.Rows.Clear();
 }
Пример #6
0
        private void frmBaoCaoSach_Load(object sender, EventArgs e)
        {
            NhaXuatBanBUS nxbBUS = new NhaXuatBanBUS();

            bdsNXB.DataSource = nxbBUS.LayDanhSach();
            TheLoaiBUS tlBUS = new TheLoaiBUS();

            bdsTheLoai.DataSource = tlBUS.LayDanhSach();
        }
Пример #7
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            NhaXuatBanDTO NXB = new NhaXuatBanDTO();

            NXB.MaNXB  = ((NhaXuatBanDTO)cmbNXB.SelectedItem).MaNXB;
            NXB.TenNXB = txtNXB.Text;

            NhaXuatBanBUS.Modify(NXB);
            QuanLyNXB_Load(sender, e);
        }
Пример #8
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     txtMaNXB.Text = NhaXuatBanBUS.GetIDNXB();
     txtTenNXB.ResetText();
     txtDiaChi.ResetText();
     txtDienThoai.ResetText();
     btnThem.Enabled = true;
     btnXoa.Enabled  = false;
     btnSua.Enabled  = false;
     LoadData();
 }
Пример #9
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (NhaXuatBanBUS.XoaNXB(dgvDanhSach.CurrentRow.Cells[0].Value.ToString()) == true)
     {
         txtMaNXB.Text = NhaXuatBanBUS.GetIDNXB();
         txtTenNXB.ResetText();
         txtDiaChi.ResetText();
         txtDienThoai.ResetText();
         LoadData();
     }
     else
     {
         MessageBox.Show("Không thể xóa vì còn tồn tại sách thuộc nhà xuất bản đó.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Пример #10
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (txtThemTenNXB.Text.Length == 0)
     {
         MessageBox.Show("Bạn Chưa Nhập Tên Nhà Xuất Bản!", "Cảnh báo!");
     }
     else
     {
         NhaXuatBanDTO NXB = new NhaXuatBanDTO();
         NXB.TenNXB = txtThemTenNXB.Text;
         NhaXuatBanBUS.Insert(NXB);
         MessageBox.Show("Thêm thành công!", "Thông báo!");
         this.Close();
     }
 }
Пример #11
0
        private void frmThemSach_Load(object sender, EventArgs e)
        {
            cboTheLoai.DataSource    = TheLoaiBUS.DanhSachTheLoai();
            cboTheLoai.DisplayMember = "TenTL";
            cboTheLoai.ValueMember   = "MaTL";

            cboTacGia.DataSource    = TacGiaBUS.DanhSachTacGia();
            cboTacGia.DisplayMember = "TenTG";
            cboTacGia.ValueMember   = "MaTG";

            cboNXB.DataSource    = NhaXuatBanBUS.DanhSachNXB();
            cboNXB.DisplayMember = "TenNXB";
            cboNXB.ValueMember   = "MaNXB";

            txtMaSach.Text = SachBUS.GetIDSach();
        }
Пример #12
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            NhaXuatBanDTO NXB = new NhaXuatBanDTO();

            NXB.MaNXB     = txtMaNXB.Text;
            NXB.TenNXB    = txtTenNXB.Text;
            NXB.DiaChi    = txtDiaChi.Text;
            NXB.DienThoai = txtDienThoai.Text;
            if (NhaXuatBanBUS.SuaNXB(NXB) == true)
            {
                LoadData();
            }
            else
            {
                MessageBox.Show("Cập nhật thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #13
0
        private void btXoa_Click(object sender, RoutedEventArgs e)
        {
            NhaXuatBanBUS bus = new NhaXuatBanBUS();

            try
            {
                bus.Delete(tbMaNhaXuatBan.Text);

                MessageBox.Show("Xóa thành công !");
            }
            catch (Exception)
            {
                MessageBox.Show("Xóa thất bại !");
            }


            LoadData();
        }
Пример #14
0
        public frmSuaSach(SachDTO S)
        {
            InitializeComponent();
            cboTheLoai.DataSource    = TheLoaiBUS.DanhSachTheLoai();
            cboTheLoai.DisplayMember = "TenTL";
            cboTheLoai.ValueMember   = "MaTL";

            cboTacGia.DataSource    = TacGiaBUS.DanhSachTacGia();
            cboTacGia.DisplayMember = "TenTG";
            cboTacGia.ValueMember   = "MaTG";

            cboNXB.DataSource    = NhaXuatBanBUS.DanhSachNXB();
            cboNXB.DisplayMember = "TenNXB";
            cboNXB.ValueMember   = "MaNXB";

            txtMaSach.Text           = S.MaSach;
            txtTenSach.Text          = S.TenSach;
            cboTheLoai.SelectedValue = S.MaTL;
            cboTacGia.SelectedValue  = S.MaTG;
            cboNXB.SelectedValue     = S.MaNXB;
        }
Пример #15
0
        private void btThem_Click(object sender, RoutedEventArgs e)
        {
            NhaXuatBan nhaXuatBan = new NhaXuatBan()
            {
                MaNXB = (++id).ToString(), TenNXB = tbTenTacGia.Text, DiaChiNXB = tbDiaChi.Text, SoDienThoai = tbSoDienThoai.Text
            };

            NhaXuatBanBUS bus = new NhaXuatBanBUS();

            try
            {
                bus.Insert(nhaXuatBan);

                MessageBox.Show("Thêm thành công !");
            }
            catch (Exception)
            {
                MessageBox.Show("Thêm thất bại !");
            }

            LoadData();
        }
Пример #16
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            List <Sach> _sach    = new List <Sach>();
            SachBUS     _busSach = new SachBUS();

            dataGrid.Items.Clear();

            _sach = _busSach.GetList();

            List <TacGia> _tacGia    = new List <TacGia>();
            TacGiaBUS     _busTacGia = new TacGiaBUS();

            _tacGia = _busTacGia.GetList();

            List <NhaXuatBan> _nhaXuatBan    = new List <NhaXuatBan>();
            NhaXuatBanBUS     _busNhaXuatBan = new NhaXuatBanBUS();

            _nhaXuatBan = _busNhaXuatBan.GetList();

            List <TheLoai> _theLoai    = new List <TheLoai>();
            TheLoaiBUS     _busTheLoai = new TheLoaiBUS();

            _theLoai = _busTheLoai.GetList();

            foreach (Sach i in _sach)
            {
                ThongTinSach _thongTinSach = new ThongTinSach();
                _thongTinSach.MaSach     = i.MaSach;
                _thongTinSach.TenSach    = i.TenSach;
                _thongTinSach.TheLoai    = LayTenTheLoai(_theLoai, i.TheLoai);
                _thongTinSach.TacGia     = LayTenTacGia(_tacGia, i.TacGia);
                _thongTinSach.NhaXuatBan = LayTenNhaXuatBan(_nhaXuatBan, i.NhaXuatBan);
                _thongTinSach.NamXuatBan = i.NamXuatBan;
                _thongTinSach.GiaBan     = i.GiaBan.ToString();
                _thongTinSach.SoLuong    = i.SoLuong;

                dataGrid.Items.Add(_thongTinSach);
            }
        }
Пример #17
0
        private void btSua_Click(object sender, RoutedEventArgs e)
        {
            NhaXuatBan nhaXuatBan = new NhaXuatBan()
            {
                MaNXB = tbMaNhaXuatBan.Text, TenNXB = tbTenTacGia.Text, DiaChiNXB = tbDiaChi.Text, SoDienThoai = tbSoDienThoai.Text
            };

            NhaXuatBanBUS bus = new NhaXuatBanBUS();

            try
            {
                bus.Update(nhaXuatBan);

                MessageBox.Show("Sửa thành công !");
            }
            catch (Exception)
            {
                MessageBox.Show("Sửa thất bại !");
            }

            LoadData();
        }
Пример #18
0
        private void btnXem_Click(object sender, EventArgs e)
        {
            SachBUS   sBUS = new SachBUS();
            DataTable dt   = new DataTable();

            if (radTatCa.Checked)
            {
                frmReport f = new frmReport();
                f.TopLevel = false;
                AddControlsToPanel(f);
                dt = sBUS.LayDanhSach();
                f.rpvReport.LocalReport.ReportEmbeddedResource = "QuanLyCuaHangSach.rptDSSach.rdlc";
                f.rpvReport.LocalReport.DataSources.Add(new ReportDataSource("dsSach", dt));
                f.rpvReport.RefreshReport();
            }
            if (radTheoTheLoai.Checked)
            {
                frmReport f = new frmReport();
                f.TopLevel = false;
                AddControlsToPanel(f);
                dt = sBUS.LayDSSachTheoTheLoai((int)cboTheLoai.SelectedValue);
                f.rpvReport.LocalReport.ReportEmbeddedResource = "QuanLyCuaHangSach.rptDSSachTheoTheLoai.rdlc";
                f.rpvReport.LocalReport.DataSources.Add(new ReportDataSource("dsSach", dt));
                f.rpvReport.LocalReport.SetParameters(new ReportParameter("paTheLoai", cboTheLoai.Text, false));
                f.rpvReport.RefreshReport();
            }
            if (radTheoNXB.Checked)
            {
                frmReport f = new frmReport();
                f.TopLevel = false;
                AddControlsToPanel(f);
                dt = sBUS.LayDSSachTheoNXB((int)cboNXB.SelectedValue);
                f.rpvReport.LocalReport.ReportEmbeddedResource = "QuanLyCuaHangSach.rptDSSachTheoNXB.rdlc";
                f.rpvReport.LocalReport.DataSources.Add(new ReportDataSource("dsSach", dt));
                f.rpvReport.LocalReport.SetParameters(new ReportParameter("paNXB", cboNXB.Text, false));
                f.rpvReport.RefreshReport();
            }
            if (radNhomTheLoai.Checked)
            {
                frmReport f = new frmReport();
                f.TopLevel = false;
                AddControlsToPanel(f);
                TheLoaiBUS tlBUS = new TheLoaiBUS();
                DataTable  dtTL  = tlBUS.LayDanhSach();
                f.rpvReport.LocalReport.ReportEmbeddedResource = "QuanLyCuaHangSach.rptDSSachTheLoaiGroup.rdlc";
                f.rpvReport.LocalReport.SubreportProcessing   += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
                f.rpvReport.LocalReport.DataSources.Add(new ReportDataSource("dsSach", dtTL));
                f.rpvReport.RefreshReport();
            }
            if (radNhomNXB.Checked)
            {
                frmReport f = new frmReport();
                f.TopLevel = false;
                AddControlsToPanel(f);
                NhaXuatBanBUS nxbBUS = new NhaXuatBanBUS();
                DataTable     dtNXB  = nxbBUS.LayDanhSach();
                f.rpvReport.LocalReport.ReportEmbeddedResource = "QuanLyCuaHangSach.rptDSSachNXBGroup.rdlc";
                f.rpvReport.LocalReport.SubreportProcessing   += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
                f.rpvReport.LocalReport.DataSources.Add(new ReportDataSource("dsSach", dtNXB));
                f.rpvReport.RefreshReport();
            }
        }
Пример #19
0
        private void frmCapNhatSach_Load(object sender, EventArgs e)
        {
            try
            {
                cmbTenTG.DataSource    = TacGiaBUS.GetList();
                cmbTenTG.DisplayMember = "TenTG";
                cmbTenTG.ValueMember   = "MaTG";

                cmbNhaXuatBan.DataSource    = NhaXuatBanBUS.GetList();
                cmbNhaXuatBan.DisplayMember = "TenNXB";
                cmbNhaXuatBan.ValueMember   = "MaNXB";

                cmbLoaiSach.DataSource    = TheLoaiBUS.GetList();
                cmbLoaiSach.DisplayMember = "TenTheLoai";
                cmbLoaiSach.ValueMember   = "MaLoai";

                cmbNgonNgu.DataSource    = NgonNguBUS.GetList();
                cmbNgonNgu.DisplayMember = "TenNgonNgu";
                cmbNgonNgu.ValueMember   = "MaNgonNgu";

                int     maSach  = TimKiemSach.MaSach;
                SachBUS sachBUS = new SachBUS();
                SachDTO sachDTO = null;
                sachDTO         = sachBUS.Search_MaSach(maSach);
                tbxTenSach.Text = sachDTO.TenSach;
                txtSoTrang.Text = sachDTO.SoTrang.ToString();

                TacGiaBUS tacgiaBUS = new TacGiaBUS();
                TacGiaDTO tacgiaDTO = null;
                tacgiaDTO     = tacgiaBUS.LayTenTacGia(sachDTO.MaTacGia);
                cmbTenTG.Text = tacgiaDTO.TenTG;

                NhaXuatBanBUS nxbBUS = new NhaXuatBanBUS();
                NhaXuatBanDTO nxbDTO = null;
                nxbDTO             = nxbBUS.LayTenNhaXuatBan(sachDTO.MaNXB);
                cmbNhaXuatBan.Text = nxbDTO.TenNXB;

                NgonNguBUS nnBUS = new NgonNguBUS();
                NgonNguDTO nnDTO = null;
                nnDTO           = nnBUS.LayTenNgonNgu(sachDTO.MaNgonNgu);
                cmbNgonNgu.Text = nnDTO.TenNgonNgu;

                TheLoaiBUS tlBUS = new TheLoaiBUS();
                TheLoaiDTO tlDTO = null;
                tlDTO            = tlBUS.LayTenTheLoai(sachDTO.MaTheLoai);
                cmbLoaiSach.Text = tlDTO.TenTheLoai;


                if (sachDTO.TrangThai == 0)
                {
                    cmbTinhTrang.Text = "Chưa mượn";
                }
                else
                {
                    cmbTinhTrang.Text = "Đã mượn";
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #20
0
        void Custom()
        {
            dgvDanhSach.AutoGenerateColumns = false;
            dgvDanhSach.Columns.Clear();
            dgvDanhSach.AllowUserToAddRows = false;

            DataGridViewTextBoxColumn dgvCol = new DataGridViewTextBoxColumn();

            dgvCol.HeaderText       = "Mã sách";
            dgvCol.AutoSizeMode     = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvCol.DataPropertyName = "MaSach";
            dgvCol.ReadOnly         = true;
            dgvDanhSach.Columns.Add(dgvCol);

            dgvCol                  = new DataGridViewTextBoxColumn();
            dgvCol.HeaderText       = "Tên sách";
            dgvCol.AutoSizeMode     = DataGridViewAutoSizeColumnMode.None;
            dgvCol.DataPropertyName = "TenSach";
            dgvCol.ReadOnly         = true;
            dgvCol.Width            = 400;
            dgvDanhSach.Columns.Add(dgvCol);

            DataGridViewComboBoxColumn dgvCo = new DataGridViewComboBoxColumn();

            dgvCo.HeaderText       = "Thể loại";
            dgvCo.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            dgvCo.DataSource       = TheLoaiBUS.DanhSachTheLoai();
            dgvCo.DisplayMember    = "TenTL";
            dgvCo.ValueMember      = "MaTL";
            dgvCo.DataPropertyName = "MaTL";
            dgvCo.ReadOnly         = true;
            dgvCo.DisplayStyle     = DataGridViewComboBoxDisplayStyle.Nothing;
            dgvDanhSach.Columns.Add(dgvCo);

            dgvCo                  = new DataGridViewComboBoxColumn();
            dgvCo.HeaderText       = "Nhà xuất bản";
            dgvCo.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            dgvCo.DataSource       = NhaXuatBanBUS.DanhSachNXB();
            dgvCo.DisplayMember    = "TenNXB";
            dgvCo.ValueMember      = "MaNXB";
            dgvCo.DataPropertyName = "MaNXB";
            dgvCo.ReadOnly         = true;
            dgvCo.DisplayStyle     = DataGridViewComboBoxDisplayStyle.Nothing;
            dgvDanhSach.Columns.Add(dgvCo);

            dgvCo                  = new DataGridViewComboBoxColumn();
            dgvCo.HeaderText       = "Tác giả";
            dgvCo.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            dgvCo.DataSource       = TacGiaBUS.DanhSachTacGia();
            dgvCo.DisplayMember    = "TenTG";
            dgvCo.ValueMember      = "MaTG";
            dgvCo.DataPropertyName = "MaTG";
            dgvCo.ReadOnly         = true;
            dgvCo.DisplayStyle     = DataGridViewComboBoxDisplayStyle.Nothing;
            dgvDanhSach.Columns.Add(dgvCo);

            dgvCol                  = new DataGridViewTextBoxColumn();
            dgvCol.HeaderText       = "Số lượng tồn";
            dgvCol.AutoSizeMode     = DataGridViewAutoSizeColumnMode.None;
            dgvCol.DataPropertyName = "SoLuongTon";
            dgvCol.ReadOnly         = true;
            dgvCol.Width            = 110;
            dgvDanhSach.Columns.Add(dgvCol);

            dgvCol                         = new DataGridViewTextBoxColumn();
            dgvCol.HeaderText              = "Giá bán (VNĐ)";
            dgvCol.AutoSizeMode            = DataGridViewAutoSizeColumnMode.Fill;
            dgvCol.DataPropertyName        = "GiaBan";
            dgvCol.ReadOnly                = true;
            dgvCol.DefaultCellStyle.Format = "0,00";
            dgvDanhSach.Columns.Add(dgvCol);
        }
Пример #21
0
 private void QuanLyNXB_Load(object sender, EventArgs e)
 {
     cmbNXB.DataSource    = NhaXuatBanBUS.GetList();
     cmbNXB.ValueMember   = "MaNXB";
     cmbNXB.DisplayMember = "TenNXB";
 }
Пример #22
0
        private void btTim_Click(object sender, RoutedEventArgs e)
        {
            List <Sach> _sach    = new List <Sach>();
            SachBUS     _busSach = new SachBUS();

            dataGrid.Items.Clear();

            _sach = _busSach.GetList();

            string _maTheLoai = "";

            foreach (TheLoai i in _theLoai)
            {
                if (i.TenTheLoai == cbbTheLoai.Text)
                {
                    _maTheLoai = i.MaTheLoai;
                    break;
                }
            }

            List <TacGia> _tacGia    = new List <TacGia>();
            TacGiaBUS     _busTacGia = new TacGiaBUS();

            _tacGia = _busTacGia.GetList();

            List <NhaXuatBan> _nhaXuatBan    = new List <NhaXuatBan>();
            NhaXuatBanBUS     _busNhaXuatBan = new NhaXuatBanBUS();

            _nhaXuatBan = _busNhaXuatBan.GetList();

            int stt = 1;

            if (tbTenSach.Text == "")
            {
                foreach (Sach i in _sach)
                {
                    if (i.TheLoai == _maTheLoai)
                    {
                        ThongTinSach _thongTinSach = new ThongTinSach();
                        _thongTinSach.Stt        = stt++;
                        _thongTinSach.TenSach    = i.TenSach;
                        _thongTinSach.TheLoai    = cbbTheLoai.Text;
                        _thongTinSach.TacGia     = LayTenTacGia(_tacGia, i.TacGia);
                        _thongTinSach.NhaXuatBan = LayTenNhaXuatBan(_nhaXuatBan, i.NhaXuatBan);
                        _thongTinSach.NamXuatBan = i.NamXuatBan;
                        _thongTinSach.GiaBan     = i.GiaBan.ToString();
                        _thongTinSach.SoLuong    = i.SoLuong;

                        dataGrid.Items.Add(_thongTinSach);
                    }
                }
            }
            else if (tbTenSach.Text != "" && cbbTheLoai.Text != "")
            {
                foreach (Sach i in _sach)
                {
                    if (String.Compare(i.TenSach, tbTenSach.Text, true) == 0 && i.TheLoai == _maTheLoai)
                    {
                        ThongTinSach _thongTinSach = new ThongTinSach();
                        _thongTinSach.Stt        = stt++;
                        _thongTinSach.TenSach    = i.TenSach;
                        _thongTinSach.TheLoai    = cbbTheLoai.Text;
                        _thongTinSach.TacGia     = LayTenTacGia(_tacGia, i.TacGia);
                        _thongTinSach.NhaXuatBan = LayTenNhaXuatBan(_nhaXuatBan, i.NhaXuatBan);
                        _thongTinSach.NamXuatBan = i.NamXuatBan;
                        _thongTinSach.GiaBan     = i.GiaBan.ToString();
                        _thongTinSach.SoLuong    = i.SoLuong;

                        dataGrid.Items.Add(_thongTinSach);
                    }
                }
            }
            else if (tbTenSach.Text != "")
            {
                foreach (Sach i in _sach)
                {
                    if (String.Compare(i.TenSach, tbTenSach.Text, true) == 0)
                    {
                        ThongTinSach _thongTinSach = new ThongTinSach();
                        _thongTinSach.Stt        = stt++;
                        _thongTinSach.TenSach    = i.TenSach;
                        _thongTinSach.TheLoai    = LayTenTheLoai(_theLoai, i.TheLoai);
                        _thongTinSach.TacGia     = LayTenTacGia(_tacGia, i.TacGia);
                        _thongTinSach.NhaXuatBan = LayTenNhaXuatBan(_nhaXuatBan, i.NhaXuatBan);
                        _thongTinSach.NamXuatBan = i.NamXuatBan;
                        _thongTinSach.GiaBan     = i.GiaBan.ToString();
                        _thongTinSach.SoLuong    = i.SoLuong;

                        dataGrid.Items.Add(_thongTinSach);
                    }
                }
            }
        }
Пример #23
0
 private void frmNhaXuatBan_Load(object sender, EventArgs e)
 {
     txtMaNXB.Text = NhaXuatBanBUS.GetIDNXB();
     LoadData();
 }
Пример #24
0
 void LoadData()
 {
     dgvDanhSach.DataSource = NhaXuatBanBUS.DanhSachNXB();
     Custom();
     dgvDanhSach.ClearSelection();
 }
Пример #25
0
 private void frmTimKiemTheoNXB_Load(object sender, EventArgs e)
 {
     cboNXB.DataSource    = NhaXuatBanBUS.DanhSachNXB();
     cboNXB.DisplayMember = "TenNXB";
     cboNXB.ValueMember   = "MaNXB";
 }