Example #1
0
        protected void lvTheme_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            string themeId = (lvTheme.Items[(e.Item.DataItemIndex)].FindControl("themeId") as HtmlInputHidden).Value.Trim();

            if (e.CommandName == "Link")//点击主题标题链接时触发
            {
                Model.Theme theme = new Model.Theme()
                {
                    ThemeId = themeId
                };
                if (theme.IsError)
                {
                    Msg = "参数格式错误";
                    printMsgToClient();
                    return;
                }
                ThemeManagement.Click(theme.ThemeId);
                Response.Redirect("~/ThemeDisplay.aspx?themeId=" + themeId + "&path=" + lblPath.Text);
            }
            if (e.CommandName == "Del")
            {
                Msg = CollectThemeManagement.UncollectTheme(Convert.ToString(Session["memberId"]), themeId);
                printMsgToClient();
                Bind();
            }
        }
Example #2
0
        protected void collect_ServerClick(object sender, EventArgs e)//收藏
        {
            //判断是否登录
            if (Session["role"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }

            //收藏,主题id通过Request.QueryString["themeId"]获取
            CollectTheme col = new CollectTheme();

            col.CollectId = CollectThemeManagement.CreatCollectId();
            col.ThemeId   = Request.QueryString["themeId"].ToString().Trim();
            col.MemberId  = Session["memberId"].ToString().Trim();
            col.Remark    = "备注";
            Msg           = CollectThemeManagement.CollectTheme(col);
            printMsgToClient();
        }