private void BindGroups()
        {
            List <MLNewsGroupInfo> liste = MLNewsGroupController.GetNewsGroupsAsListe(PortalId, ddlLocale.SelectedValue, false);

            repGroups.DataSource = liste;
            repGroups.DataBind();
        }
        public XmlDocument MLLoadTreeXML(string editFormatUrl, bool ismenu, int PortalID, int source, string codes, string Locale)
        {
            DataTable dt = null;

            if (source == 0)
            {
                dt = LoadTree(ismenu, PortalID);
            }
            else if (source == 1)
            {
                dt = LoadTreeByCode(ismenu, PortalID, codes);
            }

            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<newsgroups></newsgroups>");
            XmlElement root = doc.DocumentElement;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                XmlElement NewsGroup = doc.CreateElement("newsgroup");
                int        tabid     = Convert.ToInt32(dt.Rows[i]["DesktopListID"]);
                string     link      = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "newsgroupid/" + dt.Rows[i]["NewsGroupID"].ToString());
                string     url_edit  = editFormatUrl.Replace("@@groupid", dt.Rows[i]["NewsGroupID"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "Img", DotNetNuke.Common.Globals.ApplicationPath + "/images/action_right.gif");
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "ImgLevel2", DotNetNuke.Common.Globals.ApplicationPath + "/images/edit.gif");
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "OrderNumber", dt.Rows[i]["OrderNumber"].ToString());

                MLNewsGroupInfo fMLGroup = MLNewsGroupController.GetNewsGroup(dt.Rows[i]["NewsGroupID"].ToString(), Locale, false);
                if (fMLGroup != null)
                {
                    if (fMLGroup.MLGroupName != null)
                    {
                        DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", fMLGroup.MLGroupName.StringTextOrFallBack);
                    }
                    else
                    {
                        DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", fMLGroup.NewsGroupName);
                    }
                }
                else
                {
                    DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", dt.Rows[i]["NewsGroupName"].ToString());
                }
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupCode", dt.Rows[i]["NewsGroupCode"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "PortalID", dt.Rows[i]["PortalID"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "link", link);
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "url_edit", url_edit);
                if (i % 2 == 1)
                {
                    DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "odd", "true");
                }
                root.AppendChild(NewsGroup);
            }
            return(doc);
        }
        public DataTable LoadTreeForMenu(int PortalID, int source, string codes, string Locale)
        {
            DataTable dt = null;

            if (source == 0)
            {
                dt = LoadTree(true, PortalID);
            }
            else if (source == 1)
            {
                dt = LoadTreeByCode(true, PortalID, codes);
            }
            dt.Columns.Add(new DataColumn("Name", typeof(string)));
            dt.Columns.Add(new DataColumn("Link", typeof(string)));
            dt.Columns.Add(new DataColumn("Level", typeof(int)));
            dt.Columns.Add(new DataColumn("Target", typeof(string)));
            dt.Columns.Add(new DataColumn("Image", typeof(string)));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Target"] = "_self";
                dt.Rows[i]["Image"]  = "";
                dt.Rows[i]["Level"]  = 1;
                int tabid = Convert.ToInt32(dt.Rows[i]["DesktopListID"]);
                dt.Rows[i]["Link"] = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "newsgroupid/" + dt.Rows[i]["NewsGroupID"].ToString());
                MLNewsGroupInfo fMLNewsGroup = MLNewsGroupController.GetNewsGroup(dt.Rows[i]["NewsGroupID"].ToString(), Locale, false);
                if (fMLNewsGroup != null)
                {
                    if (fMLNewsGroup.MLGroupName != null)
                    {
                        dt.Rows[i]["Name"] = fMLNewsGroup.MLGroupName.StringText;
                    }
                    else
                    {
                        dt.Rows[i]["Name"] = fMLNewsGroup.NewsGroupName;
                    }
                }
                else
                {
                    dt.Rows[i]["Name"] = dt.Rows[i]["NewsGroupName"].ToString();
                }
            }
            return(dt);
        }
        private void Save()
        {
            string lastLocale = (string)(ViewState["ViewStateLastLanguageCode"]);

            if (!string.IsNullOrEmpty(lastLocale))
            {
                foreach (RepeaterItem item in repGroups.Items)
                {
                    TextBox     txtGroupName = (TextBox)item.FindControl("txtGroupName");
                    HiddenField GroupId      = (HiddenField)item.FindControl("GroupId");
                    string      groupName    = "";
                    string      groupID      = "";
                    if (txtGroupName != null)
                    {
                        groupName = txtGroupName.Text;
                    }
                    if (GroupId != null)
                    {
                        groupID = GroupId.Value;
                    }
                    MLNewsGroupController.UpdateGroup(groupID, groupName, lastLocale);
                }
            }
        }