private void StallSchedule_Load(object sender, EventArgs e) { Stallbll stall = new Stallbll(); DataTable dt = stall.datagridload(); dgStall.DataSource = dt; }
private void AddStall_Load(object sender, EventArgs e) { Stallbll stalls = new Stallbll(); DataTable dtts = stalls.datagridload(); dgStall.DataSource = dtts; datadisplay(); }
private void dgStall_CellClick(object sender, DataGridViewCellEventArgs e) { Stallbll stall = new Stallbll(); int columnIndex = dgStall.CurrentCell.ColumnIndex; int seminarid = int.Parse(dgStall.CurrentRow.Cells["sid"].Value.ToString()); stall.Id = seminarid; if (dgStall.CurrentRow.Cells[columnIndex].Value.ToString() == "Delete") { DialogResult confirmResult = MessageBox.Show("Are you sure to delete this item??", "Confirm Delete?", MessageBoxButtons.YesNo); if (confirmResult == DialogResult.Yes) { stall.Delete(); DataTable dt = stall.datagridload(); dgStall.DataSource = dt; } } }