コード例 #1
0
        private void StallSchedule_Load(object sender, EventArgs e)
        {
            Stallbll  stall = new Stallbll();
            DataTable dt    = stall.datagridload();

            dgStall.DataSource = dt;
        }
コード例 #2
0
        private void AddStall_Load(object sender, EventArgs e)
        {
            Stallbll  stalls = new Stallbll();
            DataTable dtts   = stalls.datagridload();

            dgStall.DataSource = dtts;
            datadisplay();
        }
コード例 #3
0
        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;
                }
            }
        }