Exemple #1
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            int    vitri  = gridView1.GetFocusedDataSourceRowIndex();
            string MaHang = gridView1.GetRowCellValue(vitri, "MaHang").ToString();

            HangHoaBUS.Xoa(MaHang);
            gridControl1.DataSource = HangHoaBUS.DanhSach();
        }
Exemple #2
0
        private void XoaHangHoa()
        {
            DialogResult hopThoai = MessageBox.Show("Bạn chắc chắn muốn xóa những dòng bạn chọn?", "Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (hopThoai == DialogResult.Yes)
            {
                HangHoaBUS itemBUS = new HangHoaBUS();
                for (int i = 0; i < gvDanhMucHangHoa.SelectedRowsCount; i++)
                {
                    int ma = int.Parse(gvDanhMucHangHoa.GetRowCellValue(gvDanhMucHangHoa.GetSelectedRows()[i], gvDanhMucHangHoa.Columns["Id"]).ToString());
                    itemBUS.Xoa(ma);
                }
            }
            this.LayDanhSachHangHoa();
        }