コード例 #1
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            Thuoc thuoc = new Thuoc()
            {
                maThuoc     = int.Parse(txtMaThuoc.Text),
                tenThuoc    = txtTenThuoc.Text,
                tenGiaNhap  = float.Parse(txtDonGiaNhap.Text),
                giaBan      = float.Parse(txtGiaBan.Text),
                xuatXu      = txtXuatXu.Text,
                ngaySanXuat = dtpNgaySX.Value,
                ngayHetHan  = dtpNgayHH.Value,
                maLoaiThuoc = int.Parse(cbLoaiThuoc.SelectedValue.ToString())
            };

            command(thuoc.them());
            taiDSThuoc();
        }
コード例 #2
0
        private void txtTKLoaiThuoc_TextChanged(object sender, EventArgs e)
        {
            Thuoc thuoc = new Thuoc();

            dgvThuoc.DataSource = layDuLieu(thuoc.timKiem(txtTKTenThuoc.Text, txtTKLoaiThuoc.Text));
        }