Пример #1
0
        protected void lnkbtnSubmitProposal_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserId > -1)
                {
                    int postId = -1;
                    string title = "";
                    GetThreadTitle(out title, out postId);
                    title = txtProposalTitle.Text;
                    string body = txtProposalDescription.Text;

                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    int newPostId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Post_Add", postId, -1, UserId, "::1", title, body, false, DateTime.Now, false, PortalId, -1, false, 0, true);
                    int threadId = util.GetThreadId(newPostId);
                    int forumId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Id_From_Thread_Id", threadId);

                    var added = SqlHelper.ExecuteScalar(CONNECTION_STRING, "Forum_Forum_PostAdded", forumId, threadId, newPostId, UserId, "approve");

                    //RegisterSolutionProposal(thre;

                    // Sending emails to Thread Trackers (Subscribers)

                    util.SendEmailToThreadTrackers(threadId, newPostId, CultureInfo.CurrentCulture.ToString());
                    //SendEmailToThreadTrackers(threadId, newPostId);
                    //lblShowProposalSubmitted.Text = "yes";
                    Session["showProposeSuccess"] = true;
                    if (Request.QueryString["threadId"] != null)
                    {
                        threadId = int.Parse(Request.QueryString["threadId"]);
                        RegisterSolutionProposal(threadId, newPostId);

                        Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId);
                    }
                    else if (Request.QueryString["postId"] != null)
                    {
                        RegisterSolutionProposal(threadId, newPostId);
                        Response.Redirect(Request.Url.ToString().Replace("postid=" + postId, "postId=" + newPostId) + "#" + newPostId);
                    }
                }

                if (CultureInfo.CurrentCulture.Name == "en-GB")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(216, "");

                }
                else if (CultureInfo.CurrentCulture.Name == "el-GR")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(217, "");

                }
                else if (CultureInfo.CurrentCulture.Name == "cs-CZ")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(218, "");
                }
                else if (CultureInfo.CurrentCulture.Name == "de-AT")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(219, "");

                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
Пример #2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // On the Join Discussion page the module is not always visible
                if ((((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"] == null) || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threads") || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threadsearch")) && !UserInfo.IsInRole("Administrator"))
                {
                    ContainerControl.Visible = false;
                }
                if (Request.QueryString["threadId"] != null)
                {
                    hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();
                    sqldtsrc_ThreadInfo.DataBind();
                    rptr_ThreadInfo.DataBind();
                }
                else
                {
                    //hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();

                    int postId = Convert.ToInt32(Request.QueryString["postid"]);
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    hdnfld_ThreadId.Value = util.GetThreadId(postId).ToString();

                    sqldtsrc_ThreadInfo.DataBind();
                    rptr_ThreadInfo.DataBind();

                }
                SetTitle(DotNetNuke.Services.Localization.Localization.GetString("TopicDebateStatus.Text", LocalResourceFile));

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Пример #3
0
        protected void lnkbtnSubmitReply_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserId > -1)
                {
                    string test = ctlAttachment.lstAttachmentIDs;

                    string text = txtEditor.Text;

                    string title = "";
                    Random random = new Random();
                    //Session["ATTACHMENTS_SESSION"] =

                    int postId = -1;
                    GetThreadTitle(out title, out postId);

                    int newPostId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Post_Add", postId, -1, UserId, "::1", title, txtEditor.Text, false, DateTime.Now, false, PortalId, -1, false, 0, false);
                    // http://localhost/ourspace/OpenDebates/tabid/62/forumid/1/postid/25/scope/posts/language/en-GB/Default.aspx#25
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    int threadId = util.GetThreadId(newPostId);
                    int forumId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Id_From_Thread_Id", threadId);

                    var added = SqlHelper.ExecuteScalar(CONNECTION_STRING, "Forum_Forum_PostAdded", forumId, threadId, newPostId, UserId, "approve");

                    int attachmentsSession = (int)Session["ATTACHMENTS_SESSION"];
                    AssignAttachmentsToPost(attachmentsSession, newPostId);

                    util.SubscribeUserToThread(threadId, forumId, UserId);

                    //Forum.PostConnector postConnector = new Forum.PostConnector();

                   //List<Entities.Content.Taxonomy.Term> terms = new List<Entities.Content.Taxonomy.Term>();
                    //postConnector.SubmitExternalPost(TabId, 381, 0, UserId, title, txtEditor.Text, forumId, threadId, ctlAttachment.lstAttachmentIDs,  "Ourspace_Texteditor:reply",threadId,terms);
                  // ctlAttachment.

                    //Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    util.SendEmailToThreadTrackers(threadId, newPostId, CultureInfo.CurrentCulture.ToString());
                    Session["showPostSuccess"] = true;

                    if (Request.QueryString["threadId"] != null)
                    {
                        threadId = int.Parse(Request.QueryString["threadId"]);

                        string[] parameters = new string[3] { "postId=" + newPostId, "forumId=" + forumId, "scope=posts" };
                        string url = DotNetNuke.Common.Globals.NavigateURL(TabId, "", parameters);

                        //Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId,true);
                        Response.Redirect(url);
                    }
                    else if (Request.QueryString["postId"] != null)
                    {
                        //Response.Redirect(Request.Url.ToString().Replace("postid=" + postId, "postId=" + newPostId) + "#" + newPostId,true);
                        string[] parameters = new string[3] { "postId=" + newPostId, "forumId=" + forumId, "scope=posts" };
                        string url = DotNetNuke.Common.Globals.NavigateURL(TabId, "", parameters);

                        //Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId,true);
                        Response.Redirect(url);
                    }
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
Пример #4
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {

                // On the Join Discussion page the module is not always visible
                if ((((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"] == null) || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threads") || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threadsearch")) && !UserInfo.IsInRole("Administrator"))
                {

                    //el-GR 93
                    // cs- 106
                    // de-AT 171
                    ContainerControl.Visible = false;
                }
                if (Request.QueryString["threadId"] != null)
                {
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();
                    sqldtsrc_submittedProposals.DataBind();
                    Repeater1.DataBind();
                    //if (util.GetPhaseId(int.Parse(hdnfld_ThreadId.Value)) == 2)
                    //{
                      //  Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "submittedProposals", (this.TemplateSourceDirectory + "/js/submittedProposals.js"));
                    //}
                    string[] parameters = new string[1] { "threadId=" + hdnfld_ThreadId.Value };
                    string url = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    url = url.Replace("en-GB", CultureInfo.CurrentCulture.ToString());
                    hprlnk_ViewAllSubmittedProposals.NavigateUrl = url;
                }
                else if(Request.QueryString["postId"] != null)
                {
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    hdnfld_ThreadId.Value = util.GetThreadId(int.Parse(Request.QueryString["postId"].ToString())).ToString();
                    sqldtsrc_submittedProposals.DataBind();
                    Repeater1.DataBind();
                   // if (util.GetPhaseId(int.Parse(hdnfld_ThreadId.Value)) == 2)
                    //{
                     //   Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "submittedProposals", (this.TemplateSourceDirectory + "/js/submittedProposals.js"));
                   // }
                    string[] parameters = new string[1] { "threadId=" + hdnfld_ThreadId.Value };
                    string url = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    url = url.Replace("en-GB", CultureInfo.CurrentCulture.ToString());
                    hprlnk_ViewAllSubmittedProposals.NavigateUrl = url;
                }
                SetTitle(DotNetNuke.Services.Localization.Localization.GetString("Title.Text",LocalResourceFile));

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }