コード例 #1
0
        private HTMLContentInfo GetHTMLContent(int portalID, int userModuleID, string cultureName)
        {
            List <KeyValuePair <string, string> > ParaMeterCollection = new List <KeyValuePair <string, string> >();

            ParaMeterCollection.Add(new KeyValuePair <string, string>("@PortalID", GetPortalID.ToString()));
            ParaMeterCollection.Add(new KeyValuePair <string, string>("@UsermoduleID", userModuleID.ToString()));
            ParaMeterCollection.Add(new KeyValuePair <string, string>("@CultureName", cultureName.ToString()));

            SQLHandler sagesql = new SQLHandler();
            //ArrayList arrColl = DataSourceHelper.FillCollection(sagesql.ExecuteAsDataReader("dbo.sp_HtmlTextGetByPortalAndUserModule", ParaMeterCollection), typeof(HTMLContentInfo));
            HTMLContentInfo objHtmlInfo = sagesql.ExecuteAsObject <HTMLContentInfo>("dbo.sp_HtmlTextGetByPortalAndUserModule", ParaMeterCollection);

            //if (arrColl != null)
            //{
            //    objHtmlInfo = (HTMLContentInfo)arrColl[0];
            //}
            return(objHtmlInfo);
        }
コード例 #2
0
 private void BindEditor()
 {
     try
     {
         HTMLController  _html       = new HTMLController();
         HTMLContentInfo objHtmlInfo = _html.GetHTMLContent(GetPortalID, Int32.Parse(hdnUserModuleID.Value), ddlLanuage.SelectedValue.ToString());//GetCurrentCultureName
         if (objHtmlInfo != null)
         {
             txtBody.Text                = objHtmlInfo.Content;
             chkPublish.Checked          = bool.Parse(objHtmlInfo.IsActive.ToString());
             chkAllowComment.Checked     = bool.Parse(objHtmlInfo.IsAllowedToComment.ToString());
             ViewState["EditHtmlTextID"] = objHtmlInfo.HtmlTextID;
             divEditWrapper.Visible      = true;
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
コード例 #3
0
 private void BindContent()
 {
     try
     {
         HTMLController  _html       = new HTMLController();
         HTMLContentInfo contentInfo = _html.GetHTMLContent(GetPortalID, Int32.Parse(SageUserModuleID), GetCurrentCultureName);
         if (contentInfo != null)
         {
             ltrContent.Text = contentInfo.Content.ToString();
             if (contentInfo.IsActive == true)
             {
                 divViewWrapper.Visible = true;
             }
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
コード例 #4
0
        private void Edit(int EditID)
        {
            HTMLController objHtml = new HTMLController();

            try
            {
                HTMLContentInfo CommentInfo = objHtml.HtmlCommentGetByHTMLCommentID(GetPortalID, EditID);
                if (CommentInfo != null)
                {
                    txtComment.Text          = CommentInfo.Comment;
                    chkApprove.Checked       = (bool)CommentInfo.IsApproved;
                    chkIsActive.Checked      = (bool)CommentInfo.IsActive;
                    Session["EditCommentID"] = EditID;
                    HideAll();
                    divViewWrapper.Visible = true;
                    divEditComment.Visible = true;
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
コード例 #5
0
        private void BindContent()
        {
            try
            {
                HTMLController  _html       = new HTMLController();
                HTMLContentInfo contentInfo = _html.GetHTMLContent(GetPortalID, Int32.Parse(hdnUserModuleID.Value), GetCurrentCultureName);
                if (contentInfo != null)
                {
                    hdfHTMLTextID.Value = contentInfo.HtmlTextID.ToString();
                    ltrContent.Text     = contentInfo.Content.ToString();
                    if (contentInfo.IsActive == true)
                    {
                        divViewWrapper.Visible = true;

                        if (HTMLController.IsAuthenticatedToEdit(hdnUserModuleID.Value, GetUsername, GetPortalID) && GetUsername != SystemSetting.SYSTEM_USER_NOTALLOW_HTMLCOMMENT[0])
                        {
                            divEditContent.Visible = true;
                        }
                        else
                        {
                            divEditContent.Visible = false;
                        }

                        if (IsAuthenticatedForComment() && contentInfo.IsAllowedToComment == true && GetUsername != SystemSetting.SYSTEM_USER_NOTALLOW_HTMLCOMMENT[0])
                        {
                            divAddComment.Visible  = true;
                            divViewComment.Visible = true;
                            if (!IsPostBack)
                            {
                                BindComment();
                            }
                        }
                        else
                        {
                            divAddComment.Visible  = false;
                            divViewComment.Visible = true;
                            divEditComment.Visible = false;
                            if (!IsPostBack)
                            {
                                BindComment();
                            }
                        }
                    }
                    else
                    {
                        HideAll();
                        divAddComment.Visible  = false;
                        divViewComment.Visible = false;
                        divEditComment.Visible = false;
                        if (HTMLController.IsAuthenticatedToEdit(hdnUserModuleID.Value, GetUsername, GetPortalID) && GetUsername != SystemSetting.SYSTEM_USER_NOTALLOW_HTMLCOMMENT[0])
                        {
                            divViewWrapper.Visible = true;
                            divEditContent.Visible = true;
                        }
                    }
                }
                else if (contentInfo == null && Request.QueryString["ManageReturnUrl"] != null && GetUsername != SystemSetting.SYSTEM_USER_NOTALLOW_HTMLCOMMENT[0])
                {
                    HideAll();
                    divEditWrapper.Visible = true;
                    divAddComment.Visible  = false;
                    divViewComment.Visible = false;
                    BindEditor();
                }
                else
                {
                    if (HTMLController.IsAuthenticatedToEdit(hdnUserModuleID.Value, GetUsername, GetPortalID) && GetUsername != SystemSetting.SYSTEM_USER_NOTALLOW_HTMLCOMMENT[0])
                    {
                        HideAll();
                        divViewWrapper.Visible = true;
                        divEditContent.Visible = true;
                        divAddComment.Visible  = false;
                        divViewComment.Visible = false;
                    }
                    else
                    {
                        HideAll();
                        divEditContent.Visible = false;
                        divAddComment.Visible  = false;
                        divViewComment.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }