Exemple #1
0
 private void RenderContent()
 {
     if (!wizard.NeedsAuthentication || !communityAccessGranted.HasValue || communityAccessGranted.Value)
     {
         MultiPage.PageViews.Clear();
         for (int i = 0; i < wizardSteps.Count; i++)
         {
             RadPageView radPageView = new RadPageView();
             radPageView.ID = "Page" + i;
             if (i == stepNumber)
             {
                 StepsASCX wizardControl = (StepsASCX)this.LoadControl(wizardSteps[i].Control);
                 wizardControl.AccessMode  = wizard.AccessMode;
                 wizardControl.ObjectType  = Helper.GetObjectType(wizard.ObjectType).NumericId;
                 wizardControl.StepNumber  = i;
                 wizardControl.WizardId    = wizardId;
                 wizardControl.CommunityID = communityId;
                 wizardControl.ObjectID    = objectId;
                 wizardControl.Settings    = wizardSteps[i].Settings.LINQEnumarable.ToDictionary(x => x.Key, x => x.Value);
                 wizardControl.ID          = "Step" + i;
                 wizardControls.Add(i, wizardControl);
                 radPageView.Controls.Add(wizardControl);
                 RenderButtons(radPageView, i);
                 radPageView.Controls.Add(new LiteralControl("<div class=\"clearBoth\"></div>"));
             }
             MultiPage.PageViews.Add(radPageView);
         }
     }
     MultiPage.SelectedIndex = stepNumber;
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["UploadSession"]))
            {
                uploadSession = Request.QueryString["UploadSession"].ToGuid();
            }

            string uploadFolder = string.Format(@"{0}\{1}\{2}", System.Configuration.ConfigurationManager.AppSettings["ConverterRootPathUpload"], UserProfile.Current.UserId, Helper.GetMediaFolder(ObjectType));

            DataObjectList <DataObject> dataObjectsByUploadSession = DataObjects.Load <DataObject>(new QuickParameters {
                Udc = UserDataContext.GetUserDataContext(UserProfile.Current.UserName), ObjectType = ObjectType, SortBy = QuickSort.InsertedDate, Direction = QuickSortDirection.Asc, GroupID = uploadSession, DisablePaging = true, IgnoreCache = true, QuerySourceType = QuerySourceType.MyContent
            });

            if (dataObjectsByUploadSession.Count == 0) // No objects found for groupId=uploadSession
            {
                string[] uploadedFiles = Directory.GetFiles(uploadFolder, string.Format("{0}*.*", uploadSession.ToString().Replace("-", "")));
                Array.Sort(uploadedFiles);
                for (int i = 0; i < uploadedFiles.Length; i++)
                {
                    FileInfo  uploadedFileInfo = new FileInfo(uploadedFiles[i]);
                    StepsASCX subStep          = InitSubStep(uploadedFileInfo, null, i, uploadedFiles.Length);
                }
            }
            else
            {
                for (int i = 0; i < dataObjectsByUploadSession.Count; i++)
                {
                    StepsASCX subStep = InitSubStep(null, dataObjectsByUploadSession[i].ObjectID, i, dataObjectsByUploadSession.Count);
                }
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string locationControl = WizardSection.CachedInstance.Wizards[Helper.GetObjectType("Location").UploadWizard].Steps[0].Control;

            control             = (StepsASCX)LoadControl(locationControl);
            control.ObjectID    = Request.QueryString["OID"].ToGuid();
            control.CommunityID = Request.QueryString["CN"].ToGuid();
            PhLocation.Controls.Add(control);
        }
Exemple #4
0
        private StepsASCX InitSubStep(FileInfo uploadedFileInfo, Guid?objectId, int number, int numberTotal)
        {
            bool      isLast  = (number < numberTotal - 1) ? false : true;
            StepsASCX subStep = null;

            if (ObjectType == Helper.GetObjectTypeNumericID("Picture"))
            {
                subStep = (StepsASCX)this.LoadControl("~/UserControls/Wizards/Picture.ascx");
                if (uploadedFileInfo != null)
                {
                    ((Picture)subStep).FileInfo = uploadedFileInfo;
                }
                if (numberTotal > 1)
                {
                    ((Picture)subStep).IsSubStep = true;
                }
            }
            else if (ObjectType == Helper.GetObjectTypeNumericID("Video"))
            {
                subStep = (StepsASCX)this.LoadControl("~/UserControls/Wizards/Video.ascx");
                if (uploadedFileInfo != null)
                {
                    ((Video)subStep).FileInfo = uploadedFileInfo;
                }
                if (numberTotal > 1)
                {
                    ((Video)subStep).IsSubStep = true;
                }
            }
            else if (ObjectType == Helper.GetObjectTypeNumericID("Audio"))
            {
                subStep = (StepsASCX)this.LoadControl("~/UserControls/Wizards/Audio.ascx");
                if (uploadedFileInfo != null)
                {
                    ((Audio)subStep).FileInfo = uploadedFileInfo;
                }
                if (numberTotal > 1)
                {
                    ((Audio)subStep).IsSubStep = true;
                }
            }
            else if (ObjectType == Helper.GetObjectTypeNumericID("Document"))
            {
                subStep = (StepsASCX)this.LoadControl("~/UserControls/Wizards/Document.ascx");
                if (uploadedFileInfo != null)
                {
                    ((Document)subStep).FileInfo = uploadedFileInfo;
                }
                if (numberTotal > 1)
                {
                    ((Document)subStep).IsSubStep = true;
                }
            }

            subStep.AccessMode  = this.AccessMode;
            subStep.ObjectType  = this.ObjectType;
            subStep.StepNumber  = this.StepNumber;
            subStep.WizardId    = this.WizardId;
            subStep.CommunityID = this.CommunityID;

            if (objectId.HasValue)
            {
                subStep.ObjectID = objectId.Value;
            }

            this.subSteps.Add(subStep);
            this.PhCnt.Controls.Add(subStep);
            if (!isLast)
            {
                this.PhCnt.Controls.Add(new LiteralControl("<div class=\"CSB_input_separator\"></div>"));
            }

            return(subStep);
        }