Example #1
0
        private void Edit_Privacy(string PageIndexID)
        {
            Security.Pages.PrivacyMgr myPrivacyMgr = new Security.Pages.PrivacyMgr();

            // Page Index
            e2Data[] UpdateData_PrivacyURL =
            {
                new e2Data("PageIndexID", PageIndexID),
                new e2Data("ReturnURL",   tbx_ReturnURL.Text)
            };

            if (myPrivacyMgr.Chk_Page_PrivacyURL(PageIndexID))
            {
                myPrivacyMgr.Edit_Page_PrivacyURL(UpdateData_PrivacyURL);
            }
            else
            {
                myPrivacyMgr.Add_Page_PrivacyURL(UpdateData_PrivacyURL);

                // Add Administrator and Guest Role to Privacy
                // Administrator
                e2Data[] UpdateData_Admin =
                {
                    new e2Data("PageIndexID",             PageIndexID),
                    new e2Data("UserGroupID",             StringEnum.GetStringValue(Security.Users.UserGroup.Administrator)),
                    new e2Data("Allow_View",              "1"),
                    new e2Data("Allow_Create",            "1"),
                    new e2Data("Allow_Modify",            "1"),
                    new e2Data("Allow_Delete",            "1"),
                    new e2Data("Allow_Rollback",          "1"),
                    new e2Data("Allow_ChangePermissions", "1"),
                    new e2Data("Allow_Approve",           "1"),
                    new e2Data("Allow_Publish",           "1"),
                    new e2Data("Allow_DesignMode",        "1")
                };

                myPrivacyMgr.Add_Page_Privacy(UpdateData_Admin);

                // Guest
                e2Data[] UpdateData =
                {
                    new e2Data("PageIndexID",             _pageindexid),
                    new e2Data("UserGroupID",             StringEnum.GetStringValue(Security.Users.UserGroup.Guest)),
                    new e2Data("Allow_View",              "1"),
                    new e2Data("Allow_Create",            "0"),
                    new e2Data("Allow_Modify",            "0"),
                    new e2Data("Allow_Delete",            "0"),
                    new e2Data("Allow_Rollback",          "0"),
                    new e2Data("Allow_ChangePermissions", "0"),
                    new e2Data("Allow_Approve",           "0"),
                    new e2Data("Allow_Publish",           "0"),
                    new e2Data("Allow_DesignMode",        "0")
                };

                myPrivacyMgr.Add_Page_Privacy(UpdateData);
            }
        }
Example #2
0
        protected void btn_UpdatePage_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Page_PropertyMgr myPropertyMgr = new Page_PropertyMgr();

                // Page Attribute
                e2Data[] UpdateData_Attribute =
                {
                    new e2Data("PageIndexID",      _pageindexid),
                    new e2Data("Page_Title",       tbx_Page_Title.Text),
                    new e2Data("Page_Keyword",     tbx_Page_Keyword.Text),
                    new e2Data("Page_Description", tbx_Page_Description.Text)
                };

                myPropertyMgr.Edit_Page_Attribute(UpdateData_Attribute);

                Thread.Sleep(100);

                // Page Template
                e2Data[] UpdateData_Template =
                {
                    new e2Data("PageIndexID",       _pageindexid),
                    new e2Data("MasterPageIndexID", droplist_Template.SelectedValue)                                // Get from Select Template list
                };

                myPropertyMgr.Edit_Page_Template(UpdateData_Template);

                Thread.Sleep(100);

                // Page Properties
                e2Data[] UpdateData_Property =
                {
                    new e2Data("PageIndexID", _pageindexid),
                    new e2Data("IsSSL",       rbtn_IsSSL.SelectedValue)
                };

                myPropertyMgr.Edit_Page_Property(UpdateData_Property);

                Thread.Sleep(100);

                // Page Privacy
                Security.Pages.PrivacyMgr myPrivacyMgr = new Security.Pages.PrivacyMgr();

                e2Data[] UpdateData_PrivacyURL =
                {
                    new e2Data("PageIndexID", _pageindexid),
                    new e2Data("ReturnURL",   tbx_ReturnURL.Text)
                };

                myPrivacyMgr.Edit_Page_PrivacyURL(UpdateData_PrivacyURL);

                Panel_Updated.Visible = true;
            }
        }