Ejemplo n.º 1
0
 private void WriteToActivityLog(string Description)
 {
     if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
     {
         MyCommon.Open_LogixRT();
     }
     MyCommon.Activity_Log(3, OfferID, CurrentUser.AdminUser.ID, Description);
     MyCommon.Close_LogixRT();
 }
    private void DisableControls()
    {
        if (!IsTemplate)
        {
            TempDisallow.Visible = false;
        }
        else
        {
            TempRequired.Visible = true;
        }
        if (!IsTemplate)
        {
            DisabledAttribute = ((CurrentUser.UserPermissions.EditOffer && !(FromTemplate && OfferEligibileCustomerGroupCondition.DisallowEdit)) ? false : true);
        }
        else
        {
            DisabledAttribute = CurrentUser.UserPermissions.EditTemplates ? false : true;
        }

        //If disable is set to false, check Buyer conditions
        if (EngineID == 9 && !DisabledAttribute)
        {
            if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
            {
                MyCommon.Open_LogixRT();
            }
            DisabledAttribute = ((CurrentUser.UserPermissions.EditOffersRegardlessBuyer || MyCommon.IsOfferCreatedWithUserAssociatedBuyer(CurrentUser.AdminUser.ID, OfferID)) ? false : true);
            MyCommon.Close_LogixRT();
        }
        if (DisabledAttribute)
        {
            functionradio1.Enabled = false;
            functionradio2.Enabled = false;
            functioninput.Enabled  = false;
            chkOffline.Enabled     = false;
            chkHouseHold.Enabled   = false;
            lstAvailable.Enabled   = false;
            lstSelected.Enabled    = false;
            lstExcluded.Enabled    = false;
            select1.Enabled        = false;
            deselect1.Enabled      = false;
            select2.Enabled        = false;
            deselect2.Enabled      = false;
            btnSave.Visible        = false;
            btnCreate.Enabled      = false;
        }

        if (!bCreateGroupOrProgramFromOffer || !CurrentUser.UserPermissions.CreateCustomerGroups || EngineID != 0)
        {
            btnCreate.Visible = false;
        }
        if ((bEnableRestrictedAccessToUEOfferBuilder && isTranslatedOffer) || (bEnableAdditionalLockoutRestrictionsOnOffers && !bOfferEditable) || m_OAWService.CheckIfOfferIsAwaitingApproval(OfferID).Result)
        {
            btnSave.Visible = false;
        }
    }
    private void DisableControls()
    {
        CurrentUser.UserPermissions = RefreshUserPermissions(CurrentUser.AdminUser.ID);
        if (objOffer.FromTemplate)
        {
            DisabledAttribute = ((CurrentUser.UserPermissions.EditOffer && !ucTemplateLockableFields.RewardTemplateFieldSource.DisallowEdit) ? false : true);
        }
        else if (objOffer.IsTemplate)
        {
            DisabledAttribute = CurrentUser.UserPermissions.EditTemplates ? false : true;
        }
        else
        {
            DisabledAttribute = CurrentUser.UserPermissions.EditOffer ? false : true;
        }

        //If disable is set to false, check Buyer conditions
        if (!DisabledAttribute)
        {
            if (m_CommonInc.LRTadoConn.State == ConnectionState.Closed)
            {
                m_CommonInc.Open_LogixRT();
            }
            DisabledAttribute = ((CurrentUser.UserPermissions.EditOffersRegardlessBuyer || m_CommonInc.IsOfferCreatedWithUserAssociatedBuyer(CurrentUser.AdminUser.ID, OfferID)) ? false : true);
            m_CommonInc.Close_LogixRT();
            //Hide save button if Disable is true
            btnSave.Visible = !DisabledAttribute;
        }
    }
Ejemplo n.º 4
0
 private void WriteToActivityLog()
 {
     if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
     {
         MyCommon.Open_LogixRT();
     }
     MyCommon.Activity_Log(3, hdnOfferID.Value.ConvertToLong(), CurrentUser.AdminUser.ID, historyString);
     MyCommon.Close_LogixRT();
 }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool bConnectionOpened = false;

        try
        {
            ResolveDependencies();

            if (!IsPostBack)
            {
                if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
                {
                    MyCommon.Open_LogixRT();
                    bConnectionOpened = true;
                }
                hdnPath.Value = Request.Url.LocalPath + "?offerid=" + OfferID;
                bEnableRestrictedAccessToUEOfferBuilder = m_common.Fetch_SystemOption(249) == "1" ? true : false;
                isTranslatedOffer = MyCommon.IsTranslatedUEOffer(Convert.ToInt32(OfferID), MyCommon);
                bEnableAdditionalLockoutRestrictionsOnOffers = m_common.Fetch_SystemOption(260) == "1" ? true : false;
                bOfferEditable = MyCommon.IsOfferEditablePastLockOutPeriod(Logix.UserRoles.EditOfferPastLockoutPeriod, MyCommon, Convert.ToInt32(OfferID));
                LocalizeControl();
                LoadEligibilityConditions();
                LoadConditionTypes();
                btnAdd.Attributes.Add("onclick", "return OpenConditionWindow(0,-1);");
                if (objOffer != null && objOffer.IsOptable)
                {
                    panelEligibilityCondition.Visible = true;
                    chkOptIn.Attributes.Add("onclick", "javascript:OptOutWindow();");
                    chkOptIn.Checked = true;
                }
                else
                {
                    chkOptIn.Checked = false;
                }
                if (!chkOptIn.Checked)
                {
                    btnAdd.Enabled             = false;
                    ddlOptInConditions.Enabled = false;
                }
                if (objOffer.IsTemplate == true)
                {
                    spanChkLocked.Visible  = true;
                    chkOptInLocked.Checked = IsOptInBlockLocked;
                }
                BindConditionRepeters();
                if (objOffer.FromTemplate == true && IsOptInBlockLocked == true)
                {
                    spanChkLocked.Visible = false;
                    //panelEligibilityCondition.Enabled = false;
                    panelOptIn.Enabled = false;
                }
                if (IsOptInDisabled == true)
                {
                    panelOptIn.Enabled = false;
                }
            }
            //Disable controls
            foreach (RepeaterItem item in repPointConditions.Items)
            {
                var delBtn = (Button)item.FindControl("btnPointsDelete");
                if (delBtn != null)
                {
                    delBtn.Enabled = Disable;
                }
                if (objOffer.EligiblePointsProgramConditions[item.ItemIndex].DisallowEdit == true)
                {
                    delBtn.Enabled = false;
                }
                if ((bEnableRestrictedAccessToUEOfferBuilder && isTranslatedOffer) || (bEnableAdditionalLockoutRestrictionsOnOffers && !bOfferEditable) || m_OAWService.CheckIfOfferIsAwaitingApproval(OfferID).Result)
                {
                    delBtn.Visible = false;
                }
            }
            foreach (RepeaterItem item in repSvConditions.Items)
            {
                var delBtn = (Button)item.FindControl("btnSVDelete");
                if (delBtn != null)
                {
                    delBtn.Enabled = Disable;
                }
                if (objOffer.EligibleSVProgramConditions[item.ItemIndex].DisallowEdit == true)
                {
                    delBtn.Enabled = false;
                }
                if ((bEnableRestrictedAccessToUEOfferBuilder && isTranslatedOffer) || (bEnableAdditionalLockoutRestrictionsOnOffers && !bOfferEditable) || m_OAWService.CheckIfOfferIsAwaitingApproval(OfferID).Result)
                {
                    delBtn.Visible = false;
                }
            }

            btnAdd.Enabled = (Disable && chkOptIn.Checked);
            if ((bEnableRestrictedAccessToUEOfferBuilder && isTranslatedOffer) || (bEnableAdditionalLockoutRestrictionsOnOffers && !bOfferEditable) || m_OAWService.CheckIfOfferIsAwaitingApproval(OfferID).Result)
            {
                btnAdd.Visible = false;
            }
            //panelOptIn.Enabled = true;
            //chkOptIn.Checked = true;

            //}
            //AllowAccess();
            //DeleteBtnEnabled = true;
        }
        catch (Exception excp)
        {
            infobar.Visible = true;
            lblError.Text   = m_ErrorHandler.ProcessError(excp);
        }
        finally
        {
            m_common.Close_LogixRT();
            if (bConnectionOpened)
            {
                MyCommon.Close_LogixRT();
            }
        }
    }