Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(Session[TabId.ToString() + "_Message"] as string) && !String.IsNullOrEmpty(Session[TabId.ToString() + "_Type"] as string))
         {
             if (Session[TabId.ToString() + "_Message"].ToString() != "" && Session[TabId.ToString() + "_Type"].ToString() != "")
             {
                 ClassCommon.THONGBAO_TOASTR(Page, null, _currentUser, Session[TabId.ToString() + "_Message"].ToString(), "Thông báo", Session[TabId.ToString() + "_Type"].ToString());
             }
             Session[TabId.ToString() + "_Message"] = "";
             Session[TabId.ToString() + "_Type"]    = "";
         }
         DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.jQuery);
         DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.DnnPlugins);
         DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(this.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn);
         Get_Cache();
         if (!IsPostBack)
         {
             LoadDS(0);
             //if (ModulePermissionController.CanAdminModule(this.ModuleConfiguration) == true)
             //{
             //    btn_ThemMoi.Visible = true;
             //    int count_columns_table = dgDanhSach.Columns.Count;
             //}
         }
     }
     catch (Exception ex)
     {
         ClassCommon.THONGBAO_TOASTR(Page, ex, _currentUser, "Có lỗi trong quá trình xữ lý, vui lòng liên hệ với quản trị!", "Thông báo lỗi", "error");
     }
 }
        private void LoadPanes()
        {
            PanesDropDownList.Items.Add(new ListItem(LocalizeString("FullPage"), "dnn_full_page"));

            foreach (string pane in PortalSettings.ActiveTab.Panes)
            {
                Control obj = (Control)DotNetNuke.Common.Globals.FindControlRecursiveDown(Page, pane);

                PanesDropDownList.Items.Add(new ListItem(pane, obj.ClientID));
            }

            if (Settings["DefaultPane"] != null)
            {
                PanesDropDownList.SelectedValue = Settings["DefaultPane"].ToString();
            }

            Session["PanesDropDown_" + TabId.ToString()] = PanesDropDownList.Items;

            PanesDropDownList.Attributes.Remove("style");

            if (Settings["HideDefaultPane"] != null)
            {
                if (Convert.ToBoolean(Settings["HideDefaultPane"].ToString()))
                {
                    PanesDropDownList.Attributes.Add("style", "display: none;");
                }
            }
        }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Get_Cache();
         if (!String.IsNullOrEmpty(Session[TabId.ToString() + _currentUser.UserID + "_Message"] as string) && !String.IsNullOrEmpty(Session[TabId.ToString() + _currentUser.UserID + "_Type"] as string))
         {
             if (Session[TabId.ToString() + _currentUser.UserID + "_Message"].ToString() != "" && Session[TabId.ToString() + _currentUser.UserID + "_Type"].ToString() != "")
             {
                 ClassCommon.THONGBAO_TOASTR(Page, null, _currentUser, Session[TabId.ToString() + _currentUser.UserID + "_Message"].ToString(), "Thông báo", Session[TabId.ToString() + _currentUser.UserID + "_Type"].ToString());
             }
             Session[TabId.ToString() + _currentUser.UserID + "_Message"] = "";
             Session[TabId.ToString() + _currentUser.UserID + "_Type"]    = "";
         }
         DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.jQuery);
         DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.DnnPlugins);
         DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(this.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn);
         if (!IsPostBack)
         {
             txtTuNgay.SelectedDate  = DateTime.Now.AddYears(-1);
             txtDenNgay.SelectedDate = DateTime.Now;
             LoadDSNhomTV();
             drpDonVi.SelectedValue = "0";
             LoadDanhSach(0, 0);
         }
     }
     catch (Exception ex)
     {
         ClassCommon.ShowToastr(Page, "Có lỗi xãy ra, vui lòng liên hệ quản trị", "Thông báo", "error");
     }
 }
Example #4
0
        protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList ddl = sender as DropDownList;

            ProductGroupId = Convert.ToInt32(ddl.SelectedValue);

            int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString());

            if (ProductGroupId == -1)
            {
                Controller.DeleteProductFilter(PortalId, FilterSessionId, "ProductGroup");
                Response.Redirect(Globals.NavigateURL(dynamicTab));
            }

            SetFilter(ProductGroupId, IncludeChilds);

            ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId);

            if (pgi != null && pgi.ProductListTabId != -1)
            {
                Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString()));
            }
            else
            {
                Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString()));
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vJavascriptMask = ClassParameter.vJavascriptMaskNumber;
            HD_ID           = Convert.ToInt32(Request.QueryString["HD_ID"]);
            try
            {
                if (!String.IsNullOrEmpty(Session[TabId.ToString() + "_Message"] as string) && !String.IsNullOrEmpty(Session[TabId.ToString() + "_Type"] as string))
                {
                    if (Session[TabId.ToString() + "_Message"].ToString() != "" && Session[TabId.ToString() + "_Type"].ToString() != "")
                    {
                        ClassCommon.THONGBAO_TOASTR(Page, null, _currentUser, Session[TabId.ToString() + "_Message"].ToString(), "Thông báo", Session[TabId.ToString() + "_Type"].ToString());
                    }
                    Session[TabId.ToString() + "_Message"] = "";
                    Session[TabId.ToString() + "_Type"]    = "";
                }

                if (!IsPostBack)
                {
                    SetInfoForm(HD_ID);
                    LoadDSTT(HD_ID);
                    txtGhiChu.Attributes.Add("maxlength", txtGhiChu.MaxLength.ToString());
                    txtTenCongTrinh.Attributes.Add("maxlength", txtTenCongTrinh.MaxLength.ToString());
                    GetSessionTapTin();
                }
            }
            catch (Exception ex)
            {
                ClassCommon.THONGBAO_TOASTR(Page, ex, _currentUser, "Có lỗi trong quá trình xử lý, vui lòng liên hệ với quản trị!", "Thông báo lỗi", "error");
                log.Error("", ex);
            }
        }
Example #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     vJavascriptMask = ClassParameter.vJavascriptMaskNumber;
     if (!String.IsNullOrEmpty(Session[TabId.ToString() + "_Message"] as string) && !String.IsNullOrEmpty(Session[TabId.ToString() + "_Type"] as string))
     {
         if (Session[TabId.ToString() + "_Message"].ToString() != "" && Session[TabId.ToString() + "_Type"].ToString() != "")
         {
             ClassCommon.THONGBAO_TOASTR(Page, null, _currentUser, Session[TabId.ToString() + "_Message"].ToString(), "Thông báo", Session[TabId.ToString() + "_Type"].ToString());
         }
         Session[TabId.ToString() + "_Message"] = "";
         Session[TabId.ToString() + "_Type"]    = "";
     }
     DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.jQuery);
     DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.DnnPlugins);
     DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(this.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn);
     try
     {
         if (!IsPostBack)
         {
             if (Request.QueryString["UserID"] != null)
             {
                 vND_ID = Convert.ToInt32(Request.QueryString["UserID"]);
                 if (vND_ID > 0)
                 {
                     btnCapNhatTiepTuc.Visible = false;
                 }
             }
             LoadDSNhomDV();
             SetInfoForm(vND_ID);
         }
     }
     catch { }
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     HD_ID = Convert.ToInt32(Request.QueryString["HD_ID"]);
     try
     {
         if (!String.IsNullOrEmpty(Session[TabId.ToString() + "_Message"] as string) && !String.IsNullOrEmpty(Session[TabId.ToString() + "_Type"] as string))
         {
             if (Session[TabId.ToString() + "_Message"].ToString() != "" && Session[TabId.ToString() + "_Type"].ToString() != "")
             {
                 ClassCommon.THONGBAO_TOASTR(Page, null, _currentUser, Session[TabId.ToString() + "_Message"].ToString(), "Thông báo", Session[TabId.ToString() + "_Type"].ToString());
             }
             Session[TabId.ToString() + "_Message"] = "";
             Session[TabId.ToString() + "_Type"]    = "";
         }
         Get_Cache();
         if (!IsPostBack)
         {
             try
             {
                 LoadDanhSach(vCurentPage);
                 Mercolum();
             }
             catch (Exception ex)
             {
                 ClassCommon.ShowToastr(Page, ex + "", "Thông báo lỗi", "error");
                 log.Error("", ex);
             }
         }
     }
     catch (Exception ex)
     {
         ClassCommon.THONGBAO_TOASTR(Page, ex, _currentUser, "Có lỗi trong quá trình xử lý, vui lòng liên hệ với quản trị!", "Thông báo lỗi", "error");
         log.Error("", ex);
     }
 }
Example #8
0
        private string ReemplazoTags(string Query)
        {
            var mySQL = Settings[Query].ToString();

            mySQL = mySQL.Replace("[DNN:UserID]", UserId.ToString());
            mySQL = mySQL.Replace("[DNN:TabID]", TabId.ToString());
            mySQL = mySQL.Replace("[DNN:ModuleID]", ModuleId.ToString());
            mySQL = mySQL.Replace("[DNN:PortalID]", PortalId.ToString());

            try                   // si está logueado exite user info
            {
                if (UserId != -1) // si está logueado exite user info
                {
                    mySQL = mySQL.Replace("[DNN:Username]", UserInfo.Username.ToString());
                    mySQL = mySQL.Replace("[DNN:DisplayName]", UserInfo.DisplayName.ToString());
                    mySQL = mySQL.Replace("[DNN:Email]", UserInfo.Email.ToString());
                    mySQL = mySQL.Replace("[DNN:LastName]", UserInfo.LastName.ToString());
                    mySQL = mySQL.Replace("[DNN:FirstName]", UserInfo.FirstName.ToString());
                }
            }

            catch (Exception ex) // error en userinfo
            {
                Excepcion(ex);
            }
            return(mySQL);
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    //Check for existing settings and use those on this page
                    //Settings["SettingName"]

                    /* uncomment to load saved settings in the text boxes */

                    if (Settings.Contains("ExportTypeDropDownCssClass"))
                    {
                        ExportTypeDropDownCssClassTextBox.Text = Settings["ExportTypeDropDownCssClass"].ToString();
                    }

                    if (Settings.Contains("ExportButtonCssClass"))
                    {
                        ExportButtonCssClassTextBox.Text = Settings["ExportButtonCssClass"].ToString();
                    }

                    if (Settings.Contains("PaneSelectionDropDownCssClass"))
                    {
                        PaneSelectionDropDownCssClassTextBox.Text = Settings["PaneSelectionDropDownCssClass"].ToString();
                    }

                    if (Session["PanesDropDown_" + TabId.ToString()] != null)
                    {
                        ListItemCollection items = (ListItemCollection)Session["PanesDropDown_" + TabId.ToString()];

                        foreach (ListItem item in items)
                        {
                            PanesDropDownList.Items.Add(item);
                        }
                    }

                    if (Settings.Contains("DefaultPane"))
                    {
                        DefaultPaneTextBox.Text = Settings["DefaultPane"].ToString().Replace("dnn_", string.Empty);
                    }

                    if (PanesDropDownList.Items.Count <= 0)
                    {
                        DefaultPaneTextBox.Visible = true;
                        PanesDropDownList.Visible  = false;
                    }

                    if (Settings.Contains("HideDefaultPane"))
                    {
                        HideDefaultPaneCheckBox.Checked = Convert.ToBoolean(Settings["HideDefaultPane"].ToString());
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Example #10
0
        string GetUrl(DnnUrlControl ctlUrl)
        {
            if (chkCurrentPage.Checked)
            {
                return(TabId.ToString());
            }

            return(ctlUrl.Url);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            tempService = new TempService(this);
            if (!IsPostBack)
            {
                if (ProductID == -1)
                {
                    var products = from nw in Data.CV_Products
                                   join cat_ in Data.CV_CatProducts on nw.CatID equals cat_.CatID
                                   where (nw.CatID == CatID || CatID == -1) && (cat_.PortalID == PortalId)
                                   orderby nw.ProductID descending
                                   select new ProductInfo
                    {
                        Content      = nw.Content,
                        CreateDate   = nw.CreatedDate.Value,
                        Id           = nw.ProductID,
                        ImageThumUrl = GetWebImgOf(LocationImage.Product, nw.ImageName),
                        Price        = ConvertPrice(nw.Price),
                        ShortContent = nw.ShortContent,
                        Title        = nw.Title,
                        Url          = WriteUrl(TabId.ToString(), "detailproduct", nw.ProductID.ToString(), nw.Title)
                    };

                    //1 . chuyen truy van thanh list

                    PagedList <ProductInfo> pl = new PagedList <ProductInfo>(products, PageCurr - 1, PageSize);

                    if (pl.Count > 0)
                    {
                        //2 . gan vao repeater

                        rptproducts.DataSource = pl;
                        rptproducts.DataBind();

                        //3 . chuyen thanh thanh phan trang

                        Pager pg = new Pager(PageSize, PageCurr, pl.TotalItemCount, TabId);

                        //4. tao thanh phan trang

                        pnPaging.Text = pg.RenderHtml();
                    }
                    mv.SetActiveView(vList);
                }
                else
                {
                    ProductDetail c = (ProductDetail)Page.LoadControl(ControlPath + "/ProductDetail.ascx");
                    c.ListProduct = this;
                    c.TempService = this.tempService;
                    c.DataBinding();
                    plhDetail.Controls.Add(c);
                    mv.SetActiveView(vDetail);
                }
            }
        }
        } // updatePropLayout()

        public void updatePropLayout(CswEnumNbtLayoutType LayoutType, CswNbtMetaDataNodeTypeProp Prop, CswNbtMetaDataNodeTypeProp InsertAfterProp, bool DoMove)
        {
            bool Added = false;

            if (DoMove)
            {
                removePropFromLayout(LayoutType, Prop, Int32.MinValue);
            }
            if (InsertAfterProp != null)
            {
                Dictionary <Int32, NodeTypeLayout> InsertAfterPropLayouts = getLayout(LayoutType, InsertAfterProp, null);
                if (InsertAfterPropLayouts.Values.Count > 0)
                {
                    foreach (Int32 TabId in InsertAfterPropLayouts.Keys)
                    {
                        NodeTypeLayout InsertAfterPropLayout = InsertAfterPropLayouts[TabId];

                        // Make space for the new prop
                        CswTableUpdate LayoutUpdate = _CswNbtMetaDataResources.CswNbtResources.makeCswTableUpdate("makeSpaceForProp_Update", "nodetype_layout");
                        string         WhereClause  = "where layouttype = '" + LayoutType.ToString() + "' and nodetypeid = " + InsertAfterProp.NodeTypeId.ToString();
                        if (TabId != Int32.MinValue && LayoutType == CswEnumNbtLayoutType.Edit)
                        {
                            WhereClause += " and nodetypetabsetid = " + TabId.ToString();
                        }
                        DataTable LayoutTable = LayoutUpdate.getTable(WhereClause);

                        foreach (DataRow Row in LayoutTable.Rows)
                        {
                            if (CswConvert.ToInt32(Row["display_column"]) == InsertAfterPropLayout.DisplayColumn &&
                                CswConvert.ToInt32(Row["display_row"]) > InsertAfterPropLayout.DisplayRow)
                            {
                                Row["display_row"] = CswConvert.ToDbVal(CswConvert.ToInt32(Row["display_row"]) + 1);
                            }
                        }
                        LayoutUpdate.update(LayoutTable);

                        // Add new prop to the layout
                        updatePropLayout(LayoutType, Prop.NodeTypeId, Prop, false, TabId, InsertAfterPropLayout.DisplayRow + 1, InsertAfterPropLayout.DisplayColumn, InsertAfterPropLayout.TabGroup);
                        Added = true;
                    } // foreach( Int32 TabId in InsertAfterPropLayouts.Keys )
                }     // if( InsertAfterPropLayouts.Values.Count > 0 )
            }         // if( InsertAfterProp != null )

            if (false == Added)
            {
                // Just add it somewhere
                updatePropLayout(LayoutType, Prop.NodeTypeId, Prop, false, Prop.getNodeType().getFirstNodeTypeTab().TabId);
            }

            if (_Cache.ContainsKey(Prop.NodeTypeId))
            {
                _Cache.Remove(Prop.NodeTypeId);
            }
        } // updatePropLayout()
Example #13
0
 private void BindTabControls()
 {
     BindBeforeAfterTabControls();
     divInsertPositionRow.Visible = cboPositionTab.Items.Count > 0;
     cboParentTab.AutoPostBack    = true;
     if (cboPositionTab.FindItemByValue(TabId.ToString(CultureInfo.InvariantCulture)) != null)
     {
         cboPositionTab.ClearSelection();
         cboPositionTab.FindItemByValue(TabId.ToString(CultureInfo.InvariantCulture)).Selected = true;
     }
 }
Example #14
0
        string FormatDoneUrl(string doneUrlTemplate, bool openInPopup, int userId)
        {
            var doneUrl = doneUrlTemplate.Replace("[USERID]", userId.ToString())
                          .Replace("[PORTALID]", PortalId.ToString())
                          .Replace("[TABID]", TabId.ToString());

            if (openInPopup)
            {
                return(UrlUtils.PopUpUrl(doneUrl, PortalSettings, false, false, 550, 950));
            }

            return(doneUrl);
        }
 private void BindTabControls()
 {
     cboParentTab.DataSource = GetTabs(true);
     cboParentTab.DataBind();
     BindBeforeAfterTabControls();
     divInsertPositionRow.Visible = cboPositionTab.Items.Count > 0;
     cboParentTab.AutoPostBack    = true;
     if (cboPositionTab.Items.FindByValue(TabId.ToString()) != null)
     {
         cboPositionTab.ClearSelection();
         cboPositionTab.Items.FindByValue(TabId.ToString()).Selected = true;
     }
 }
Example #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tempService = new TempService(this);
            if (!IsPostBack)
            {
                if (NewsID == -1)
                {
                    var Data = IB.Common.Base.V_Base.Data;

                    var news = from nw in Data.CV_News
                               join cat_ in Data.CV_CatNews on nw.CatNewsID
                               equals cat_.CatID
                               where (nw.CatNewsID == CatID || CatID == -1) && cat_.PortalID == PortalId
                               orderby nw.NewsID descending
                               select
                               new NewsInfo {
                        Content      = nw.Content,
                        CreatedDate  = nw.CreatedDate.Value,
                        ImageName    = nw.ImageName,
                        NewsId       = nw.NewsID,
                        ShortContent = nw.ShortContent,
                        Title        = nw.Title,
                        Url          = WriteUrl(TabId.ToString(), "detailnews", nw.NewsID.ToString(), nw.Title)
                    };

                    //1 . chuyen truy van thanh list
                    IB.Paging.PagedList <NewsInfo> pl = new IB.Paging.PagedList <NewsInfo>(news, PageCurr - 1, PageSize);
                    //2 . gan vao repeater
                    if (pl.Count > 0)
                    {
                        rptnews.DataSource = pl;
                        rptnews.DataBind();
                        //3 . chuyen thanh thanh phan trang
                        IB.Paging.Pager pg = new IB.Paging.Pager(PageSize, PageCurr, pl.TotalItemCount, TabId);
                        //4. tao thanh phan trang
                        pnPaging.Text = pg.RenderHtml();
                    }
                    mv.SetActiveView(vList);
                }
                else
                {
                    NewsDetail c = (NewsDetail)Page.LoadControl(ControlPath + "/NewsDetail.ascx");
                    c.ListNews    = this;
                    c.TempService = this.tempService;
                    c.DataBinding();
                    plhDetail.Controls.Add(c);
                    mv.SetActiveView(vDetail);
                }
            }
        }
        /// <summary>
        /// 设置数据项
        /// </summary>
        private void SetDataItem()
        {
            UpdateModuleSetting(ModuleId, "ClientZone_PortalID", ddlPortals.Items[ddlPortals.SelectedIndex].Value);

            if ((ddlTabModule.Items.Count > 0))
            {
                string[] values = ddlTabModule.SelectedValue.Split(Convert.ToChar("-"));

                if (values.Length == 2)
                {
                    UpdateModuleSetting(ModuleId, "ClientZone_TabID", values[0]);
                    UpdateModuleSetting(ModuleId, "ClientZone_ModuleID", values[1]);
                }
            }

            UpdateModuleSetting(ModuleId, "ClientZone_ModulePageType", ddlModulePageType.Items[ddlModulePageType.SelectedIndex].Value);

            String ModulePageType = ddlModulePageType.Items[ddlModulePageType.SelectedIndex].Value;

            if (ModulePageType == ((Int32)EnumDisplayModuleType.Campaigns).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_Campaigns", TabId.ToString());
            }
            else if (ModulePageType == ((Int32)EnumDisplayModuleType.Downloads).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_Downloads", TabId.ToString());
            }
            else if (ModulePageType == ((Int32)EnumDisplayModuleType.Events).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_Events", TabId.ToString());
            }
            else if (ModulePageType == ((Int32)EnumDisplayModuleType.GameSheets).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_GameSheets", TabId.ToString());
            }
            else if (ModulePageType == ((Int32)EnumDisplayModuleType.Help).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_Help", TabId.ToString());
            }
            else if (ModulePageType == ((Int32)EnumDisplayModuleType.MyAccount).ToString())
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_MyAccount", TabId.ToString());
            }
            else
            {
                UpdateModuleSetting(Settings_ModuleID, "ClientZone_DisplayTab_ProductRoadmap", TabId.ToString());
            }
        }
        /// <summary>
        /// InitializeTab loads the Controls with default Tab Data
        /// </summary>
        /// <history>
        ///     [cnurse]	9/10/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        public void InitializeTab()
        {
            //Load TabControls
            LoadTabControls(null);

            // Populate Tab Names, etc.
            txtTabName.Text     = "";
            txtTitle.Text       = "";
            txtDescription.Text = "";
            txtKeyWords.Text    = "";

            // tab administrators can only create children of the current tab
            if (PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) == false)
            {
                if (cboTab.Items.FindByValue(TabId.ToString()) != null)
                {
                    cboTab.Items.FindByValue(TabId.ToString()).Selected = true;
                }
            }
            else
            {
                // select the <None Specified> option
                cboTab.Items[0].Selected = true;
            }

            // hide the upload new file link until the tab has been saved
            chkHidden.Checked      = false;
            chkDisableLink.Checked = false;

            // page template
            cboTemplate.DataSource = LoadTemplates();
            cboTemplate.DataBind();
            cboTemplate.Items.Insert(0, new ListItem("<" + Localization.GetString("None_Specified") + ">", ""));
            if (cboTemplate.Items.FindByText(Localization.GetString("DefaultTemplate", this.LocalResourceFile)) != null)
            {
                cboTemplate.Items.FindByText(Localization.GetString("DefaultTemplate", this.LocalResourceFile)).Selected = true;
            }
            else
            {
                cboTemplate.SelectedIndex = 0; // none specified
            }

            // copy page options
            cboCopyPage.DataSource = LoadPortalTabs();
            cboCopyPage.DataBind();
            cboCopyPage.Items.Insert(0, new ListItem("<" + Localization.GetString("None_Specified") + ">", "-1"));
            rowModules.Visible = false;
        }
Example #19
0
        public override string ToString()
        {
            var data = new string[]
            {
                "Portal ID: " + PortalId.ToString(),
                "Tab ID: " + TabId.ToString(),
                "Module ID: " + ModuleId.ToString(),
                "Mod. Def.ID: " + ModuleDefId.ToString(),
                "Url: " + Url,
                "Unique Key: " + UniqueKey,
                "Last Modified: " + ModifiedTimeUtc.ToString("o"),
                "Culture: " + CultureCode,
            };

            return(string.Join(", ", data));
        }
Example #20
0
        protected void lstProductGroups_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
        {
            ProductGroupId = (int)lstProductGroups.DataKeys[e.NewSelectedIndex].Value;

            SetFilter(ProductGroupId, IncludeChilds);

            ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId);

            if (pgi != null && pgi.ProductListTabId != -1)
            {
                Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString()));
            }
            else
            {
                int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString());
                Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString()));
            }
        }
Example #21
0
        protected void treeProductGroup_SelectedNodeChanged(object sender, EventArgs e)
        {
            ProductGroupId = Convert.ToInt32(treeProductGroup.SelectedNode.Value.Substring(1));

            SetFilter(ProductGroupId, IncludeChilds);

            ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId);

            if (pgi != null && pgi.ProductListTabId != -1)
            {
                Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString()));
            }
            else
            {
                int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString());
                Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString()));
            }
        }
Example #22
0
        private string ParseControls(string Template)
        {
            string sOutput = Template;

            sOutput = sOutput.Replace("[JUMPTO]", "<asp:placeholder id=\"plhQuickJump\" runat=\"server\" />");
            if (sOutput.Contains("[STATISTICS]"))
            {
                sOutput = sOutput.Replace("[STATISTICS]", "<am:Stats id=\"amStats\" MID=\"" + ModuleId + "\" PID=\"" + PortalId.ToString() + "\" runat=\"server\" />");
            }
            if (sOutput.Contains("[WHOSONLINE]"))
            {
                sOutput = sOutput.Replace("[WHOSONLINE]", MainSettings.UsersOnlineEnabled ? "<asp:placeholder id=\"plhUsersOnline\" runat=\"server\" />" : string.Empty);
            }
            sOutput = sOutput.Replace("[PORTALID]", PortalId.ToString());
            sOutput = sOutput.Replace("[MODULEID]", ModuleId.ToString());
            sOutput = sOutput.Replace("[TABID]", TabId.ToString());
            sOutput = sOutput.Replace("[USERID]", CurrentUserId.ToString());
            return(sOutput);
        }
Example #23
0
        private void CreateThumb(string thumbFile)
        {
            string html = "";

            if (CreateImageCallback != null)
            {
                html = CreateImageCallback(txtTemplate.Text);
            }


            WebClient client = new WebClient();

            string baseUrl = Request.Url.Scheme + "://" + Request.Url.Host;
            string url     = Globals.NavigateURL(TabId);

            if (!url.StartsWith("http"))
            {
                url = baseUrl + url;
            }


            string page = (string)DataCache.GetCache("bbstore_producttemplate_" + TabId.ToString());

            if (page == null)
            {
                page = client.DownloadString(url);
                int bodystart = page.IndexOf("<body");
                if (bodystart > 0)
                {
                    page = page.Substring(0, bodystart) + "<body><div style=\"padding:20px;\">{{PLACEHOLDER}}</div></body></html>";
                }

                DataCache.SetCache("bbstore_producttemplate_" + TabId.ToString(), page);
            }

            if (html != string.Empty)
            {
                html = page.Replace("{{PLACEHOLDER}}", html);
                WebThumb thumbMaker = new WebThumb("DesktopModules\\BBStore", Request.Url.Scheme + "://" + Request.Url.Host);
                thumbMaker.MakeThumb(html, thumbFile);
            }
        }
Example #24
0
        protected override void BeforeUpdateItem(EduProgramInfo item, bool isNew)
        {
            // fill the object
            item.Code       = textCode.Text.Trim();
            item.Title      = textTitle.Text.Trim();
            item.Generation = textGeneration.Text.Trim();
            item.StartDate  = datetimeStartDate.SelectedDate;
            item.EndDate    = datetimeEndDate.SelectedDate;
            item.HomePage   = chkUseCurrentPageAsHomePage.Checked ? TabId.ToString() : urlHomePage.Url;

            // update references
            item.EduLevelID = int.Parse(comboEduLevel.SelectedValue);
            item.EduLevel   = ModelContext.Get <EduLevelInfo, int> (item.EduLevelID);

            if (!isNew)
            {
                item.LastModifiedOnDate   = DateTime.Now;
                item.LastModifiedByUserId = UserInfo.UserID;
            }
        }
Example #25
0
        public MenuNode FindByNameOrId(string tabNameOrId)
        {
            if (tabNameOrId.Equals(Text, StringComparison.InvariantCultureIgnoreCase))
            {
                return(this);
            }
            if (tabNameOrId == TabId.ToString())
            {
                return(this);
            }

            foreach (var child in Children)
            {
                var result = child.FindByNameOrId(tabNameOrId);
                if (result != null)
                {
                    return(result);
                }
            }

            return(null);
        }
Example #26
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteStartElement("Exception");
     writer.WriteElementString("AssemblyVersion", AssemblyVersion);
     writer.WriteElementString("PortalId", PortalId.ToString());
     writer.WriteElementString("UserId", UserId.ToString());
     writer.WriteElementString("TabId", TabId.ToString());
     writer.WriteElementString("RawUrl", RawUrl);
     writer.WriteElementString("Referrer", Referrer);
     writer.WriteElementString("UserAgent", UserAgent);
     writer.WriteElementString("ExceptionHash", ExceptionHash);
     writer.WriteElementString("Message", Message);
     writer.WriteElementString("StackTrace", StackTrace);
     writer.WriteElementString("InnerMessage", InnerMessage);
     writer.WriteElementString("InnerStackTrace", InnerStackTrace);
     writer.WriteElementString("Source", Source);
     writer.WriteElementString("FileName", FileName);
     writer.WriteElementString("FileLineNumber", FileLineNumber.ToString());
     writer.WriteElementString("FileColumnNumber", FileColumnNumber.ToString());
     writer.WriteElementString("Method", Method);
     writer.WriteEndElement();
 }
 protected override void BeforeUpdateItem(DivisionInfo item, bool isNew)
 {
     // fill the object
     item.Title            = txtTitle.Text.Trim();
     item.ShortTitle       = txtShortTitle.Text.Trim();
     item.Email            = txtEmail.Text.Trim().ToLowerInvariant();
     item.SecondaryEmail   = txtSecondaryEmail.Text.Trim().ToLowerInvariant();
     item.Phone            = txtPhone.Text.Trim();
     item.Fax              = txtFax.Text.Trim();
     item.Address          = textAddress.Text.Trim();
     item.Location         = txtLocation.Text.Trim();
     item.WebSite          = txtWebSite.Text.Trim();
     item.WebSiteLabel     = textWebSiteLabel.Text.Trim();
     item.ParentDivisionID = parentDivisionSelector.DivisionId;
     item.HomePage         = chkUseCurrentPageAsHomePage.Checked ? TabId.ToString() : urlHomePage.Url;
     item.DocumentUrl      = urlDocumentUrl.Url;
     item.StartDate        = datetimeStartDate.SelectedDate;
     item.EndDate          = datetimeEndDate.SelectedDate;
     item.IsSingleEntity   = checkIsSingleEntity.Checked;
     item.IsInformal       = checkIsInformal.Checked;
     item.IsGoverning      = checkIsGoverning.Checked;
     item.HeadPositionID   = ParseHelper.ParseToNullable <int> (comboHeadPosition.SelectedValue, true);
 }
Example #28
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            StringBuilder queryString = new StringBuilder(64);

            queryString.Append("pg").Append("/").Append("List");

            if (ddlPropertyType.SelectedValue.ToString().Length > 0)
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Type").Append("/").Append(ddlPropertyType.SelectedValue.ToString());
            }

            if (ddl_Town.SelectedValue.ToString().Length > 0)
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Town").Append("/").Append(ddl_Town.SelectedValue.ToString());
            }



            if (ddl_Village.SelectedValue.ToString().Length > 0)
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Village").Append("/").Append(ddl_Village.SelectedValue.ToString());
            }
            if (ddlBedRooms.SelectedValue.ToString() != "0")
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Beds").Append("/").Append(ddlBedRooms.SelectedValue.ToString());
            }
            if (ddlBathRooms.SelectedValue.ToString() != "0")
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Baths").Append("/").Append(ddlBathRooms.SelectedValue.ToString());
            }
            if (cbxWaterFront.Checked)
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("WaterFront").Append("/").Append("True");
            }
            if (cbxWaterView.Checked)
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("WaterView").Append("/").Append("True");
            }

            if (ddlPriceLow.SelectedValue.ToString() != "0")
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("Low").Append("/").Append(ddlPriceLow.SelectedValue.ToString());
            }

            if (ddlPriceHigh.SelectedValue.ToString() != "0")
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("High").Append("/").Append(ddlPriceHigh.SelectedValue.ToString());
            }

            if (ddlDOM.SelectedValue.ToString() != "0")
            {
                if (queryString.Length > 0)
                {
                    queryString.Append("/");
                }
                queryString.Append("DOM").Append("/").Append(ddlDOM.SelectedValue.ToString());
            }


            string vLink = "";


            //if (_SearchResultPage.ToString().Length > 0)
            //{
            //    vLink = "/TabID/" + _SearchResultPage.ToString() + "/" + queryString.ToString() + "/Default.aspx";
            //}

            //else
            //{
            //    vLink = Globals.NavigateURL(this.TabId, "List", "mid", this.ModuleId.ToString(), queryString.ToString());
            //}

            //Response.Redirect(NavigateURL(TabId, "", CType(objParams.ToArray(GetType(String)), String())), True)

            //     Response.Redirect(NavigateURL(TabId, "", Convert.ToString(objParams.ToArray(typeof(string)))), true);


            vLink = Globals.NavigateURL(TabId, "View", queryString.ToString());
            vLink = vLink.ToString().Replace("ctl/View/", "");

            //// FOR DEBUGGING
            lblFormMessage.Visible = true;
            lblFormMessage.Text    = queryString.ToString() + " <br />" + vLink.ToString() + " <br />tabID=" + TabId.ToString();

            Response.Redirect(vLink.ToString());
        }
Example #29
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            var dr = DataProvider.Instance().GetPosts(PortalId, AuthorizedForums, Settings.TopicsOnly, Settings.RandomOrder, Settings.Rows, Settings.Tags);

            var sb = new StringBuilder(Settings.Header);

            var useFriendly = Utilities.IsRewriteLoaded();
            var sHost       = Utilities.GetHost();

            try
            {
                while (dr.Read())
                {
                    var groupName     = Convert.ToString(dr["GroupName"]);
                    var groupId       = Convert.ToInt32(dr["ForumGroupId"]);
                    var topicTabId    = Convert.ToInt32(dr["TabId"]);
                    var topicModuleId = Convert.ToInt32(dr["ModuleId"]);
                    var forumName     = Convert.ToString(dr["ForumName"]);
                    var forumId       = Convert.ToInt32(dr["ForumId"]);
                    var subject       = Convert.ToString(dr["Subject"]);
                    var userName      = Convert.ToString(dr["AuthorUserName"]);
                    var firstName     = Convert.ToString(dr["AuthorFirstName"]);
                    var lastName      = Convert.ToString(dr["AuthorLastName"]);
                    var authorId      = Convert.ToInt32(dr["AuthorId"]);
                    var displayName   = Convert.ToString(dr["AuthorDisplayName"]);
                    var postDate      = Convert.ToDateTime(dr["DateCreated"]);
                    var body          = Utilities.StripHTMLTag(Convert.ToString(dr["Body"]));
                    var topicId       = Convert.ToInt32(dr["TopicId"]);
                    var replyId       = Convert.ToInt32(dr["ReplyId"]);
                    var bodyHtml      = Convert.ToString(dr["Body"]);
                    var replyCount    = Convert.ToInt32(dr["ReplyCount"]);

                    var sForumUrl       = dr["PrefixURL"].ToString();
                    var sTopicUrl       = dr["TopicURL"].ToString();
                    var sGroupPrefixUrl = dr["GroupPrefixURL"].ToString();

                    var ts         = DataCache.MainSettings(topicModuleId);
                    var timeOffset = (int)UserInfo.Profile.PreferredTimeZone.GetUtcOffset(postDate).TotalMinutes;

                    // Use a stringBuilder for better performance;
                    var sbTemplate = new StringBuilder(Settings.Format ?? string.Empty);

                    sbTemplate = sbTemplate.Replace("[FORUMGROUPNAME]", groupName);
                    sbTemplate = sbTemplate.Replace("[FORUMGROUPID]", groupId.ToString());
                    sbTemplate = sbTemplate.Replace("[TOPICTABID]", topicTabId.ToString());
                    sbTemplate = sbTemplate.Replace("[TOPICMODULEID]", topicModuleId.ToString());
                    sbTemplate = sbTemplate.Replace("[FORUMNAME]", forumName);
                    sbTemplate = sbTemplate.Replace("[FORUMID]", forumId.ToString());
                    sbTemplate = sbTemplate.Replace("[SUBJECT]", subject);
                    sbTemplate = sbTemplate.Replace("[AUTHORUSERNAME]", userName);
                    sbTemplate = sbTemplate.Replace("[AUTHORFIRSTNAME]", firstName);
                    sbTemplate = sbTemplate.Replace("[AUTHORLASTNAME]", lastName);
                    sbTemplate = sbTemplate.Replace("[AUTHORID]", authorId.ToString());
                    sbTemplate = sbTemplate.Replace("[AUTHORDISPLAYNAME]", displayName);
                    sbTemplate = sbTemplate.Replace("[DATE]", Utilities.GetDate(postDate, topicModuleId, timeOffset));
                    sbTemplate = sbTemplate.Replace("[TOPICID]", topicId.ToString());
                    sbTemplate = sbTemplate.Replace("[REPLYID]", replyId.ToString());
                    sbTemplate = sbTemplate.Replace("[REPLYCOUNT]", replyCount.ToString());

                    if (useFriendly && !(string.IsNullOrEmpty(sForumUrl) && string.IsNullOrEmpty(sTopicUrl)))
                    {
                        var ctlUtils = new ControlUtils();

                        sTopicUrl = ctlUtils.BuildUrl(topicTabId, topicModuleId, sGroupPrefixUrl, sForumUrl, groupId, forumId, topicId, sTopicUrl, -1, -1, string.Empty, 1, replyId, -1);
                        sForumUrl = ctlUtils.BuildUrl(topicTabId, topicModuleId, sGroupPrefixUrl, sForumUrl, groupId, forumId, -1, string.Empty, -1, -1, string.Empty, 1, replyId, -1);

                        if (sHost.EndsWith("/") && sForumUrl.StartsWith("/"))
                        {
                            sForumUrl = sForumUrl.Substring(1);
                        }

                        if (!(sForumUrl.StartsWith(sHost)))
                        {
                            sForumUrl = sHost + sForumUrl;
                        }

                        if (sHost.EndsWith("/") && sTopicUrl.StartsWith("/"))
                        {
                            sTopicUrl = sTopicUrl.Substring(1);
                        }

                        if (!(sTopicUrl.StartsWith(sHost)))
                        {
                            sTopicUrl = sHost + sTopicUrl;
                        }

                        if (Convert.ToInt32(replyId) == 0)
                        {
                            sbTemplate = sbTemplate.Replace("[POSTURL]", sTopicUrl);
                            sbTemplate = sbTemplate.Replace("[SUBJECTLINK]", "<a href=\"" + sTopicUrl + "\">" + subject + "</a>");
                        }
                        else
                        {
                            if (!(sTopicUrl.EndsWith("/")) && !(sTopicUrl.EndsWith("aspx")))
                            {
                                sTopicUrl += "/";
                            }
                            sTopicUrl += "?afc=" + replyId;
                            sbTemplate = sbTemplate.Replace("[POSTURL]", sTopicUrl);
                            sbTemplate = sbTemplate.Replace("[SUBJECTLINK]", "<a href=\"" + sTopicUrl + "\">" + subject + "</a>");
                        }

                        sbTemplate = sbTemplate.Replace("[TOPICSURL]", sForumUrl);
                    }
                    else
                    {
                        if (replyId == 0)
                        {
                            sbTemplate = sbTemplate.Replace("[POSTURL]", Common.Globals.NavigateURL(topicTabId, "", new[] { ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.ForumId + "=" + forumId, ParamKeys.TopicId + "=" + topicId }));
                            sbTemplate = sbTemplate.Replace("[SUBJECTLINK]", "<a href=\"" + Common.Globals.NavigateURL(topicTabId, "", new[] { ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.ForumId + "=" + forumId, ParamKeys.TopicId + "=" + topicId }) + "\">" + subject + "</a>");
                        }
                        else
                        {
                            sbTemplate = sbTemplate.Replace("[POSTURL]", Common.Globals.NavigateURL(topicTabId, "", new[] { ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.ForumId + "=" + forumId, ParamKeys.TopicId + "=" + topicId, ParamKeys.ContentJumpId + "=" + replyId }));
                            sbTemplate = sbTemplate.Replace("[SUBJECTLINK]", "<a href=\"" + Common.Globals.NavigateURL(topicTabId, "", new[] { ParamKeys.ViewType + "=" + Views.Topic, ParamKeys.ForumId + "=" + forumId, ParamKeys.TopicId + "=" + topicId, ParamKeys.ContentJumpId + "=" + replyId }) + "\">" + subject + "</a>");
                        }
                        sbTemplate = sbTemplate.Replace("[TOPICSURL]", Common.Globals.NavigateURL(topicTabId, "", new[] { ParamKeys.ViewType + "=" + Views.Topics, ParamKeys.ForumId + "=" + forumId }));
                    }


                    sbTemplate = sbTemplate.Replace("[FORUMURL]", Common.Globals.NavigateURL(topicTabId));

                    // Do the body replacements last as they are the most likely to contain conflicts.

                    sbTemplate = sbTemplate.Replace("[BODY]", body);
                    sbTemplate = sbTemplate.Replace("[BODYHTML]", bodyHtml);
                    sbTemplate = sbTemplate.Replace("[BODYTEXT]", Utilities.StripHTMLTag(bodyHtml));

                    var template = sbTemplate.ToString();

                    // Do this regex replace first before moving on to the simpler ones.
                    template = Regex.Replace(template, @"\[BODY\:\s*(\d+)\s*\]", m => SafeSubstring(body, int.Parse(m.Groups[1].Value)), RegexOptions.IgnoreCase);

                    sb.Append(template);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                if (!dr.IsClosed)
                {
                    dr.Close();
                }
                sb.Append(ex.StackTrace);
            }

            var sRSSImage    = string.Empty;
            var sRSSUrl      = string.Empty;
            var sRSSIconLink = string.Empty;

            if (Settings.RSSEnabled)
            {
                sRSSImage    = "<img src=\"" + Page.ResolveUrl("~/DesktopModules/ActiveForums/images/feedicon.gif") + "\" border=\"0\" />";
                sRSSUrl      = Page.ResolveUrl("~/desktopmodules/activeforumswhatsnew/feeds.aspx") + "?portalId=" + PortalId + "&tabid=" + TabId.ToString() + "&moduleid=" + ModuleId.ToString();
                sRSSIconLink = "<a href=\"" + sRSSUrl + "\">" + sRSSImage + "</a>";
            }

            var footer = Settings.Footer;

            footer = footer.Replace("[RSSICON]", sRSSImage);
            footer = footer.Replace("[RSSURL]", sRSSUrl);
            footer = footer.Replace("[RSSICONLINK]", sRSSIconLink);

            sb.Append(footer);

            Controls.Add(new LiteralControl(sb.ToString()));
        }
        private void RazorDisplayDataEntry(String entryId)
        {
            var productData = new ProductData();

            if (Utils.IsNumeric(entryId))
            {
                productData = ProductUtils.GetProductData(Convert.ToInt32(entryId), Utils.GetCurrentCulture(), true, EntityTypeCode);
            }

            if (productData.Exists && (productData.Info.PortalId == -1 || productData.Info.PortalId == PortalId))
            {
                if (PortalSettings.HomeTabId == TabId)
                {
                    PageIncludes.IncludeCanonicalLink(Page, Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias)); //home page always default of site.
                }
                else
                {
                    PageIncludes.IncludeCanonicalLink(Page, NBrightBuyUtils.GetEntryUrl(PortalId, _eid, "", productData.SEOName, TabId.ToString("")));
                }

                // overwrite SEO data
                if (productData.SEOName != "")
                {
                    BasePage.Title = productData.SEOTitle;
                }
                else
                {
                    BasePage.Title = productData.ProductName;
                }

                if (productData.SEODescription != "")
                {
                    BasePage.Description = productData.SEODescription;
                }

                // if debug , output the xml used.
                if (DebugMode)
                {
                    productData.Info.XMLDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_entry.xml");
                }
                // insert page header text
                NBrightBuyUtils.RazorIncludePageHeader(ModuleId, Page, Path.GetFileNameWithoutExtension(_templD) + "_seohead" + Path.GetExtension(_templD), _controlPath, ModSettings.ThemeFolder, ModSettings.Settings(), productData);

                #region "do razor template"

                var strOut = NBrightBuyUtils.RazorTemplRender(_templD, ModuleId, "productdetailrazor" + ModuleId.ToString() + "*" + entryId, productData, _controlPath, ModSettings.ThemeFolder, Utils.GetCurrentCulture(), ModSettings.Settings());
                var lit    = new Literal();
                lit.Text = strOut;
                phData.Controls.Add(lit);

                #endregion
            }
            else
            {
                _404code = true;

                // insert page header text
                NBrightBuyUtils.RazorIncludePageHeader(ModuleId, Page, "ProductNotFound_head.cshtml", _controlPath, ModSettings.ThemeFolder, ModSettings.Settings(), productData);

                var strOut = NBrightBuyUtils.RazorTemplRender("ProductNotFound.cshtml", ModuleId, "", productData, _controlPath, ModSettings.ThemeFolder, Utils.GetCurrentCulture(), ModSettings.Settings());
                var lit    = new Literal();
                lit.Text = strOut;
                phData.Controls.Add(lit);
            }
        }