Exemple #1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string      movieID = txtMovieID.Text;
            ScheduleDAO scheDao = new ScheduleDAO();

            scheDao.AdminScheduleDelete(movieID);
            if (MovieDao.DeleteMovie(movieID))
            {
                List <MovieDTO> list = (List <MovieDTO>)Session["AdminMovieSearch"];
                foreach (MovieDTO item in list)
                {
                    if (item.MovieID.Equals(movieID))
                    {
                        list.Remove(item);
                    }
                }
                gvStaffList.DataSource = list;
                gvStaffList.DataBind();
                SetMessageTextAndColor("Successfully deleted", Color.Green);
                Clear();
            }
            else
            {
                SetMessageTextAndColor("Failed to delete", Color.Red);
            }
        }