/// <inheritdoc />
 public object Get(Type featureType)
 {
     if (featureType == typeof(IAspNetCoreFeature))
     {
         if (feature == null)
         {
             feature = AspNetCoreFeature.FromHttpContext(Context);
         }
         return(feature);
     }
     return(BaseCollection?.Get(featureType));
 }
Example #2
0
        public static void Set(BaseDomainPublishableObject baseObj, string Type, ChangeStatusEnum ChangeStatus, bool alsoUpdateObject)
        {
            //even uitgezet
            return;

            if (!(Type == "Folder" || Type == "Page" || Type == "Module" || Type == "Template" || Type == "Script" || Type == "DataCollection" || Type == "DataGroup" || Type == "DataItem"))
            {
                throw new Exception("Geen geldige type voor UnpublishedItem");
            }


            UnpublishedItem item = new UnpublishedItem();

            //try to find
            string where = String.Format("FK_Object = '{0}'", baseObj.ID);
            BaseCollection <UnpublishedItem> items = BaseCollection <UnpublishedItem> .Get(where);

            if (items.Count > 0)
            {
                item = items[0];
            }
            else
            {
                //nieuwe
            }
            if (baseObj.LastPublishedDate == null && ChangeStatus == ChangeStatusEnum.Deleted)
            {
                item.Delete();
            }
            else
            {
                item.LastPublishedDate = baseObj.LastPublishedDate;
                item.ChangeStatus      = ChangeStatus;
                item.Site         = baseObj.Site;
                item.Name         = baseObj.Name;
                item.FK_Object    = baseObj.ID;
                item.Type         = Type;
                item.ModifiedDate = DateTime.Now;
                if (Utils.WebSessionHelper.CurrentBitplateUser != null)
                {
                    item.UserName = Utils.WebSessionHelper.CurrentBitplateUser.Email;
                    item.FK_User  = Utils.WebSessionHelper.CurrentBitplateUser.ID;
                }
                if (ChangeStatus == ChangeStatusEnum.Deleted)
                {
                    item.Actions += String.Format("Verwijderd door {0} op {1:dd-MM-yyyy HH:mm}; ", item.UserName, DateTime.Now);
                }
                else
                {
                    item.Actions += String.Format("Bewaard door {0} op {1:dd-MM-yyyy HH:mm}; ", item.UserName, DateTime.Now);
                }
                item.Save();
            }
            if (alsoUpdateObject && ChangeStatus == ChangeStatusEnum.Modified)
            {
                //in de objecten wordt change-status ook bewaard (redundant (omwilen van minder db-calls)
                //hier wordt die gezet
                //dit wordt aangeroepen bij wijziging van een module op een pagina.
                string sql = String.Format("UPDATE {0} SET ChangeStatus={1}, ModifiedDate=NOW() WHERE ID='{2}'", Type, (int)ChangeStatusEnum.Modified, baseObj.ID);
                DataBase.Get().Execute(sql);
            }
        }
Example #3
0
        private string importSubscriber(string[] data, int[] importProgress)//BaseCollection<NewsletterGroup> newsGroups
        {
            string[] log = new string[6];
            try
            {
                BaseCollection <NewsletterSubscriber> subscribers = BaseCollection <NewsletterSubscriber> .Get("FK_Site = '" + WebSessionHelper.CurrentSite.ID.ToString() + "' AND Email = '" + data[this.EmailColumnNo].Trim() + "'");

                NewsletterSubscriber subscriber;

                var existingSubscriber = subscribers.Where(b => b.Email == data[this.EmailColumnNo]).FirstOrDefault();//Where(b => b.Name == data[this.NameColumnNo]).FirstOrDefault();

                if (existingSubscriber == null)
                {
                    if (EmailManager.isValidEmailAddress(data[this.EmailColumnNo].Trim()))
                    {
                        if (isValidDataLength(data) == true)
                        {
                            subscriber = new NewsletterSubscriber();
                            subscriber.RegistrationType = RegistrationTypeEnum.Import;
                            subscriber.Site             = WebSessionHelper.CurrentSite;
                            subscriber.Email            = data[this.EmailColumnNo].Trim();
                            subscriber.Confirmed        = (this.AutoConfirm);
                            if (this.ForeNameColumn != "" && this.ForeNameColumnNo != 9999)
                            {
                                subscriber.ForeName = data[this.ForeNameColumnNo];
                            }
                            if (this.NameColumn != "" && this.NameColumnNo != 9999)
                            {
                                subscriber.Name = data[this.NameColumnNo];
                            }
                            if (this.NamePrefixColumn != "" && this.NamePrefixColumnNo != 9999)
                            {
                                subscriber.NamePrefix = data[this.NamePrefixColumnNo];
                            }
                            //subscriber.Gender = data[this.GenderCoumnNo] // ERROR: cannot convert string/int > sexeEnum
                            subscriber.SubscribedGroups.AddRange(this.Groups);
                            subscriber.Save();

                            log[0] = importProgress[0].ToString();

                            if (this.NameColumnNo != 9999)
                            {
                                log[1] = data[this.NameColumnNo];
                            }
                            log[2] = data[this.EmailColumnNo];
                            log[3] = "Geimporteerd";
                            log[4] = importProgress[1].ToString();
                            log[5] = true.ToString();
                        }
                        else
                        {
                            string tooLong = "Het ";

                            if (this.EmailColumnNo != 9999)
                            {
                                if (data[this.EmailColumnNo].ToString().Length > 50)
                                {
                                    tooLong += "email adres, ";
                                }
                            }
                            if (this.NameColumnNo != 9999)
                            {
                                if (data[this.NameColumnNo].ToString().Length > 150)
                                {
                                    tooLong += "achternaam, ";
                                }
                            }
                            if (this.ForeNameColumnNo != 9999)
                            {
                                if (data[this.ForeNameColumnNo].ToString().Length > 250)
                                {
                                    tooLong += "voornaam, ";
                                }
                            }
                            if (this.NamePrefixColumnNo != 9999)
                            {
                                if (data[this.NamePrefixColumnNo].ToString().Length > 25)
                                {
                                    tooLong += "tussenvoegsel, ";
                                }
                            }
                            log[0] = importProgress[0].ToString();
                            if (this.NameColumnNo != 9999)
                            {
                                log[1] = data[this.NameColumnNo];
                            }
                            log[2] = data[this.EmailColumnNo];
                            log[3] = tooLong += "is te lang";
                            log[4] = importProgress[1].ToString();
                            log[5] = false.ToString();
                        }
                    }
                    else
                    {
                        log[0] = importProgress[0].ToString();
                        if (this.NameColumnNo != 9999)
                        {
                            log[1] = data[this.NameColumnNo];
                        }
                        log[2] = data[this.EmailColumnNo];
                        log[3] = "Geen geldig email adres";
                        log[4] = importProgress[1].ToString();
                        log[5] = false.ToString();
                    }
                }
                else if (existingSubscriber != null && this.SkipDoubleRecords == false)
                {
                    if (EmailManager.isValidEmailAddress(data[this.EmailColumnNo].Trim()) && isValidDataLength(data) == true)
                    {
                        if (this.AppendGroups == true)
                        {
                            for (int i = 0; i < existingSubscriber.SubscribedGroups.Count(); i++)
                            {
                                for (int j = 0; j < this.Groups.Count(); j++)
                                {
                                    if (this.Groups[j].ID == existingSubscriber.SubscribedGroups[i].ID)
                                    {
                                        this.Groups.RemoveAt(j);
                                        break;
                                    }
                                }
                            }
                        }

                        /* subscriber = new NewsletterSubscriber();
                         * subscriber.Site = SessionObject.CurrentSite;
                         * subscriber.Email = data[this.EmailColumnNo].Trim();
                         * subscriber.Confirmed = (this.AutoConfirm);
                         * subscriber.ForeName = data[this.ForeNameColumnNo];
                         * subscriber.Name = data[this.NameColumnNo];
                         * subscriber.NamePrefix = data[this.NamePrefixColumnNo];
                         * //subscriber.Gender = data[this.GenderColumnNo]; // ERROR: cannot convert string/int > sexeEnum
                         * subscriber.SubscribedGroups.AddRange(this.Groups);
                         * subscriber.Save();*/

                        existingSubscriber.Site      = WebSessionHelper.CurrentSite;
                        existingSubscriber.Confirmed = (this.AutoConfirm);

                        if (this.ForeNameColumn != "" && this.ForeNameColumnNo != 9999)
                        {
                            existingSubscriber.ForeName = data[this.ForeNameColumnNo];
                        }
                        else
                        {
                            existingSubscriber.ForeName = "";
                        }

                        if (this.NameColumn != "" && this.NameColumnNo != 9999)
                        {
                            existingSubscriber.Name = data[this.NameColumnNo];
                        }
                        else
                        {
                            existingSubscriber.Name = "";
                        }

                        if (this.NamePrefixColumn != "" && this.NamePrefixColumnNo != 9999)
                        {
                            existingSubscriber.NamePrefix = data[this.NamePrefixColumnNo];
                        }
                        else
                        {
                            existingSubscriber.NamePrefix = "";
                        }

                        if (this.AppendGroups == false)
                        {
                            existingSubscriber.SubscribedGroups.Clear();
                        }

                        if (existingSubscriber.SubscribedGroups != this.Groups)
                        {
                            existingSubscriber.SubscribedGroups.AddRange(this.Groups);
                        }

                        existingSubscriber.Save();

                        log[0] = importProgress[0].ToString();
                        if (this.NameColumnNo != 9999)
                        {
                            log[1] = data[this.NameColumnNo];
                        }
                        log[2] = data[this.EmailColumnNo];
                        log[3] = "Abonnee bestaat al. overschreven";
                        log[4] = importProgress[1].ToString();
                        log[5] = true.ToString();
                    }
                    else if (isValidDataLength(data) == false)
                    {
                        string tooLong = "Het ";

                        if (this.EmailColumnNo != 9999)
                        {
                            if (data[this.EmailColumnNo].ToString().Length > 50)
                            {
                                tooLong += "email adres, ";
                            }
                        }
                        if (this.NameColumnNo != 9999)
                        {
                            if (data[this.NameColumnNo].ToString().Length > 150)
                            {
                                tooLong += "achternaam, ";
                            }
                        }
                        if (this.ForeNameColumnNo != 9999)
                        {
                            if (data[this.ForeNameColumnNo].ToString().Length > 250)
                            {
                                tooLong += "voornaam, ";
                            }
                        }
                        if (this.NamePrefixColumnNo != 9999)
                        {
                            if (data[this.NamePrefixColumnNo].ToString().Length > 25)
                            {
                                tooLong += "tussenvoegsel, ";
                            }
                        }
                        log[0] = importProgress[0].ToString();
                        if (this.NameColumnNo != 9999)
                        {
                            log[1] = data[this.NameColumnNo];
                        }
                        log[2] = data[this.EmailColumnNo];
                        log[3] = tooLong += "is te lang";
                        log[4] = importProgress[1].ToString();
                        log[5] = false.ToString();
                    }
                    else
                    {
                        log[0] = importProgress[0].ToString();
                        if (this.NameColumnNo != 9999)
                        {
                            log[1] = data[this.NameColumnNo];
                        }
                        log[2] = data[this.EmailColumnNo];
                        log[3] = "Geen geldig email adres";
                        log[4] = importProgress[1].ToString();
                        log[5] = false.ToString();
                    }
                }
                else
                {
                    log[0] = importProgress[0].ToString();
                    if (this.NameColumnNo != 9999)
                    {
                        log[1] = data[this.NameColumnNo];
                    }
                    log[2] = data[this.EmailColumnNo];
                    log[3] = "Dubbele abonnee is overgeslagen";
                    log[4] = importProgress[1].ToString();
                    log[5] = true.ToString();
                }
            }
            catch (Exception ex)
            {
                log[0] = importProgress[0].ToString();
                log[2] = "";
                log[3] = "SYSTEEM FOUT: " + ex.Message;
                log[4] = importProgress[1].ToString();
                log[5] = false.ToString();
            }
            if (log[5] == false.ToString())
            {
                return("FOUT in regel " + log[0] + "/" + log[4] + " : " + log[2] + " = " + log[3] + ".");
            }
            else
            {
                return("GESLAAGD regel " + log[0] + "/" + log[4] + " : " + log[2] + " = " + log[3] + ".");
            }
        }
        public static object[] AddNewModule(string type, string pageid, string containername, int sortorder)
        {
            string Url = HttpContext.Current.Request.UrlReferrer.ToString();

            BaseService.CheckLoginAndLicense();
            //volgende waardes terug geven:
            //1. De inhoud gewrapt met module toolbar,
            //2: de specifieke javascripts
            //3: de moduleID
            object[]   returnValue = new object[3];
            BaseModule module      = null;

            type          = type.Replace("bitModule", "");
            containername = containername.Replace("bitContainer", "");

            module = ModuleLoader.Load(type);
            if (module != null)
            {
                module.Name = type;
                module.Site = SessionObject.CurrentSite;
                //module.Page = new CmsPage();
                //module.Page.ID = new Guid(pageid);
                if (Url.ToLower().Contains("/newsletters"))
                {
                    module.Newsletter    = new Newsletter();
                    module.Newsletter.ID = new Guid(pageid);
                }
                else
                {
                    module.Page    = new CmsPage();
                    module.Page.ID = new Guid(pageid);
                }
                module.ContainerName  = containername;
                module.OrderingNumber = sortorder;
                module.Content        = module.FirstContentSample;
                module.Settings.Add("UseCkeditor", true);
                //WORK ARROUND SETTINGS WILLEN NIET OPSLAAN.
                module.SettingsJsonString = module.Settings.ToJsonString();
                module.Save();


                //SetUnpublishedItem(module);

                returnValue[1] = module.IncludeScripts;
                returnValue[2] = module.ID.ToString();
                //moet naar container
                //updateOrderingNumber
                //alleen degene ophalen met een groter nummer dan sortorder
                string where = String.Format("FK_PAGE = '{0}' And ContainerName='{1}' AND OrderingNumber > {2}", pageid, containername, sortorder);
                BaseCollection <BaseModule> modules = BaseCollection <BaseModule> .Get(where);

                foreach (BaseModule mod in modules)
                {
                    mod.OrderingNumber++;
                    mod.Save();
                }
            }
            module.ForceReloadTags(); //De tags zijn al gegenereerd, maar dit is gebeurd voor het opslaan van de module. Hierdoor hebben de tags geen geldig control ID. Forceer hergeneratie van de tags. Dit is alleen bij nieuwe modules nodig.
            PublishModule(module);
            //Na toevoegen nieuwe ook pagina updaten
            PublishDependentPages(module);

            returnValue[0] = new ModuleService().GetUserControlContent(module);

            return(returnValue);
        }
Example #5
0
        /// <summary>
        /// haal alle pagina's op die gebruik maken van deze template
        /// </summary>
        /// <returns></returns>
        public BaseCollection <CmsPage> GetPages()
        {
            BaseCollection <CmsPage> pages = BaseCollection <CmsPage> .Get("FK_Layout='" + ID.ToString() + "'");

            return(pages);
        }
Example #6
0
        public BaseCollection <DataItem> GetRootItems()
        {
            BaseCollection <DataItem> items = BaseCollection <DataItem> .Get("FK_Parent_Group is null AND FK_DataCollection='" + this.ID + "'", "OrderNumber");

            return(items);
        }
Example #7
0
        public BaseCollection <DataGroup> GetParentGroups()
        {
            BaseCollection <DataGroup> groups = BaseCollection <DataGroup> .Get("FK_Parent_Group is null AND FK_DataCollection='" + this.ID + "'", "OrderNumber");

            return(groups);
        }
Example #8
0
        public BaseCollection <BaseModule> GetModulesByPageId(Guid pageID)
        {
            BaseCollection <BaseModule> modules = BaseCollection <BaseModule> .Get("FK_Page = '" + pageID + "'");

            return(modules);
        }
Example #9
0
        //[NonPersistent()]
        //[System.Web.Script.Serialization.ScriptIgnore()]
        public BaseCollection <DataGroup> GetSubGroups()
        {
            _subGroups = BaseCollection <DataGroup> .Get("FK_Parent_Group='" + this.ID + "'", "OrderNumber, CreateDate");

            return(_subGroups);
        }
Example #10
0
        public BaseCollection <CmsPage> GetPages()
        {
            BaseCollection <CmsPage> pages = BaseCollection <CmsPage> .Get("FK_Folder = '" + this.ID + "'", "Name");

            return(pages);
        }
Example #11
0
        public BaseCollection <CmsPageFolder> GetSubFolders()
        {
            BaseCollection <CmsPageFolder> subFolders = BaseCollection <CmsPageFolder> .Get("FK_Parent_Folder = '" + this.ID + "'");

            return(subFolders);
        }
Example #12
0
        public List <TreeGridItem> GetGroups(string datacollectionid, string groupid, string groupPath, string sort, string searchString, int pageNumber, int pageSize)
        {
            BaseService.CheckLoginAndLicense();
            if ((groupid == null || groupid == "") &&
                (groupPath != null && groupPath != ""))
            {
                //haal folder id op vanuit path
                //path wordt gebruikt als er vanuit de breadcrumb wordt genavigeerd
                string where = String.Format("CompletePath = '{0}'", groupPath);
                DataGroup group = BaseObject.GetFirst <DataGroup>(where);
                groupid = group.ID.ToString();
            }
            if (sort == "" || sort == null)
            {
                sort = "OrderNumber";
            }
            string whereGroups = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group='{1}'", datacollectionid, groupid);

            if (groupid == null || groupid == "" || groupid == Guid.Empty.ToString())
            {
                whereGroups = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group Is Null", datacollectionid);
            }
            if (searchString != null && searchString != "")
            {
                whereGroups = String.Format("FK_DataCollection = '{0}' AND (Name like '%{1}%')", datacollectionid, searchString);
            }
            BaseCollection <DataGroup> grouplist = BaseCollection <DataGroup> .Get(whereGroups, sort, pageNumber, pageSize);

            List <TreeGridItem> returnList = new List <TreeGridItem>();

            if (!(groupid == null || groupid == "" || groupid == Guid.Empty.ToString()))
            {
                //voeg de move up folder toe
                DataGroup    group = BaseObject.GetById <DataGroup>(new Guid(groupid));
                TreeGridItem item  = new TreeGridItem();
                if (group.ParentGroup != null)
                {
                    item      = TreeGridItem.NewGroup <DataGroup>(group.ParentGroup);
                    item.Path = group.ParentGroup.CompletePath;
                }
                else
                {
                    item.ID     = Guid.Empty;
                    item.IsLeaf = false;
                    item.Type   = "Group";
                    item.Path   = "";
                }
                item.Name = "...";

                item.Status = group.ChangeStatusString;

                returnList.Add(item);
            }
            foreach (DataGroup group in grouplist)
            {
                TreeGridItem item = TreeGridItem.NewGroup <DataGroup>(group);
                item.Title  = group.Title;
                item.Field1 = group.OrderNumber.ToString();
                item.Path   = group.CompletePath;

                if (searchString != null && searchString != "")
                {
                    if (group.ParentGroup != null)
                    {
                        item.Field2 = group.ParentGroup.CompletePath;
                        item.Field3 = group.ParentGroup.ID.ToString();
                    }
                    //item.Name = item.Name.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                    item.Name = StringHelper.HighlightSearchResults(item.Name, searchString);
                }
                item.Status = group.ChangeStatusString;
                returnList.Add(item);
            }
            return(returnList);
        }
Example #13
0
        public List <TreeGridItem> GetData(string datacollectionid, string groupid, string sort, string searchString, int pageNumber, int pageSize)
        {
            BaseService.CheckLoginAndLicense();
            if (sort == "" || sort == null)
            {
                sort = "Name";
            }
            string sortItems  = sort;
            string sortGroups = sort;

            string whereItems  = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group='{1}'", datacollectionid, groupid);
            string whereGroups = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group='{1}'", datacollectionid, groupid);

            if (groupid == null || groupid == "" || groupid == Guid.Empty.ToString())
            {
                whereItems  = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group Is Null", datacollectionid);
                whereGroups = String.Format("FK_DataCollection = '{0}' AND FK_Parent_Group Is Null", datacollectionid);
            }
            if (searchString != null && searchString != "")
            {
                whereItems  = String.Format("FK_DataCollection = '{0}' AND (Name like '%{1}%' OR Title like '%{1}%')", datacollectionid, searchString);
                whereGroups = String.Format("FK_DataCollection = '{0}' AND (Name like '%{1}%')", datacollectionid, searchString);
            }
            BaseCollection <DataGroup> grouplist = BaseCollection <DataGroup> .Get(whereGroups, sortGroups, pageNumber, pageSize);

            BaseCollection <DataItem> itemslist = BaseCollection <DataItem> .Get(whereItems, sortItems, pageNumber, pageSize);

            List <TreeGridItem> returnList = new List <TreeGridItem>();

            if (!(groupid == null || groupid == "" || groupid == Guid.Empty.ToString()))
            {
                //voeg de move up folder toe
                DataGroup    group = BaseObject.GetById <DataGroup>(new Guid(groupid));
                TreeGridItem item  = new TreeGridItem();
                if (group.ParentGroup != null)
                {
                    item = TreeGridItem.NewGroup <DataGroup>(group.ParentGroup);
                }
                else
                {
                    item.ID     = Guid.Empty;
                    item.IsLeaf = false;
                    item.Type   = "Group";
                }
                item.Name   = "...";
                item.Status = group.ChangeStatusString;

                returnList.Add(item);
            }
            foreach (DataGroup group in grouplist)
            {
                TreeGridItem item = TreeGridItem.NewGroup <DataGroup>(group);
                item.Title  = group.Title;
                item.Field1 = group.OrderNumber.ToString();
                if (searchString != null && searchString != "")
                {
                    item.Name = StringHelper.HighlightSearchResults(item.Name, searchString);
                    //item.Name = item.Name.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                }
                item.Status = group.ChangeStatusString;
                returnList.Add(item);
            }
            foreach (DataItem dataItem in itemslist)
            {
                TreeGridItem item = TreeGridItem.NewItem <DataItem>(dataItem);
                item.Title  = dataItem.Title;
                item.Field1 = dataItem.OrderNumber.ToString();
                if (searchString != null && searchString != "")
                {
                    item.Name  = StringHelper.HighlightSearchResults(item.Name, searchString);
                    item.Title = StringHelper.HighlightSearchResults(item.Title, searchString);
                    //item.Name = item.Name.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                    //item.Title = item.Title.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                }
                item.Status = dataItem.ChangeStatusString;
                returnList.Add(item);
            }
            return(returnList);
        }
Example #14
0
 public BaseCollection <NewsItem> GetNewsMessages()
 {
     return(BaseCollection <NewsItem> .Get());
 }
        public void LoadControls()
        {
            this.NewsletterGroups = BaseCollection <NewsletterGroup> .Get("FK_Site = '" + SessionObject.CurrentSite.ID.ToString() + "'");

            NewsGroupCheckBoxList       = (CheckBoxList)this.FindControl("NewsGroupenCheckBoxList" + this.ModuleID.ToString("N"));
            LinkSubmitButton            = (LinkButton)this.FindControl("SubmitLinkButton" + this.ModuleID.ToString("N"));
            SubmitButton                = (Button)this.FindControl("SubmitButton" + this.ModuleID.ToString("N"));
            ResultLabel                 = (Label)this.FindControl("MessageLabel" + this.ModuleID.ToString("N"));
            EndSubscriptionButton       = (Button)this.FindControl("EndSubscriptionButton" + this.ModuleID.ToString("N"));
            AcceptEndSubscriptionButton = (Button)this.FindControl("AcceptEndSubscriptionButton" + this.ModuleID.ToString("N"));
            CancelEndSubscriptionButton = (Button)this.FindControl("CancelEndSubscriptionButton" + this.ModuleID.ToString("N"));

            if (this.AcceptEndSubscriptionButton != null)
            {
                this.AcceptEndSubscriptionButton.Click += AcceptEndSubscriptionButton_Click;
            }
            if (this.CancelEndSubscriptionButton != null)
            {
                this.CancelEndSubscriptionButton.Click += CancelEndSubscriptionButton_Click;
            }
            if (this.EndSubscriptionButton != null)
            {
                this.EndSubscriptionButton.Click += EndSubscriptionButton_Click;
            }

            /* {PanelEndSubscriptionConfirmationDialog}Weet u zeker dat u onze nieuwsbrief niet meer wil ontvangen?<br />
             *  {AcceptEndAbonnementButton}Ja{/AcceptEndAbonnementButton}{CancelEndAbonnementButton}Nee{/CancelAbonnementButton}
             * {/PanelEndSubscriptionConfirmationDialog}
             * {PanelSubscriptionDeleted}Uw abonnement is verwijderd.{/PanelSubscriptionDeleted}
             * {PanelSubscriptionChangeSaved}Abonnementwijzigingen zijn opgeslagen.{/PanelSubscriptionChangeSaved} */


            this.PanelSubscriberFrom = (HtmlControl)this.FindControl("PanelSubscriberFrom" + this.ModuleID.ToString("N"));
            this.PanelEndSubscriptionConfirmationDialog = (HtmlControl)this.FindControl("PanelEndSubscriptionConfirmationDialog" + this.ModuleID.ToString("N"));
            this.PanelSubscriptionDeleted     = (HtmlControl)this.FindControl("PanelSubscriptionDeleted" + this.ModuleID.ToString("N"));
            this.PanelSubscriptionChangeSaved = (HtmlControl)this.FindControl("PanelSubscriptionChangeSaved" + this.ModuleID.ToString("N"));

            if (this.ResultLabel != null)
            {
                this.ResultLabel.Text = "";
            }

            if (NewsGroupCheckBoxList == null)
            {
                if (this.LabelMsg != null && this.getSetting <bool>("ShowNewsGroupList"))
                {
                    this.LabelMsg.Text += "Plaats de tag {NewsGroupCheckboxList}.<br />";
                }
                this.NewsGroupCheckBoxList = new CheckBoxList();
                if (this.SubmitButton != null)
                {
                    this.SubmitButton.Visible = false;
                }
            }
            else
            {
                if (this.NewsletterGroups.Count > 1 && this.NewsGroupCheckBoxList.Items.Count == 0 && this.getSetting <bool>("ShowNewsGroupList"))
                {
                    foreach (NewsletterGroup group in this.NewsletterGroups)
                    {
                        if (group.IsChoosableGroup)
                        {
                            ListItem item = new ListItem();
                            item.Text     = group.Name;
                            item.Value    = group.ID.ToString();
                            item.Selected = (this.Subscriber != null && this.Subscriber.SubscribedGroups.Any(c => c.ID == group.ID)) ? true : false;
                            this.NewsGroupCheckBoxList.Items.Add(item);
                        }
                    }
                }
                else
                {
                    if (this.SubmitButton != null)
                    {
                        this.SubmitButton.Visible = false;
                    }
                }
            }

            if (LinkSubmitButton != null)
            {
                LinkSubmitButton.Click += SubmitButton_Click;
            }

            if (SubmitButton != null)
            {
                SubmitButton.Click += SubmitButton_Click;
            }
        }
Example #16
0
        public static BaseCollection <CmsSiteEnvironment> LoadEnvironments()
        {
            SessionObject.CurrentSite.Environments = BaseCollection <CmsSiteEnvironment> .Get("FK_Site = '" + SessionObject.CurrentSite.ID + "'");

            return(SessionObject.CurrentSite.Environments);
        }
Example #17
0
        //[NonPersistent()]
        //[System.Web.Script.Serialization.ScriptIgnore()]
        public BaseCollection <DataItem> GetItems()
        {
            _items = BaseCollection <DataItem> .Get("FK_Parent_Group='" + this.ID + "'", "OrderNumber, CreateDate");

            return(_items);
        }
Example #18
0
        public List <TreeGridItem> GetFoldersAndPages(string folderId, string folderPath, string sort, string searchString)
        {
            BaseService.CheckLoginAndLicense();
            if ((folderId == null || folderId == "") &&
                (folderPath != null && folderPath != "" && (!folderPath.Contains(" DESC") && !folderPath.Contains(" ASC"))))
            {
                //haal folder id op vanuit path
                //path wordt gebruikt als er vanuit de breadcrumb wordt genavigeerd
                string where = String.Format("RelativePath = '{0}'", folderPath);
                CmsPageFolder folder = BaseObject.GetFirst <CmsPageFolder>(where);
                folderId = folder.ID.ToString();
            }
            if (sort == "" || sort == null)
            {
                sort = "Name";
            }
            string sortPages   = sort;
            string sortFolders = sort;

            //folders kennen geen title veld en geen path veld
            sortFolders = sortFolders.Replace("Title", "Name");
            sortFolders = sortFolders.Replace("Path", "RelativePath");

            string wherePages   = String.Format("FK_Site = '{0}' AND FK_Folder='{1}'", SessionObject.CurrentSite.ID, folderId);
            string whereFolders = String.Format("FK_Site = '{0}' AND FK_Parent_Folder='{1}'", SessionObject.CurrentSite.ID, folderId);

            if (folderId == null || folderId == "" || folderId == Guid.Empty.ToString())
            {
                wherePages   = String.Format("FK_Site = '{0}' AND FK_Folder Is Null", SessionObject.CurrentSite.ID);
                whereFolders = String.Format("FK_Site = '{0}' AND FK_Parent_Folder Is Null", SessionObject.CurrentSite.ID);
            }
            if (searchString != null && searchString != "")
            {
                wherePages   = String.Format("FK_Site = '{0}' AND (Name like '%{1}%' OR Title like '%{1}%')", SessionObject.CurrentSite.ID, searchString);
                whereFolders = String.Format("FK_Site = '{0}' AND (Name like '%{1}%')", SessionObject.CurrentSite.ID, searchString);
            }
            BaseCollection <CmsPageFolder> folderlist = BaseCollection <CmsPageFolder> .Get(whereFolders, sortFolders);

            BaseCollection <CmsPage> pagelist = BaseCollection <CmsPage> .Get(wherePages, sortPages);

            List <TreeGridItem> returnList = new List <TreeGridItem>();

            if (!(folderId == null || folderId == "" || folderId == Guid.Empty.ToString()))
            {
                //voeg de move up folder toe
                CmsPageFolder folder = BaseObject.GetById <CmsPageFolder>(new Guid(folderId));
                TreeGridItem  item   = new TreeGridItem();
                if (folder.ParentFolder != null)
                {
                    item = new TreeGridItem(folder.ParentFolder);
                }
                else
                {
                    item.ID     = Guid.Empty;
                    item.IsLeaf = false;
                    item.Type   = "Folder";
                    item.Path   = "";
                }
                item.Name = "...";

                returnList.Add(item);
            }
            foreach (CmsPageFolder folder in folderlist)
            {
                TreeGridItem item = new TreeGridItem(folder);
                //if (searchString != null && searchString != "")
                //{
                //    item.Name = item.Name.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                //}
                returnList.Add(item);
            }
            foreach (CmsPage page in pagelist)
            {
                TreeGridItem item = new TreeGridItem(page);
                //if (searchString != null && searchString != "")
                //{
                //    item.Name = item.Name.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                //    item.Title = item.Title.Replace(searchString, "<span class='highlight'>" + searchString + "</span>");
                //}
                returnList.Add(item);
            }
            return(returnList);
        }