Esempio n. 1
0
        //NEW for Lab 8
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //If it is empty, they didnt get here from search and this should do nothing
            if (lblPersonID.Text != "PersonID:")
            {
                string idStr = lblPersonID.Text;
                idStr = idStr.Replace("PersonID: ", "");//strip string down to just a number
                int id = Convert.ToInt32(idStr);

                PersonV2 temp = new PersonV2();

                lblFeedback.Text = temp.DeleteOnePersonV2(id);
            }
            else//this runs if they try to delete with a form they filled out by hand
            {
                lblFeedback.Text = "Cant delete record not accessed through search";
            }
        }