Example #1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            CheckBox check;
            int      count = gvCourses.Rows.Count;

            for (int i = 0; i < count; i++)
            {
                check = (CheckBox)gvCourses.Rows[i].FindControl("chkDelete");
                String asdasd = gvCourses.Rows[i].Cells[3].Text;
                if (check.Checked)
                {
                    String program = gvCourses.Rows[i].Cells[1].Text;
                    String title   = gvCourses.Rows[i].Cells[3].Text;
                    String crn     = gvCourses.Rows[i].Cells[2].Text;


                    //delete checked course
                    Boolean result = proxy.deleteCourse(title, program, crn);
                    if (result)
                    {
                        Response.Write("<script>alert('Course Delete Success.')</script>");
                        getCourses();
                    }
                    else
                    {
                        Response.Write("<script>alert('Course Delete Failed.')</script>");
                    }
                }
            }
        }