Exemple #1
0
        public void XoaThuoc()
        {
            ThuocDTO thuoc = new ThuocDTO();

            thuocbus      = new ThuocBUS();
            thuoc.MaThuoc = "32";
            bool kq = thuocbus.xoa(thuoc);

            Assert.AreEqual(true, kq);
        }
        private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            th         = new ThuocDTO();
            th.MaThuoc = temp;
            thBus      = new ThuocBUS();
            bool kq = thBus.xoa(th);

            if (kq == false)
            {
                MessageBox.Show("Xóa Thuốc thất bại. Vui lòng kiểm tra lại dũ liệu", "Result", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
            }
            else
            {
                MessageBox.Show("Xóa Thuốc thành công", "Result");
            }
            load_data();
        }
Exemple #3
0
        private void tb_xoa_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn muốn xóa thông tin thuốc?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                ThuocDTO thDTO = new ThuocDTO();
                thDTO.MaThuoc1 = tb_mathuoc.Text;

                bool kq = bus.xoa(thDTO);
                if (kq == false)
                {
                    MessageBox.Show("Xóa thông tin thuốc thất bại.");
                }

                else
                {
                    MessageBox.Show("Xóa thông tin thuốc thành công");
                    dataGridView1.DataSource = bus.loadDuLieuThuoc();//load lại dữ liệu cho datagridview
                }
                KhoaButton();
            }
        }