Example #1
0
        private void TaiDuLieu()
        {
            DataTable dtLoaiSanPham = _LoaiSanPhamBUS.LayBangLoaiSanPham();

            cboLoaiSP.DataSource    = dtLoaiSanPham;
            cboLoaiSP.DisplayMember = "TenLoaiSanPham";
            cboLoaiSP.ValueMember   = "MaLoaiSanPham";

            DataTable dtHangSanXuat = _HangSanXuatBUS.LayBangHangSanXuat();

            cboHSX.DataSource    = dtHangSanXuat;
            cboHSX.DisplayMember = "TenHangSanXuat";
            cboHSX.ValueMember   = "MaHangSanXuat";

            if (strMaSP != null)
            {
                dtSanPham         = _SanPhamBUS.LayBangSanPham(strMaSP);
                txtTenSP.Text     = dtSanPham.Rows[0]["TenSanPham"].ToString();
                txtDonViTinh.Text = dtSanPham.Rows[0]["DonViTinh"].ToString();
                numBH.Value       = Convert.ToInt16(dtSanPham.Rows[0]["BaoHanh"].ToString());
                txtGiaMua.Text    = dtSanPham.Rows[0]["GiaMua"].ToString();
                txtGiaBan.Text    = dtSanPham.Rows[0]["GiaBan"].ToString();
                TienIch.DinhDangSoTextBox(txtGiaBan);
                TienIch.DinhDangSoTextBox(txtGiaMua);
                txtKhuyenMai.Text       = dtSanPham.Rows[0]["KhuyenMai"].ToString();
                cboLoaiSP.SelectedValue = dtSanPham.Rows[0]["MaLoaiSanPham"].ToString();
                cboHSX.SelectedValue    = dtSanPham.Rows[0]["MaHangSanXuat"].ToString();
                rtbMota.Text            = dtSanPham.Rows[0]["MoTa"].ToString();
                txtGhiChu.Text          = dtSanPham.Rows[0]["GhiChu"].ToString();
                picHinh.Image           = new Bitmap(dtSanPham.Rows[0]["Hinh"].ToString());
                lblSL.Text = dtSanPham.Rows[0]["SoLuong"].ToString();
            }
        }
Example #2
0
 private void txtTraTruoc_KeyUp(object sender, KeyEventArgs e)
 {
     TienIch.DinhDangSoTextBox(txtTraTruoc);
 }
Example #3
0
 private void txtGiaBanDen_KeyUp(object sender, KeyEventArgs e)
 {
     TienIch.DinhDangSoTextBox(txtGiaBanDen);
 }