public frmSanPhamSua(frmSanPham f, string masp)
        {
            InitializeComponent();
            BU_NhaSanXuat nsx = new BU_NhaSanXuat();

            cbxMaNSX.DataSource    = nsx.getAll();
            cbxMaNSX.DisplayMember = "TENNSX";
            cbxMaNSX.ValueMember   = "MANSX";
            tg           = f;
            txtMaSP.Text = masp;
            BU_SanPham sp  = new BU_SanPham();
            DataTable  tb  = sp.tkMa(masp);
            DataRow    row = tb.Rows[0];

            txtBoNho.Text     = row["BONHO"].ToString();
            txtCamera.Text    = row["CAMERA"].ToString();
            txtCPU.Text       = row["CPU"].ToString();
            txtDonGiaBan.Text = row["DONGIABAN"].ToString();
            //txtDonGiaNhap.Text = row["DONGIANHAP"].ToString();
            txtDVT.Text            = row["DONVITINH"].ToString();
            txtHeDieuHanh.Text     = row["HEDIEUHANH"].ToString();
            txtKetNoi.Text         = row["KETNOI"].ToString();
            txtPin.Text            = row["PIN"].ToString();
            txtRam.Text            = row["RAM"].ToString();
            txtSoLuong.Text        = row["SOLUONG"].ToString();
            txtTenSP.Text          = row["TENSP"].ToString();
            cbxMaNSX.SelectedValue = row["MANSX"].ToString();
        }
Ejemplo n.º 2
0
        public void loadcombox()
        {
            BU_NhaSanXuat thucthi = new BU_NhaSanXuat();
            DataTable     dt      = thucthi.getAll();

            if (dt != null)
            {
                cbxMaNSX.DataSource    = dt;
                cbxMaNSX.ValueMember   = "MANSX";
                cbxMaNSX.DisplayMember = "TENNSX";
            }
            else
            {
                MessageBox.Show(thucthi.Error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }