protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Response.Expires = -1;
            infobar.Visible  = false;
            ResolveDepedencies();
            GetQueryStrings();
            bCreateGroupOrProgramFromOffer          = MyCommon.Fetch_CM_SystemOption(134) == "1" ? true : false;
            bEnableRestrictedAccessToUEOfferBuilder = MyCommon.Fetch_SystemOption(249) == "1" ? true : false;
            AssignPageTitle("term.offer", "term.eligibilitycustomercondition", OfferID.ToString());
            if (!IsPostBack)
            {
                SetUpAndLocalizePage();
                CustomerGroupConditions objCustomerGroupConditions = m_CustCondition.GetOfferCustomerCondition(OfferID, EngineID);
                if (objCustomerGroupConditions != null)
                {
                    IncludedConditionGroup = (from p in objCustomerGroupConditions.IncludeCondition
                                              where p.Deleted == false & p.CustomerGroupID != 0
                                              select p.CustomerGroup).ToList();
                    ExcludedConditionGroup = (from p in objCustomerGroupConditions.ExcludeCondition
                                              where p.Deleted == false & p.CustomerGroupID != 0
                                              select p.CustomerGroup).ToList();
                }
                GetOfferEligibleCustomerCondition();
                GetAllCustomerGroup();

                IncludedGroup = (from p in OfferEligibileCustomerGroupCondition.IncludeCondition
                                 where p.Deleted == false
                                 select p.CustomerGroup).ToList();
                List <CustomerGroup> IncludedGroupsWithPhrase = IncludedGroup.Where(p => p.PhraseID != null).ToList();
                foreach (CustomerGroup cgroup in IncludedGroupsWithPhrase)
                {
                    cgroup.Name = PhraseLib.Lookup((Int32)cgroup.PhraseID, LanguageID).Replace("&#39;", "'");
                }

                ExcludedGroup = (from p in OfferEligibileCustomerGroupCondition.ExcludeCondition
                                 where p.Deleted == false
                                 select p.CustomerGroup).ToList();

                SetAvailableData();
                chkDisallow_Edit.Checked = OfferEligibileCustomerGroupCondition.DisallowEdit;
                chkHouseHold.Checked     = OfferEligibileCustomerGroupCondition.HouseHoldEnabled;
                chkOffline.Checked       = OfferEligibileCustomerGroupCondition.EvaluateOfflineCustomer;
                SetButtons();
                DisableControls();
            }
            else
            {
                GetValuesFromHidden();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "selectAndFocus", " SetFoucs();", true);
            }
        }
        catch (Exception ex)
        {
            infobar.InnerText = ErrorHandler.ProcessError(ex);
            infobar.Visible   = true;
        }
    }
Example #2
0
 private void GetQueryStrings()
 {
     OfferID     = Request.QueryString["OfferID"].ConvertToLong();
     ConditionID = Request.QueryString["ConditionID"].ConvertToLong();
     bEnableRestrictedAccessToUEOfferBuilder = MyCommon.Fetch_SystemOption(249) == "1" ? true : false;
     isTranslatedOffer = MyCommon.IsTranslatedUEOffer(Convert.ToInt32(OfferID), MyCommon);
     bEnableAdditionalLockoutRestrictionsOnOffers = MyCommon.Fetch_SystemOption(260) == "1" ? true : false;
     bOfferEditable     = MyCommon.IsOfferEditablePastLockOutPeriod(CurrentUser.UserPermissions.EditOfferPastLockoutPeriod, MyCommon, Convert.ToInt32(OfferID));
     bExpireDateEnabled = SystemCacheData.GetSystemOption_General_ByOptionId(TRACKABLE_COUPON_EXPIRE_DATE_SYSOPTION_ID).Equals("1");
 }
    protected void Page_Init(object sender, EventArgs e)
    {
        lCommon = new Copient.CommonInc();
        lLogix  = new Copient.LogixInc();
        object common = lCommon;

        lCommon.AppName = "UDFControl";
        lCommon.Open_LogixRT();
        Object o  = lCommon;
        Object o2 = lLogix;

        AdminUserID = Verify_AdminUser(ref o, ref o2);

        AllowEditing             = lLogix.UserRoles.EditUserDefinedFields;
        EditOfferPastLockoutdate = lLogix.UserRoles.EditOfferPastLockoutPeriod;

        if (Request.QueryString["OfferID"] != null)
        {
            OfferID = Request.QueryString["OfferID"];
        }
        else
        {
            OfferID = Request.Form["OfferID"];
        }

        AllowSpecialCharacters = lCommon.Fetch_SystemOption(171);
    }
 private void GetQueryStrings()
 {
     OfferID            = Request.QueryString["OfferID"].ConvertToLong();
     RewardID           = Request.QueryString["RewardID"].ConvertToLong();
     DeliverableID      = Request.QueryString["DeliverableID"].ConvertToLong();
     PreferenceRewardID = Request.QueryString["PreferenceRewardID"].ConvertToInt32();
     bOfferEditable     = MyCommon.IsOfferEditablePastLockOutPeriod(CurrentUser.UserPermissions.EditOfferPastLockoutPeriod, MyCommon, Convert.ToInt32(OfferID));
     bEnableAdditionalLockoutRestrictionsOnOffers = MyCommon.Fetch_SystemOption(260) == "1" ? true : false;
 }
Example #5
0
 private void SetUpUserControls()
 {
     Copient.CommonInc MyCommon = new Copient.CommonInc();
     ucNotesUI.Visible          = MyCommon.Fetch_SystemOption(75).Equals("1") ? true : false;
     ucNotesUI.NoteType         = NoteTypes.TCProgram;
     ucNotesUI.LinkID           = TCProgramID;
     ucNotes_Popup.NoteType     = NoteTypes.TCProgram;
     ucNotes_Popup.LinkID       = TCProgramID;
     ucNotes_Popup.ActivityType = ActivityTypes.TCProgram;
 }
Example #6
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();
    }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ResolveDepedencies();
     GetQueryStrings();
     bCreateGroupOrProgramFromOffer          = MyCommon.Fetch_CM_SystemOption(134) == "1" ? true : false;
     bEnableRestrictedAccessToUEOfferBuilder = MyCommon.Fetch_SystemOption(249) == "1" ? true : false;
     AssignPageTitle("term.offer", "term.eligibilitystoredvaluecondition", OfferID.ToString());
     if (!IsPostBack)
     {
         SetUpAndLocalizePage();
         GetOfferEligibleSVCondition();
         SetAvailableData();
         SetButtons();
         DisableControls();
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "selectAndFocus", " SetFoucs();", true);
     }
 }
Example #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AssignPageTitle("term.offerapprovalworkflow");
     ResolveDependencies();
     if (!Page.IsPostBack)
     {
         (this.Master as logix_LogixMasterPage).Tab_Name = "8_4";
         isBannerEnabled = mCommon.Fetch_SystemOption(66).Equals("1") ? true : false;
         ChangeBarDisplay();
         FillPageControlTextAndData();
     }
 }
    /// <summary>
    /// This function is called when proximity message reward is selected.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        AMSResult <SystemOption> objResult = SystemSettings.GetGeneralSystemOption(125);

        bEnableRestrictedAccessToUEOfferBuilder = MyCommon.Fetch_SystemOption(249) == "1" ? true : false;
        if (objResult.ResultType == AMSResultType.Success)
        {
            Int32.TryParse(objResult.Result.OptionValue, out CustomerFacingLangID);
        }
        ResolveDependencies();
        GetQueryString();

        DefaultLanguageID      = SystemSettings.GetSystemDefaultLanguage().LanguageID;
        IsMultiLanguageEnabled = SystemSettings.IsMultiLanguageEnabled();

        if (objOffer == null)
        {
            if (OfferID == 0)
            {
                //DisplayError(PhraseLib.Lookup("error.invalidoffer", LanguageID));
                return;
            }
            m_Commondata.QueryStr = "select RewardOptionId from CPE_RewardOptions where IncentiveID = " + OfferID;
            var result = m_Commondata.LRT_Select();
            if (result.Rows.Count > 0)
            {
                RewardOptionID = result.Rows[0][0].ConvertToInt32();
            }

            objOffer = m_Offer.GetOffer(OfferID, CMS.AMS.Models.LoadOfferOptions.AllRegularConditions);
            GetOfferRelatedData();
            Languages = SystemSettings.GetAllActiveLanguages((Engines)objOffer.EngineID);

            AssignHiddenFieldLanguages();
        }

        ucTemplateLockableFields.OfferId = OfferID;
        if (PMID != 0)
        {
            ucTemplateLockableFields.DeliverableId = RewardID;
        }
        if (!IsPostBack)
        {
            CheckPermissions();
            SetupAndLocalizePage();
            LoadPageData();
            ApplyPermissions();
            Page.Header.DataBind();
            EnableDisableTemplateFields();
        }
    }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     adminUserID = ((AuthenticatedUI)this.Page).CurrentUser.AdminUser.ID;
     AssignPageTitle("term.approvals");
     ResolveDependencies();
     SetUserControls();
     GetSearchText();
     GetSortingText();
     isBannerEnabled = mCommon.Fetch_SystemOption(66).Equals("1") ? true : false;
     if (!Page.IsPostBack)
     {
         gvPendingOfferList.SortKey   = "IncentiveID";
         gvPendingOfferList.SortOrder = "Desc";
         (this.Master as logix_LogixMasterPage).Tab_Name = "2_8"; // tab name for Approval is 2_8 in AppMenus (database)
         FillPageControlTextAndData(0);
     }
 }
Example #11
0
    private void FillPageControlText(Buyer buyer)
    {
        Copient.CommonInc MyCommon = new Copient.CommonInc();
        btnSave.Text      = PhraseLib.Lookup("term.save", LanguageID);
        btnDelete.Text    = PhraseLib.Lookup("term.delete", LanguageID);
        btnDelete.Visible = (buyer == null) || (CurrentUser.UserPermissions.EditBuyerRoles == false) ? false : true;
        btnSave.Visible   = CurrentUser.UserPermissions.EditBuyerRoles == false ? false : true;
        AssignPageTitle("term.buyer", string.Empty, buyer == null ? string.Empty : buyer.ID.ToString());
        htitle.InnerText = buyer == null?PhraseLib.Lookup("term.new", LanguageID) + " " + PhraseLib.Lookup("term.buyer", LanguageID) : PhraseLib.Lookup("term.buyer", LanguageID) + " #" + buyer.ID + ":" + " " + buyer.ExternalID;

        hidentification.InnerText = PhraseLib.Lookup("term.identification", LanguageID);
        lblName.Text           = String.Concat(PhraseLib.Lookup("term.buyerroleidentifier", LanguageID), ":");
        lblUsers.Text          = String.Concat(PhraseLib.Lookup("term.users", LanguageID), ":");
        lblDefaultFolder.Text  = String.Concat(PhraseLib.Lookup("term.defaultfolder", LanguageID), ":");
        btnselect.Text         = PhraseLib.Lookup("term.select", LanguageID) + " " + "▼";
        btndeselect.Text       = PhraseLib.Lookup("term.deselect", LanguageID) + " " + "▲";
        hdepartments.InnerText = PhraseLib.Lookup("term.departments", LanguageID);
        btnselectdept.Text     = PhraseLib.Lookup("term.select", LanguageID) + " " + "▼";
        btndeselectdept.Text   = PhraseLib.Lookup("term.deselect", LanguageID) + " " + "▲";
        ucNotesUI.Visible      = buyer == null ? false : MyCommon.Fetch_SystemOption(75).Equals("1") ? true : false;
        txtName.Text           = buyer == null ? "" : buyer.ExternalID;
        if (buyer != null)
        {
            Dictionary <int, string> buyerFolder = m_buyerRoleService.GetFolderNameByBuyerId(buyer.ID).Result;
            string folderNames = string.Empty;
            if (buyerFolder.Values.Count > 0)
            {
                folderNames = buyerFolder.FirstOrDefault().Value;
            }
            TempFolder.Value = folderNames;
        }
        else
        {
            if (templist.Value != "")
            {
                int folderid = Convert.ToInt32(templist.Value);
                AMSResult <string> foldername = m_buyerRoleService.GetFolderNameByFolderId(folderid);
                TempFolder.Value = foldername.Result;
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myfun1", "UpdateFolderName()", true);
            }
        }
    }
Example #12
0
    private void FillPageControlText(TrackableCouponProgram tcProgram)
    {
        Copient.CommonInc MyCommon = new Copient.CommonInc();
        #region LabelsNeverbeChange
        btnSave.Text = PhraseLib.Lookup("term.save", LanguageID);
        hidentification.InnerText = Collapsadividentification.ToolTip = PhraseLib.Lookup("term.identification", LanguageID);
        btnUpdate.Text            = PhraseLib.Lookup("term.save", LanguageID);
        btnNew.Text                               = PhraseLib.Lookup("term.new", LanguageID);
        btnDelete.Text                            = PhraseLib.Lookup("term.delete", LanguageID);
        lblExternalID.Text                        = String.Concat(PhraseLib.Lookup("term.externalid", LanguageID), ":");
        lblName.Text                              = String.Concat(PhraseLib.Lookup("term.name", LanguageID), ":");
        lblDescription.Text                       = String.Concat(PhraseLib.Lookup("term.description", LanguageID), ":");
        lblDescriptionLimitMsg.Text               = String.Concat("(", PhraseLib.Lookup("CPEoffergen.description", LanguageID), ")");
        hRedemptioninformation.InnerText          = CollapsadivRedemptioninformation.ToolTip = PhraseLib.Lookup("term.redemptioninfo", LanguageID);
        lblMaxRedempCount.Text                    = String.Concat(PhraseLib.Lookup("term.maxredemptioncount", LanguageID), ":");
        lblMaxMinInfoMsg.Text                     = String.Concat(PhraseLib.Lookup("term.minimum", LanguageID), ":1", " ", PhraseLib.Lookup("term.maximum", LanguageID), ":255");
        lblExpire.Text                            = String.Concat(PhraseLib.Lookup("storedvalue.expiredate", LanguageID), ":");
        hCouponUploadSumm.InnerText               = CollapsableDivCouponUploadSumm.ToolTip = PhraseLib.Lookup("tcpedit.associatedcoupons", LanguageID);
        hAssociatedoffer.InnerText                = CollapsableDivAssociatedoffer.ToolTip = PhraseLib.Lookup("term.associatedoffers", LanguageID);
        lblLastUpload.Text                        = PhraseLib.Lookup("term.lastupload", LanguageID) + ":";
        btnAction.Text                            = PhraseLib.Lookup("term.actions", LanguageID) + " ▼";
        lblCouponusCount.Text                     = PhraseLib.Lookup("tcpedit.couponscount", LanguageID) + ": ";
        lblExpire.Text                            = String.Concat(PhraseLib.Lookup("storedvalue.expiredate", LanguageID), ":");
        requirefieldName.ErrorMessage             = PhraseLib.Lookup("tcpedit.invalidname", LanguageID);
        requirefieldExternalID.ErrorMessage       = PhraseLib.Lookup("tcpedit.invalidexternalprogramid", LanguageID);
        DescriptionLengthValidator.ErrorMessage   = PhraseLib.Lookup("CPEoffergen.description", LanguageID);
        RangeValidatorMaxRedempCount.ErrorMessage = PhraseLib.Lookup("tcpedit.invalidredeemcount", LanguageID);
        requirefieldMaxRedempCount.ErrorMessage   = PhraseLib.Lookup("tcpedit.blankredemptioninfoerror", LanguageID);
        hExpiration.InnerText                     = PhraseLib.Lookup("term.expiration", LanguageID);
        lblExpirationType.Text                    = PhraseLib.Lookup("storedvalue.expiretype", LanguageID) + ": ";
        lblExpirationPeriodType.Text              = PhraseLib.Lookup("storedvalue.expireperiodtype", LanguageID) + ": ";
        lblExpirationPeriod.Text                  = PhraseLib.Lookup("storedvalue.expireperiod", LanguageID) + ": ";
        lblExpirationDatePicker.Text              = PhraseLib.Lookup("storedvalue.expiredate", LanguageID) + ": ";
        lblExpirationTime.Text                    = PhraseLib.Lookup("storedvalue.expiretime", LanguageID) + ": ";
        rvExpirePeriod.ErrorMessage               = PhraseLib.Lookup("sv-edit.InvalidExpirePeriod", LanguageID);
        FillExpireType();
        FillExpirePeriodType();
        FillExpireTime();

        #endregion

        ProgramID         = tcProgram == null ? "0" : tcProgram.ProgramID.ToString();
        btnSave.Visible   = tcProgram == null ? true : false;
        btnAction.Visible = !btnSave.Visible;
        htitle.InnerText  = tcProgram == null?PhraseLib.Lookup("term.new", LanguageID) + " " + PhraseLib.Lookup("term.trackablecouponprogram", LanguageID).ToLower() : PhraseLib.Lookup("term.trackablecouponprogram", LanguageID) + " #" + tcProgram.ProgramID + ": " + tcProgram.Name.TruncateString(15);

        txtName.Text             = tcProgram == null ? String.Empty : tcProgram.Name;
        txtDescription.InnerText = tcProgram == null ? String.Empty : tcProgram.Description.Trim();
        txtExternalID.Text       = tcProgram == null ? String.Empty : tcProgram.ExtProgramID;
        ExpireDate.Text          = (tcProgram == null || tcProgram.ExpireDate == null) ? PhraseLib.Lookup("tcpedit.expiredatenotset", LanguageID) : tcProgram.ExpireDate.ConvertToDate().ToShortDateString();
        txtMaxRedempCount.Text   = tcProgram == null ? "1" : Convert.ToString(tcProgram.MaxRedeemCount);
        SetLastLoadMessage(tcProgram);
        CouponCount.Text        = tcProgram == null ? "0" : Convert.ToString(tcProgram.AssosiatedCouponCount);
        ucNotesUI.Visible       = tcProgram == null ? false : MyCommon.Fetch_SystemOption(75).Equals("1") ? true : false;
        lblAssociatedOffer.Text = PhraseLib.Lookup("term.none", LanguageID);
        AssociateOfferID        = String.Empty;

        bExpireDateEnabled                 = SystemCacheData.GetSystemOption_General_ByOptionId(TRACKABLE_COUPON_EXPIRE_DATE_SYSOPTION_ID).Equals("1");
        ddlExpireTypes.SelectedValue       = ((tcProgram == null) || (!bExpireDateEnabled)) ? "1" : tcProgram.TCExpireType.ToString();
        ddlExpirePeriodTypes.SelectedValue = tcProgram == null ? "0" : tcProgram.TCExpirePeriodType.ToString();
        txtExpirationPeriod.Text           = tcProgram == null ? "0" : tcProgram.ExpirePeriod.ToString();
        ddlExpireTypes_SelectedIndexChanged(this, EventArgs.Empty);
        txtDatepicker.Text = (tcProgram == null || tcProgram.ExpireDate == null) ? "" : ExpireDate.Text;
        ddlExpireTimeHours.SelectedValue   = (tcProgram == null || tcProgram.ExpireDate == null) ? "00" : tcProgram.ExpireDate.Value.Hour.ToString("00");
        ddlExpireTimeMinutes.SelectedValue = (tcProgram == null || tcProgram.ExpireDate == null) ? "00" : tcProgram.ExpireDate.Value.Minute.ToString("00");

        if (bExpireDateEnabled)
        {
            divExpiration.Visible = true;
        }

        if (tcProgram != null)
        {
            List <CMS.AMS.Models.Offer> offersObj = GetAttachedOffersByID(tcProgram.ProgramID);
            if (offersObj != null && offersObj.Count > 0)
            {
                lblAssociatedOffer.Text = String.Empty;
                offerService            = CurrentRequest.Resolver.Resolve <IOffer>();
                foreach (var item in offersObj)
                {
                    AssociateOfferID = item.OfferID.ToString();
                    if (SystemCacheData.GetSystemOption_General_ByOptionId(66) == "1")
                    {
                        AMSResult <bool> ResultObj = offerService.IsAccessibleBannerEnabledOffer(CurrentUser.AdminUser.ID, item.OfferID);
                        if (ResultObj.ResultType != AMSResultType.Success)
                        {
                            DisplayError(ResultObj.GetLocalizedMessage <bool>(LanguageID));
                            return;
                        }
                        if (ResultObj.Result)
                        {
                            lblAssociatedOffer.Text += "<a href='offer-redirect.aspx?OfferID=" + item.OfferID + "'>" + item.OfferName + "</a>" + "</br>";
                        }
                        else
                        {
                            lblAssociatedOffer.Text += item.OfferName + "</br>";
                        }
                    }
                    else
                    {
                        lblAssociatedOffer.Text += "<a href='offer-redirect.aspx?OfferID=" + item.OfferID + "'>" + item.OfferName + "</a>" + "</br>";
                    }
                }
            }
        }
    }