Ejemplo n.º 1
0
        public SanPhamChiTiet_Form(int ma_sp)
        {
            this._ma_sp = ma_sp;
            InitializeComponent();
            DataRow dr = sanpham.SanPham_GetByID(ma_sp).Rows[0];

            txtMaSP.Text   = dr["ma_sp"].ToString();
            txtTenSP.Text  = dr["ten_sp"].ToString();
            txtMota.Text   = dr["mo_ta"].ToString();
            txtGia.Text    = dr["gia"].ToString();
            TenAnh         = dr["hinh"].ToString();
            cbDanhmuc.Text = sanpham.GetDanhMuc(int.Parse(dr["phan_loai"].ToString()));
            string url = System.IO.Directory.GetCurrentDirectory().Replace("\\WindowsForms\\bin\\Debug", "\\Website\\Images\\SanPham\\" + dr["hinh"].ToString());

            pictureBoxSP.Image = Image.FromFile(url);
            Load_cbDanhMuc();
        }
Ejemplo n.º 2
0
        private void LoadData(int ma_sp)
        {
            DataRow dr = sanpham.SanPham_GetByID(ma_sp).Rows[0];

            txtMaSP.Text   = dr["ma_sp"].ToString();
            txtTenSP.Text  = dr["ten_sp"].ToString();
            txtMota.Text   = dr["mo_ta"].ToString();
            txtGia.Text    = dr["gia"].ToString();
            cbDanhmuc.Text = sanpham.GetDanhMuc(int.Parse(dr["phan_loai"].ToString()));
            //pictureBoxSP.Image = Image.FromFile(Application.StartupPath.Replace(Ultilities.WindowsForms, Ultilities.Website + dr["hinh"].ToString()));
        }