private void txtSearchProduct_TextChanged(object sender, EventArgs e) { DTO_Product ex = new DTO_Product(); BLL_DataProduct bl = new BLL_DataProduct(); string keyword = txtSearchProduct.Text; try { if (keyword == "") { tensp = txtProductName.Text; txtAmoutProduct.Text = ""; txtPriceProduct.Text = ""; txtProductName.Text = ""; pictureBoxImageeProduct.Image = null; return; } else { ex = bl.searchProductBill(keyword); int khuyenmai = ex.KhuyenMai; txtProductName.Text = ex.TenSP; decimal giaban = (ex.GiaBan * ((100 - (decimal)khuyenmai) / 100)); txtPriceProduct.Text = Convert.ToString(giaban); pictureBoxImageeProduct.Image = byteArrayToImage(ex.HinhAnh); } } catch { //MessageBox.Show(exx.Message); } }
private void ShowDataProduct() { //Show dữ liệu BLL_DataProduct dataProduct = new BLL_DataProduct(); DataTable dt = dataProduct.dataShowProduct(); dataGridViewProduct.DataSource = dt; dataGridViewProduct.Columns["Hình ảnh"].Width = 150; }
private void ListDataTypeProduct() { BLL_DataProduct dataProduct = new BLL_DataProduct(); comboBoxTypeProduct.DataSource = dataProduct.ListTypeProduct(); comboBoxTypeProduct.DisplayMember = "tenLoaiSP"; comboBoxTypeProduct.ValueMember = "maLSP"; }
private void txtSearch_TextChanged(object sender, EventArgs e) { BLL_DataProduct bl = new BLL_DataProduct(); //string keyword = ; if (txtSearch.Text != "") { DataTable dt = bl.SearchProd(txtSearch.Text); dataGridViewProduct.DataSource = dt; } else { DataTable dt = bl.dataShowProduct(); dataGridViewProduct.DataSource = dt; } ClearForms(); }