コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int favQueListID = Request.QueryString["id"] == null ? 0 : Int32.Parse(Request.QueryString["id"]);
                if (favQueListID != 0)
                {
                    bool deleteMode = Request.QueryString["delete"] == null ? false : bool.Parse(Request.QueryString["delete"]);
                    if (deleteMode)
                    {
                        DBUtils dbUtilsObj = new DBUtils();

                        String deleteQuery
                            = "delete from Q_Favorite_List_has_Q_Question "
                              + " where Q_Favorite_List_favorite_list_id =" + favQueListID;
                        dbUtilsObj.CUDOperations(deleteQuery);

                        deleteQuery
                            = "DELETE FROM Q_FAVORITE_LIST_QUESTION_SCORE WHERE FAVORITE_LIST_ID = " + favQueListID;
                        dbUtilsObj.CUDOperations(deleteQuery);

                        String updateQuery
                            = "delete from Q_Favorite_List "
                              + " where favorite_list_id = " + favQueListID;
                        dbUtilsObj.CUDOperations(updateQuery);

                        Response.Redirect("~/KMSPages/QueFavQuestionList.aspx");
                    }

                    QueDao queDaoObj = new QueDao();
                    MyPocos.QueFavQuestionList favList = queDaoObj.getFavQuestionListByID(favQueListID);
                    favListName1.Text = favList.favQuestionName;

                    questionList = queDaoObj.getQuestionListByFavID(favQueListID);
                    questionsListSelectedTag.DataSource = questionList;
                    questionsListSelectedTag.DataBind();
                }
            }
        }
コード例 #2
0
        public void setEditData()
        {
            int favQueListID = Request.QueryString["id"] == null ? 0 : Int32.Parse(Request.QueryString["id"]);
            if (favQueListID != 0)
            {
                QueDao queDaoObj = new QueDao();
                MyPocos.QueFavQuestionList favList = queDaoObj.getFavQuestionListByID(favQueListID);

                questionList = queDaoObj.getQuestionListByFavID(favQueListID);
                ViewState["selectedQuestionList"] = questionList;

                favListName.Text = favList.favQuestionName;
                questionsListSelectedTag.DataSource = questionList;
                questionsListSelectedTag.DataBind();

                favListName2.Text = favList.favQuestionName;
                questionsListSelectedTag2.DataSource = questionList;
                questionsListSelectedTag2.DataBind();

                Wizard1.ActiveStepIndex = 0;
            }
        }