Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ResolveDependencies();
        GetQueryString();
        Int32.TryParse(MyCommon.Fetch_SystemOption(125), out CustomerFacingLangID);



        if (objOffer == null)
        {
            if (OfferID == 0)
            {
                DisplayError("Invalid Offer ID");
                return;
            }
            objOffer = m_Offer.GetOffer(OfferID, CMS.AMS.Models.LoadOfferOptions.CustomerCondition);
            bEnableRestrictedAccessToUEOfferBuilder = MyCommon.Fetch_SystemOption(249) == "1" ? true : false;
            isTranslatedOffer = MyCommon.IsTranslatedUEOffer(OfferID, MyCommon);
            bEnableAdditionalLockoutRestrictionsOnOffers = MyCommon.Fetch_SystemOption(260) == "1" ? true : false;
            bOfferEditable = MyCommon.IsOfferEditablePastLockOutPeriod(CurrentUser.UserPermissions.EditOfferPastLockoutPeriod, MyCommon, OfferID);
        }
        SetUpAndLocalizePage();
        CheckPermission();
        if (!IsPostBack)
        {
            if (DeliverableID != 0)
            {
                AMSResult <PassThrough> result = m_PassThroughRewards.GetPassThroughReward(DeliverableID, objOffer.EngineID);
                if (result.ResultType == AMSResultType.Success)
                {
                    objPassThrough = result.Result;
                }
                else
                {
                    DisplayError(result.GetLocalizedMessage <PassThrough>(LanguageID));
                    return;
                }
            }
            LoadPageData();
        }
        DisableControls();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ResolveDependencies();
        GetQueryStrings();
        if (objOffer == null)
        {
            if (OfferID == 0)
            {
                DisplayError(PhraseLib.Lookup("error.invalidoffer", LanguageID));
                return;
            }
            objOffer = m_Offer.GetOffer(OfferID, CMS.AMS.Models.LoadOfferOptions.CustomerCondition);
        }
        AssignPageTitle("mediatype.imgurl");
        if (!IsPostBack)
        {
            SetControlText();

            if (DeliverableID != 0)
            {
                AMSResult <PassThrough> result = m_PassThroughRewards.GetPassThroughReward(DeliverableID, objOffer.EngineID);
                if (result.ResultType == AMSResultType.Success)
                {
                    objPassThrough = result.Result;
                }
                else
                {
                    DisplayError(result.GetLocalizedMessage <PassThrough>(LanguageID));
                    return;
                }
                BindImageUrl();
            }
            SetPassThroughForLoad();
        }
        HideDisplayInfoMsg();
        PreviewImg.Visible = false;
    }