コード例 #1
0
        public void populate()
        {
            CrimeDataBase crimeDB = new CrimeDataBase();

            list_crimes = crimeDB.Select_All();
            CrimeGridView.DataSource = list_crimes;
        }
コード例 #2
0
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            c         = new Crime();
            c.crimeID = Convert.ToInt32(CrimeGridView.CurrentRow.Cells[0].Value.ToString());
            CrimeDataBase crimeDB = new CrimeDataBase();

            crimeDB.delete(c);
            populate();
        }
コード例 #3
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            CrimeDataBase crimeDB = new CrimeDataBase();

            c                  = new Crime();
            c.crimeType        = crimeTxt.Text;
            c.crimeDate        = crimeDateTxt.Text;
            c.location         = locationTxt.Text;
            c.noOfPeopleArrest = Convert.ToInt32(arrestTxt.Text);
            crimeDB.insert(c);
            populate();
        }
コード例 #4
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            CrimeDataBase crimeDB = new CrimeDataBase();

            c                  = new Crime();
            c.crimeID          = Convert.ToInt32(CrimeGridView.CurrentRow.Cells[0].Value.ToString());
            c.crimeType        = crimeTxt.Text;
            c.crimeDate        = crimeDateTxt.Text;
            c.location         = locationTxt.Text;
            c.noOfPeopleArrest = Convert.ToInt32(arrestTxt.Text);
            crimeDB.update(c);
            populate();
        }