コード例 #1
0
        void LoadData()
        {
            try
            {
                dtPhim = new DataTable();
                dtPhim.Clear();
                DataSet ds = dbPhim.LayPhim();
                dtPhim = ds.Tables[0];

                dgv_PHIM.DataSource = dtPhim;
                dgv_PHIM.AutoResizeColumns();

                txtMaPhim.ResetText();
                txtTenPhim.ResetText();
                txtGiaVe.ResetText();
                txtMaPhim.Enabled = false;

                btnCancel.Enabled   = false;
                btnSave.Enabled     = false;
                btnAdd.Enabled      = true;
                btnEditFilm.Enabled = true;
                btnDelFilm.Enabled  = true;
            }
            catch (SqlException)
            {
                MessageBox.Show("Không lấy được nội dung trong table Phim. Lỗi rồi!!!");
            }
        }
コード例 #2
0
        private void setCombobox2()
        {
            DataSet ds = dbPhim.LayPhim();

            Phimcb.DataSource    = ds.Tables[0];
            Phimcb.DisplayMember = "TenPhim";
            Phimcb.ValueMember   = "TenPhim";
            Phimcb.SelectedIndex = 0;
        }
コード例 #3
0
        private void SetupCbPhim()
        {
            dt = new DataTable();
            dt.Clear();
            DataSet ds = BLPhim.LayPhim();

            dt = ds.Tables[0];
            cbMaPhim.DataSource    = dt;
            cbMaPhim.DisplayMember = "MaPhim";
            cbMaPhim.ValueMember   = "MaPhim";
        }
コード例 #4
0
ファイル: DatVeUC.cs プロジェクト: hiepvu0201/FinalWindows
        private void setCombobox2()
        {
            dtPhim = new DataTable();
            dtPhim.Clear();
            DataSet ds = dbPhim.LayPhim();

            dtPhim = ds.Tables[0];
            comboBox2.DataSource    = dtPhim;
            comboBox2.DisplayMember = "TenPhim";
            comboBox2.ValueMember   = "TenPhim";
        }
コード例 #5
0
        private void setCbPhim()
        {
            DataSet ds = dbPhim.LayPhim();

            cbPhim.DataSource    = ds.Tables[0];
            cbPhim.DisplayMember = "TenPhim";
            cbPhim.ValueMember   = "MaPhim";
        }
コード例 #6
0
        private void SetUpcbTenPhim()
        {
            DataSet ds = new DataSet();

            ds     = dbPhim.LayPhim();
            dsPhim = ds;
            if (ds.Tables[0].Rows.Count != 0)
            {
                cbTenPhim.DataSource    = ds.Tables[0];
                cbTenPhim.DisplayMember = "TenPhim";
                cbTenPhim.ValueMember   = "MaPhim";
            }
        }
コード例 #7
0
        void LoadData()
        {
            try
            {
                List <PictureBox> ArrPic = new List <PictureBox>()
                {
                    pb1, pb2, pb3, pb4
                };

                dtPhim = new DataTable();
                dtPhim.Clear();
                DataSet ds = dbPhim.LayPhim();
                dtPhim = ds.Tables[0];

                dgv_PHIM.DataSource = dtPhim;
                //dgv_PHIM.AutoResizeColumns();
                ((DataGridViewImageColumn)dgv_PHIM.Columns[3]).ImageLayout = DataGridViewImageCellLayout.Zoom;
                txtTenPhim.ResetText();
                txtTenPhim.Enabled = false;
                txtGiaVe.ResetText();
                txtGiaVe.Enabled = false;
                txtTLP.ResetText();
                txtTLP.Enabled    = false;
                txtMaPhim.Enabled = false;

                btnCancel.Enabled   = false;
                btnSave.Enabled     = false;
                btnAdd.Enabled      = true;
                btnEditFilm.Enabled = true;
                btnDelFilm.Enabled  = true;
                for (int i = 0; i < 4 & i < dgv_PHIM.RowCount; i++)
                {
                    byte[] cvr          = (byte[])dgv_PHIM.Rows[i].Cells[3].Value;
                    Image  convertedImg = byteArrayToImage(cvr);
                    ArrPic[i].Image = convertedImg;
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Không lấy được nội dung trong table Phim. Lỗi rồi!!!");
            }
        }
コード例 #8
0
 private void setCombobox2()
 {
     comboBox2.DataSource    = dbPhim.LayPhim();
     comboBox2.DisplayMember = "TenPhim";
     comboBox2.ValueMember   = "TenPhim";
 }