public frmLoad(HugoLand.Controller.MondeController mondeControll, HugoLand.Model.HugoWorldEntities context) { InitializeComponent(); _context = context; _mondeController = mondeControll; List<Monde> lstmondes = _mondeController.GetListMonde(); dataGridView1.DataSource = lstmondes; }
public frmLoad(HugoLand.Controller.MondeController mondeControll, HugoLand.Model.HugoWorldEntities context) { InitializeComponent(); _context = context; _mondeController = mondeControll; List <Monde> lstmondes = _mondeController.GetListMonde(); dataGridView1.DataSource = lstmondes; }
/// <summary> /// Supprime le monde selectionné /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { _mondeController.DeleteMonde((int)dataGridView1.SelectedRows[0].Cells[0].Value); List <Monde> lstmondes = _mondeController.GetListMonde(); dataGridView1.DataSource = lstmondes; } }