/// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            listElem.StopProcessing = true;
        }

        // Set NodeID in order to check the access to the document
        listElem.NodeID = NodeID;

        // Setup the list control properties
        pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0);
        zoneId = listElem.ZoneID = QueryHelper.GetString("zoneid", string.Empty);
        instanceGuid = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty);
        aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
        webPartId = QueryHelper.GetString("webpartid", string.Empty);
        btnClose.Text = GetString("general.close");
    }
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.contentpersonalization", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "Content personalization"));
        }

        // Set the ParentObject manually tor inherited templates
        if (editElem.UIFormControl.ParentObject == null)
        {
            string aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
            // Get page info for the given document
            PageInfo pi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, aliasPath, CMSContext.PreferredCultureCode, null, CMSContext.CurrentSite.CombineWithDefaultCulture);
            if (pi != null)
            {
                editElem.UIFormControl.ParentObject = pi.PageTemplateInfo;
            }
        }

        // Get information whether the control is used for a web part or zone variant
        variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        base.OnInit(e);

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            editElem.StopProcessing = true;
        }

        editElem.UIFormControl.OnBeforeSave += new EventHandler(UIFormControl_OnBeforeSaved);
    }
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.contentpersonalization", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "Content personalization"));
        }

        variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            listElem.StopProcessing = true;
        }

        // Setup the list control properties
        pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0);
        zoneId = listElem.ZoneID = QueryHelper.GetText("zoneid", string.Empty);
        instanceGuid = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty);
        aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
        webPartId = QueryHelper.GetString("webpartid", string.Empty);
    }
示例#4
0
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.contentpersonalization", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "Content personalization"));
        }

        variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            listElem.StopProcessing = true;
        }

        // Setup the list control properties
        pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0);
        zoneId         = listElem.ZoneID = QueryHelper.GetText("zoneid", string.Empty);
        instanceGuid   = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty);
        aliasPath      = QueryHelper.GetString("aliaspath", string.Empty);
        webPartId      = QueryHelper.GetString("webpartid", string.Empty);
    }
示例#5
0
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            listElem.StopProcessing = true;
        }

        // Set NodeID in order to check the access to the document
        listElem.NodeID = NodeID;

        // Setup the list control properties
        pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0);
        zoneId         = listElem.ZoneID = QueryHelper.GetString("zoneid", string.Empty);
        instanceGuid   = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty);
        aliasPath      = QueryHelper.GetString("aliaspath", string.Empty);
        webPartId      = QueryHelper.GetString("webpartid", string.Empty);
        btnClose.Text  = GetString("general.close");
    }
示例#6
0
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        // Set the ParentObject manually tor inherited templates
        if (editElem.UIFormControl.ParentObject == null)
        {
            string aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
            // Get page info for the given document
            PageInfo pi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, aliasPath, CMSContext.PreferredCultureCode, null, CMSContext.CurrentSite.CombineWithDefaultCulture);
            if (pi != null)
            {
                editElem.UIFormControl.ParentObject = pi.PageTemplateInfo;
            }
        }

        // Get information whether the control is used for a web part or zone variant
        variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        base.OnInit(e);

        // Check permissions and redirect
        OnlineMarketingContext.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            editElem.StopProcessing = true;
        }

        editElem.UIFormControl.OnBeforeSave += new EventHandler(UIFormControl_OnBeforeSaved);
    }
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.VariantName = binaryReader.ReadStringID();
     this.VariantType = ((VariantTypeEnum)(binaryReader.ReadInt32()));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(8));
     this.DescriptionIndex = binaryReader.ReadByte();
     this.fieldpad         = binaryReader.ReadBytes(3);
     return(pointerQueue);
 }
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        // Register the Save and close button as the form submit button
        HeaderActions.Visible = false;
        editElem.UIFormControl.SubmitButton.Visible = false;
        btnOk.Click += (s, ea) => editElem.UIFormControl.SaveData(null);

        // Turn off update document for this page
        EnsureDocumentManager = false;

        // Set the ParentObject manually tor inherited templates
        if (editElem.UIFormControl.ParentObject == null)
        {
            var aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
            var siteName  = SiteContext.CurrentSiteName;

            // Get page info for the given document
            PageInfo pi = PageInfoProvider.GetPageInfo(siteName, aliasPath, LocalizationContext.PreferredCultureCode, null, SiteInfoProvider.CombineWithDefaultCulture(siteName));
            if (pi != null)
            {
                editElem.UIFormControl.ParentObject = pi.UsedPageTemplateInfo;
            }
        }

        // Get information whether the control is used for a web part or zone variant
        variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        mTemplateID = QueryHelper.GetInteger("templateid", 0);

        base.OnInit(e);

        // Check permissions and redirect
        VariantPermissionsChecker.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            editElem.StopProcessing = true;
        }

        editElem.UIFormControl.OnBeforeSave += UIFormControl_OnBeforeSaved;
    }
    /// <summary>
    /// Raises the <see cref="E:Init"/> event.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        // Register the Save and close button as the form submit button
        HeaderActions.Visible = false;
        editElem.UIFormControl.SubmitButton.Visible = false;
        btnOk.Click += (s, ea) => editElem.UIFormControl.SaveData(null);

        // Turn off update document for this page
        EnsureDocumentManager = false;

        // Set the ParentObject manually tor inherited templates
        if (editElem.UIFormControl.ParentObject == null)
        {
            var aliasPath = QueryHelper.GetString("aliaspath", string.Empty);
            var siteName = SiteContext.CurrentSiteName;

            // Get page info for the given document
            PageInfo pi = PageInfoProvider.GetPageInfo(siteName, aliasPath, LocalizationContext.PreferredCultureCode, null, SiteInfoProvider.CombineWithDefaultCulture(siteName));
            if (pi != null)
            {
                editElem.UIFormControl.ParentObject = pi.UsedPageTemplateInfo;
            }
        }

        // Get information whether the control is used for a web part or zone variant
        variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty));

        mTemplateID = QueryHelper.GetInteger("templateid", 0);

        base.OnInit(e);

        // Check permissions and redirect
        VariantPermissionsChecker.CheckPermissions(variantType);

        // Get the alias path of the current node
        if (Node == null)
        {
            editElem.StopProcessing = true;
        }

        editElem.UIFormControl.OnBeforeSave += UIFormControl_OnBeforeSaved;
    }
示例#10
0
        /// <summary>
        /// Calculate the variant rate
        /// </summary>
        /// <param name="type">Type of variant rate</param>
        /// <param name="rateAmount">Original rate amount</param>
        /// <param name="variantAmount">Variant amount</param>
        /// <param name="dayAvailable">Check in day available</param>
        /// <param name="isPerPerson">True if calculating for per person pricing</param>
        /// <returns>Return the rate plans computed</returns>
        private static decimal? CalculateVariantRate(VariantTypeEnum type, decimal rateAmount, decimal variantAmount, int dayAvailable, bool isPerPerson = false)
        {
            if (dayAvailable != CHECKIN_DAY_AVAILABLE)
            {
                return null;
            }

            switch (type)
            {
                case VariantTypeEnum.Amount:
                    return isPerPerson ? rateAmount : rateAmount + variantAmount;
                case VariantTypeEnum.Percentage:
                    return Math.Round((rateAmount * (100 + variantAmount)) / 100, 2);
                default:
                    return default(decimal);
            }
        }