예제 #1
0
        protected void lnkbtn_ApproveThread_Click(object sender, EventArgs e)
        {
            int threadId = -1;// GET QUERYSTRING
            if (Request.QueryString["threadid"] != null)
            {
                threadId = Convert.ToInt32(Request.QueryString["threadid"]);

                // Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
                // int currentForumID = Convert.ToInt32(ForumIDLabel.Text);

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                int currentForumID = util.GetForumId(threadId);
                Dictionary<int, int> fr = new Dictionary<int, int>(); // Forum correspondence
                fr.Add(18, 32); // Crime

                fr.Add(19, 33); // Drugs and alcohol

                fr.Add(20, 34); // Economy

                fr.Add(13, 3); // Education

                fr.Add(21, 35); // Employment

                fr.Add(6, 1); // Environment

                fr.Add(22, 36); // Health

                fr.Add(23, 37); // Human rights

                fr.Add(24, 38); // Innovation

                fr.Add(53, 52); // Politics

                fr.Add(49, 48); // Other
                int newForumID = fr[currentForumID];
                DotNetNuke.Data.DataProvider dp = DotNetNuke.Data.DataProvider.Instance();
                //int threadID = Convert.ToInt32(e.CommandArgument);

                int moderatorID = 0;
                string notes = "some notes";
                SqlHelper.ExecuteNonQuery(CONNECTION_STRING, "Forum_Thread_Move", threadId, newForumID, moderatorID, notes);
                //SqlHelper.execut
                util.UpdateThreadPhase(threadId, 2);

                String[] urlParams = {"forumid=" + newForumID,
                                   "postid=" + threadId,
                                   "scope=posts"};
               string url = Globals.NavigateURL(62, "", urlParams);
               util.SendEmailToThreadTrackersAboutMovingToPhase2(newForumID, threadId);
               util.TransferThreadSubscriptionsToPhase2(threadId, newForumID);
                //url = url + "#" + postId.ToString();
                Response.Redirect(url);
                //http://localhost/ourspace/OpenDebates/tabid/62/forumid/37/threadid/99/scope/posts/language/en-GB/Default.aspx

            }
        }