Ejemplo n.º 1
0
        public WizardElement this[string id]
        {
            get
            {
                WizardElement wiz = null;
                wiz = (from WizardElement wizardElems in this.LINQEnumarable.Where(x => x.Id.ToLower() == id.ToLower())
                       select wizardElems).SingleOrDefault();

                return(wiz);
            }
        }
        public static T CreateWizardDefinition <T>(string registeredWizardName, WizardStatus wizardStatus) where T : WizardDefinition
        {
            T wizardDefinition = Activator.CreateInstance <T>();

            wizardDefinition.Status = wizardStatus;

            WizardElement registeredWizard = ConfigurationManager.Wizards[registeredWizardName];

            wizardDefinition.RegisteredItem = registeredWizard;

            PopulatePropertyWizards(wizardDefinition);

            return(wizardDefinition);
        }
        public static WizardDefinition CreateWizardDefinition(string registeredWizardName, WizardStatus wizardStatus)
        {
            WizardElement registeredWizard = ConfigurationManager.Wizards[registeredWizardName];

            IWizard          wizardInstance   = (IWizard)registeredWizard.CreateInstance();
            WizardDefinition wizardDefinition = wizardInstance.Definition;

            wizardDefinition.Status = wizardStatus;
            if (wizardInstance is IDisposable)
            {
                (wizardInstance as IDisposable).Dispose();
            }
            return(wizardDefinition);
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wizardId = Request.QueryString["WizardID"];
            if (wizardId == "UserRegistration")
            {
                closedUserGroup = Helper.IsClosedUserGroup();
            }

            PnlWiz.CssClass = SiteConfig.UsePopupWindows ? "wizardPopup" : "wizardWidget";
            PnlWiz.ID       = null;

            if (!string.IsNullOrEmpty(Request.QueryString["XCN"]))
            {
                communityId = !Request.QueryString["XCN"].IsGuid() ? DataObjectCommunity.GetCommunityIDByVirtualURL(Request.QueryString["XCN"]) : Request.QueryString["XCN"].ToGuid();
            }
            if (!string.IsNullOrEmpty(Request.QueryString["OID"]))
            {
                objectId = Request.QueryString["OID"].ToGuid();
            }
            if (!string.IsNullOrEmpty(Request.QueryString["Step"]))
            {
                stepNumber = int.Parse(Request.QueryString["Step"]);
            }

            wizard = WizardSection.CachedInstance.Wizards[wizardId];

            if (wizard.AccessMode == AccessMode.Update)
            {
                _4screen.CSB.Extensions.Business.TrackingManager.TrackEventPage(null, null, IsPostBack, LogSitePageType.WizardEdit);
            }
            else
            if (string.IsNullOrEmpty(Request.QueryString["Flash"]))
            {
                _4screen.CSB.Extensions.Business.TrackingManager.TrackEventPage(null, null, IsPostBack, LogSitePageType.WizardInsert);
            }

            wizardSteps = wizard.Steps.LINQEnumarable.ToList();

            if (wizardSteps.Count > 0 && stepNumber < wizardSteps.Count &&
                ((wizard.NeedsAuthentication && Request.IsAuthenticated) || !wizard.NeedsAuthentication))
            {
                CommunityUsersType communityUploadUsers = CommunityUsersType.Members;
                bool isOwner  = false;
                bool isMember = false;
                if (communityId.HasValue)
                {
                    Guid currentUserId = !string.IsNullOrEmpty(Request.QueryString["UI"]) ? Request.QueryString["UI"].ToGuid() : UserProfile.Current.UserId;

                    DataObjectCommunity community = DataObject.Load <DataObjectCommunity>(communityId, null, true);
                    if (community.State != ObjectState.Added)
                    {
                        communityUploadUsers = community.UploadUsers;
                    }

                    isOwner = DataAccess.Business.Community.GetIsUserOwner(currentUserId, communityId.Value, out isMember);
                    if (communityUploadUsers == CommunityUsersType.Members && isMember)
                    {
                        communityAccessGranted = true;
                    }
                    else if (communityUploadUsers == CommunityUsersType.Owners && isOwner)
                    {
                        communityAccessGranted = true;
                    }
                    else
                    {
                        communityAccessGranted = false;
                    }
                }

                RenderTabs();
                RenderContent();
            }
        }