Example #1
0
        private bool Create()
        {
            bool created = false;
            int  newID   = -1;

            if (this.guid == Guid.Empty)// tni 2013-06-26 forced moduleGuid implementation
            {
                this.guid = Guid.NewGuid();
            }

            newID = DBModule.AddModule(
                this.pageID,
                this.siteID,
                this.siteGuid,
                this.moduleDefID,
                this.moduleOrder,
                this.paneName,
                this.moduleTitle,
                this.viewRoles,
                this.authorizedEditRoles,
                this.draftEditRoles,
                this.draftApprovalRoles,
                this.cacheTime,
                this.showTitle,
                this.availableForMyPage,
                this.allowMultipleInstancesOnMyPage,
                this.icon,
                this.createdByUserID,
                DateTime.UtcNow,
                this.guid,
                this.featureGuid,
                this.hideFromAuthenticated,
                this.hideFromUnauthenticated,
                this.headElement,
                this.publishMode);

            this.moduleID = newID;
            created       = (newID > -1);
            if (created)
            {
                ModuleSettings.CreateDefaultModuleSettings(this.moduleID);
            }

            return(created);
        }
Example #2
0
        private bool Create()
        {
            bool created = false;
            int  newID   = -1;

            if (this.ModuleGuid == Guid.Empty)// tni 2013-06-26 forced moduleGuid implementation
            {
                this.ModuleGuid = Guid.NewGuid();
            }

            newID = DBModule.AddModule(
                this.PageId,
                this.SiteId,
                this.SiteGuid,
                this.ModuleDefId,
                this.ModuleOrder,
                this.PaneName,
                this.ModuleTitle,
                this.ViewRoles,
                this.AuthorizedEditRoles,
                this.DraftEditRoles,
                this.DraftApprovalRoles,
                this.CacheTime,
                this.ShowTitle,
                this.AvailableForMyPage,
                this.AllowMultipleInstancesOnMyPage,
                this.Icon,
                this.CreatedByUserId,
                DateTime.UtcNow,
                this.ModuleGuid,
                this.FeatureGuid,
                this.HideFromAuthenticated,
                this.HideFromUnauthenticated,
                this.HeadElement,
                this.PublishMode);

            this.ModuleId = newID;
            created       = (newID > -1);
            if (created)
            {
                ModuleSettings.CreateDefaultModuleSettings(this.ModuleId);
            }

            return(created);
        }