Ejemplo n.º 1
0
 private void lsvHangHoa_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lsvHangHoa.SelectedIndices.Count > 0)
     {
         //byte[] toBytes = Encoding.ASCII.GetBytes(lsvHangHoa.SelectedItems[0].SubItems[8].Text);
         txtMaHang.Text           = lsvHangHoa.SelectedItems[0].Text;
         txtTenHang.Text          = lsvHangHoa.SelectedItems[0].SubItems[1].Text;
         txtSoLuong.Text          = lsvHangHoa.SelectedItems[0].SubItems[2].Text;
         txtDonGia.Text           = lsvHangHoa.SelectedItems[0].SubItems[3].Text;
         cb_MaNhaCC.SelectedIndex = cb_MaNhaCC.FindString(lsvHangHoa.SelectedItems[0].SubItems[4].Text);
         cb_MaLoai.SelectedIndex  = cb_MaLoai.FindString(lsvHangHoa.SelectedItems[0].SubItems[5].Text);
         txtND_TomTat.Text        = lsvHangHoa.SelectedItems[0].SubItems[6].Text;
         cb_DVT.SelectedIndex     = cb_DVT.FindString(lsvHangHoa.SelectedItems[0].SubItems[7].Text);
         pic_HinhAnh.Image        = byteArrayToImage(hh.LayHinhANh(txtMaHang.Text));
     }
     else
     {
         clearForm();
     }
 }