예제 #1
0
        private void removeBtn_Click(object sender, EventArgs e)
        {
            if (khachHangGridView.SelectedRows.Count == 0)
            {
                MessageBox.Show("Vui lòng chọn dòng cần xoá!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DialogResult isDelete = MessageBox.Show("Bạn có chắc chắn là muốn xoá dòng hiện tại!!!", "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (isDelete == DialogResult.No)
            {
                return;
            }

            UIQuanLy.Alert("Xoá thành công!!!", AlertForm.enmType.Error);

            KhachHang selectedItem = khachHangGridView.SelectedRows[0].Tag as KhachHang;

            new KhachHangDAO().removeData(selectedItem);
            //QuanLyDAO<KhachHang>.remove(selectedItem, "CMND");

            khachHangGridView.Rows.Clear();
            initListView();
        }
예제 #2
0
        private void removeBtn_Click(object sender, EventArgs e)
        {
            if (nhanVienGridView.SelectedRows.Count == 0)
            {
                MessageBox.Show("Vui lòng chọn dòng cần xoá!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DialogResult isDelete = MessageBox.Show("Bạn có chắc chắn là muốn xoá dòng hiện tại!!!", "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (isDelete == DialogResult.No)
            {
                return;
            }

            UIQuanLy.Alert("Xoá thành công!!!", AlertForm.enmType.Error);

            NhanVien selectedNV = nhanVienGridView.SelectedRows[0].Tag as NhanVien;

            new NhanVienDAO().removeData(selectedNV);

            initListView();
        }
예제 #3
0
        private void initUIQuanLy()
        {
            UIQuanLy uiQuanLy = new UIQuanLy(this.Tag);

            this.Controls.Add(uiQuanLy);
        }