Exemplo n.º 1
0
        private void comboBoxTenSP_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox senderComboBox = (ComboBox)sender;

            if (senderComboBox.Text.ToString() == "Thêm mới")
            {
                this.Enabled = false;
                NhapSanPham nhapSanPham = new NhapSanPham(this);
                nhapSanPham.Closed += NhapSanPham_Closed;
                nhapSanPham.Show();
                textBoxLoai.Text = "";
                textBoxNSX.Text  = "";
                textBoxDVT.Text  = "";
            }
            else if (senderComboBox.Text.ToString() == "Chọn sản phẩm")
            {
                textBoxLoai.Text = "";
                textBoxNSX.Text  = "";
                textBoxDVT.Text  = "";
            }
            else
            {
                List <SanPham> temp;
                string         s = senderComboBox.Text.ToString();
                temp             = data.GetSanPham(s);
                textBoxLoai.Text = temp[0].PhanLoai;
                textBoxNSX.Text  = temp[0].NuocSanXuat;
                textBoxDVT.Text  = temp[0].DonVi;
            }
        }
Exemplo n.º 2
0
 public Loai(NhapSanPham fsp)
 {
     InitializeComponent();
     frmsp = fsp;
 }