private void LoadData(string id)
        {
            NewsGroupController db    = new NewsGroupController();
            NewsGroupInfo       group = db.Load(id);

            txtDescription.Text = group.Description;
            txtGroupCode.Text   = group.NewsGroupCode;
            txtGroupName.Text   = group.NewsGroupName;
            txtOrderNumber.Text = group.OrderNumber.ToString();


            int res    = -1;
            int iIndex = group.NewsGroupID.IndexOf('_');

            if (iIndex >= 0 && int.TryParse(group.NewsGroupID.Substring(0, iIndex), out res) && res == PortalId)
            {
                lblGroupID.Text = group.NewsGroupID.Substring(iIndex + 1);
            }
            else
            {
                lblGroupID.Text = group.NewsGroupID;
            }

            lblGroupID.Visible = true;
            txtGroupID.Visible = false;

            ddlDesktopListID.SelectedValue = group.DesktopListID.ToString();
            ddlDesktopViewID.SelectedValue = group.DesktopViewID.ToString();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //if (!RoleProvider.IsAdminRole(PortalSettings.AdministratorRoleName))
                //{
                //    lblRestricted.Visible = true;
                //    return;
                //}

                if (!Page.IsPostBack)
                {
                    lnkBack.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mid/" + this.ModuleId.ToString());
                    lnkAdd.NavigateUrl  = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "edit_group", "mid/" + this.ModuleId.ToString());
                    NewsGroupController engine = new NewsGroupController();
                    string      editFormatUrl  = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "edit_group", "mid/" + this.ModuleId.ToString(), "id/@@groupid");
                    XmlDocument doc            = engine.LoadTreeXML(editFormatUrl, false, PortalId, 0, "");
                    string      template       = "DesktopModules/MLNews/Xsl/group_admin.xsl";
                    DotNetNuke.NewsProvider.Utils.XMLTransform(xmlTransformer, template, doc);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
        public static System.Collections.Generic.List <MLNewsGroupInfo> GetNewsGroupsAsListe(int PortalId, string Locale, bool FromCache)
        {
            System.Collections.Generic.Dictionary <string, StringInfo> dic = effority.Ealo.Controller.GetStringsByQualifier(GroupQualifier, Locale, FromCache);
            NewsGroupController groupController = new NewsGroupController();

            System.Collections.Generic.Dictionary <string, NewsGroupInfo> groupDic  = groupController.GetNewsGroupsByPortal(PortalId);
            System.Collections.Generic.List <MLNewsGroupInfo>             neueListe = new System.Collections.Generic.List <MLNewsGroupInfo>();

            foreach (NewsGroupInfo info in groupDic.Values)
            {
                StringInfo      localizedGroupName = null;
                MLNewsGroupInfo MLGroupInfo        = new MLNewsGroupInfo(info);
                if (dic.TryGetValue(info.NewsGroupID, out localizedGroupName))
                {
                    if (!string.IsNullOrEmpty(localizedGroupName.StringText))
                    {
                        localizedGroupName.FallBack       = MLGroupInfo.NewsGroupName;
                        localizedGroupName.FallbackIsNull = false;
                        MLGroupInfo.MLGroupName           = localizedGroupName;
                    }
                }
                neueListe.Add(MLGroupInfo);
            }
            return(neueListe);
        }
Exemple #4
0
        private void BindControls()
        {
            CategoryController catdb = new CategoryController();
            DataTable          dt;

            //if (DotNetNuke.Security.PortalSecurity.IsInRole("Administrators"))
            //{
            dt = catdb.LoadTree(false, PortalId, "");
            //}
            //else
            //{
            //    dt = catdb.LoadTree(false, UserId, PortalId, "");
            //}

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

            NewsGroupController newsGroupCont = new NewsGroupController();
            DataTable           dt1           = newsGroupCont.LoadTree(false, PortalId);
            DataRow             r             = dt1.NewRow();

            r["NewsGroupName"] = Localization.GetString("lblShareGroup", Localization.GetResourceFile(this, "news_edit.ascx"));
            r["NewsGroupID"]   = "__Shared__";
            dt1.Rows.Add(r);
            lstChkNewsGroup.DataSource     = dt1;
            lstChkNewsGroup.DataTextField  = "NewsGroupName";
            lstChkNewsGroup.DataValueField = "NewsGroupID";
            lstChkNewsGroup.DataBind();
        }
Exemple #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             NewsGroupController engine = new NewsGroupController();
             menu.MenuName = "BCM_" + ModuleId.ToString();
             int menuwidth = Convert.ToInt32(Settings["menuwidth"]);
             if (menuwidth > 0)
             {
                 menu.MenuWidth = Convert.ToInt32(Settings["menuwidth"]);
             }
             bool ExpandAll = false;
             if (Settings["ExpandAll"] != null)
             {
                 ExpandAll = Convert.ToBoolean(Settings["ExpandAll"]);
             }
             string CSSPrefix = "";
             if (Settings["CSSPrefix"] != null)
             {
                 CSSPrefix = Settings["CSSPrefix"].ToString();
             }
             menu.ExpandAll  = ExpandAll;
             menu.CSSPrefix  = CSSPrefix;
             menu.DataSource = engine.LoadTreeForMenu(PortalId, Convert.ToInt32(Settings["source"]), Convert.ToString(Settings["code"]), System.Threading.Thread.CurrentThread.CurrentCulture.ToString());
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                NewsGroupController db = new NewsGroupController();
                db.Delete(Request.QueryString["id"]);

                string url = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "admin_group", "mid/" + this.ModuleId.ToString());
                Response.Redirect(url);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
        private void LoadDropdown()
        {
            CategoryController catdb = new CategoryController();
            DataTable          dt    = catdb.LoadTree(false, PortalId, "");

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

            NewsGroupController groupCont = new NewsGroupController();
            DataTable           dt1       = groupCont.LoadTree(false, PortalId);

            ddlNewsGroup.DataSource     = dt1;
            ddlNewsGroup.DataTextField  = "NewsGroupName";
            ddlNewsGroup.DataValueField = "NewsGroupID";
            ddlNewsGroup.DataBind();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                NewsGroupInfo group = new NewsGroupInfo();
                if (Request.QueryString["id"] != null)
                {
                    group.NewsGroupID = Request.QueryString["id"];
                }
                else
                {
                    group.NewsGroupID = PortalId.ToString() + "_" + txtGroupID.Text;
                }
                group.Description   = txtDescription.Text.Trim();
                group.NewsGroupCode = txtGroupCode.Text.Trim();
                group.NewsGroupName = txtGroupName.Text;
                group.OrderNumber   = Convert.ToInt32(txtOrderNumber.Text);
                group.PortalID      = PortalId;
                group.DesktopListID = Convert.ToInt32(ddlDesktopListID.SelectedValue);
                group.DesktopViewID = Convert.ToInt32(ddlDesktopViewID.SelectedValue);
                if (group.NewsGroupID == "")
                {
                    group.NewsGroupID = PortalId.ToString() + "_" + lblGroupID.Text;
                }
                NewsGroupController db = new NewsGroupController();
                if (Request.QueryString["id"] != null)
                {
                    db.Update(group);
                }
                else
                {
                    db.Insert(group);
                }

                string url = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "admin_group", "mid/" + this.ModuleId.ToString());
                Response.Redirect(url);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
        public static MLNewsGroupInfo GetNewsGroup(string groupID, string Locale, bool FromCache)
        {
            StringInfo          GroupName    = effority.Ealo.Controller.GetStringByQualifierAndStringName(GroupQualifier, groupID, Locale, FromCache);
            MLNewsGroupInfo     fMLGroupInfo = null;
            NewsGroupController groupCont    = new NewsGroupController();
            NewsGroupInfo       groupInfo    = groupCont.Load(groupID);

            fMLGroupInfo = new MLNewsGroupInfo(groupInfo);
            if (GroupName != null)
            {
                if (!String.IsNullOrEmpty(GroupName.StringText))
                {
                    fMLGroupInfo.MLGroupName = GroupName;
                }
            }
            //if (GroupName != null && String.IsNullOrEmpty(GroupName.StringText))
            //{
            //    GroupName.StringText = groupInfo.NewsGroupName;
            //}
            //fMLGroupInfo.MLGroupName = GroupName;
            return(fMLGroupInfo);
        }