Ejemplo n.º 1
0
        public static System.Collections.Generic.List <MLNewsInfo> GetNewsAsListeByCat(string CatId, string Locale, bool FromCache)
        {
            System.Collections.Generic.Dictionary <string, StringInfo> dicHeadline    = effority.Ealo.Controller.GetStringsByQualifier(NewsHeadlineQualifier, Locale, FromCache);
            System.Collections.Generic.Dictionary <string, StringInfo> dicDescription = effority.Ealo.Controller.GetStringsByQualifier(NewsDescriptionQualifier, Locale, FromCache);
            System.Collections.Generic.Dictionary <string, StringInfo> dicContent     = effority.Ealo.Controller.GetStringsByQualifier(NewsContentQualifier, Locale, FromCache);

            NewsController newsController = new NewsController();

            System.Collections.Generic.Dictionary <int, NewsInfo> newsDic   = newsController.GetNewsByCat(CatId);
            System.Collections.Generic.List <MLNewsInfo>          neueListe = new System.Collections.Generic.List <MLNewsInfo>();

            foreach (NewsInfo info in newsDic.Values)
            {
                StringInfo localizedHeadline    = null;
                StringInfo localizedDescription = null;
                StringInfo localizedContent     = null;

                MLNewsInfo MLNewsInfo = new MLNewsInfo(info);

                if (dicHeadline.TryGetValue(info.ID.ToString(), out localizedHeadline))
                {
                    if (!string.IsNullOrEmpty(localizedHeadline.StringText))
                    {
                        localizedHeadline.FallBack       = MLNewsInfo.Headline;
                        localizedHeadline.FallbackIsNull = false;
                        MLNewsInfo.MLHeadline            = localizedHeadline;
                    }
                }

                if (dicDescription.TryGetValue(info.ID.ToString(), out localizedDescription))
                {
                    if (!string.IsNullOrEmpty(localizedDescription.StringText))
                    {
                        localizedDescription.FallBack       = MLNewsInfo.Description;
                        localizedDescription.FallbackIsNull = false;
                        MLNewsInfo.MLDescription            = localizedDescription;
                    }
                }

                if (dicContent.TryGetValue(info.ID.ToString(), out localizedContent))
                {
                    if (!string.IsNullOrEmpty(localizedContent.StringText))
                    {
                        localizedContent.FallBack       = MLNewsInfo.Content;
                        localizedContent.FallbackIsNull = false;
                        MLNewsInfo.MLContent            = localizedContent;
                    }
                }
                neueListe.Add(MLNewsInfo);
            }
            return(neueListe);
        }
Ejemplo n.º 2
0
        private void BindNewsDDL()
        {
            NewsController             newsCont = new NewsController();
            Dictionary <int, NewsInfo> dicNews  = newsCont.GetNewsByCat(ddlCat.SelectedValue);
            ArrayList fLstNews = new ArrayList();

            foreach (NewsInfo fNewsInfo in dicNews.Values)
            {
                fLstNews.Add(fNewsInfo);
            }
            ddlNews.DataSource     = fLstNews;
            ddlNews.DataTextField  = "Headline";
            ddlNews.DataValueField = "ID";
            ddlNews.DataBind();
        }
Ejemplo n.º 3
0
        private void BindControls()
        {
            ArrayList tabs = DotNetNuke.Common.Globals.GetPortalTabs(PortalSettings.DesktopTabs, false, true, false, true);

            for (int i = 0; i < tabs.Count; i++)
            {
                DotNetNuke.Entities.Tabs.TabInfo tab = (DotNetNuke.Entities.Tabs.TabInfo)tabs[i];
                ddlDesktopListID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString()));
                ddlDesktopViewID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString()));
                ddlBookingPageID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString()));
            }
            ddlBookingPageID.Items.Insert(0, new ListItem("", "-1"));
            CategoryController catdb  = new CategoryController();
            string             sCatID = (Request.QueryString["id"] == null)?"":Request.QueryString["id"];
            DataTable          dt     = catdb.LoadTree(false, PortalId, sCatID);
            DataRow            row    = dt.NewRow();

            row["CatName"] = "";
            row["CatID"]   = 0;
            dt.Rows.InsertAt(row, 0);

            ddlParentID.DataSource     = dt;
            ddlParentID.DataTextField  = "CatName";
            ddlParentID.DataValueField = "CatID";
            ddlParentID.DataBind();

            if (Request.QueryString["id"] != null)
            {
                NewsController             newsCont = new NewsController();
                Dictionary <int, NewsInfo> dicNews  = newsCont.GetNewsByCat(Request.QueryString["id"]);
                ArrayList fLstNews = new ArrayList();
                NewsInfo  info     = new NewsInfo();
                info.ID       = 0;
                info.Headline = "";
                fLstNews.Add(info);
                foreach (NewsInfo fNewsInfo in dicNews.Values)
                {
                    fLstNews.Add(fNewsInfo);
                }
                ddlNews.DataSource     = fLstNews;
                ddlNews.DataTextField  = "Headline";
                ddlNews.DataValueField = "ID";
                ddlNews.DataBind();
            }
        }