コード例 #1
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);
     }
 }
コード例 #2
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);
     }
 }
コード例 #3
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);
            }
        }