예제 #1
0
        public int XoaDichVu()
        {
            DialogResult kq = MessageBox.Show("Xóa dịch vụ sẽ xóa mọi hóa đơn liên quan đến dịch vụ này, " + "Bạn có muốn xóa không?", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (kq == DialogResult.No)
            {
                return(0);
            }
            List <int> maList = new List <int>();

            maList.Add(maDV);
            dv_bll.XoaDichVu(maList);
            MessageBox.Show("Xóa dịch vụ thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            return(1);
        }
        void XoaDichVu()
        {
            DataGridViewSelectedRowCollection tem = dgvQuanLyDV.SelectedRows;
            int        ma;
            List <int> maList = new List <int>();

            foreach (DataGridViewRow r in tem)
            {
                ma = Convert.ToInt32(r.Cells[0].Value.ToString());
                maList.Add(ma);
            }
            dv_bll.XoaDichVu(maList);
            MessageBox.Show("Đã xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            HienThiDanhSachDichVu();
        }