protected void lst_DataBinding(object sender, EventArgs e)
    {
        ListBox lst     = (ListBox)sender;
        int     Counter = 0;

        for (Counter = 0; Counter < lst.Items.Count; Counter++)
        {
            ListItem lstItem = lst.Items[Counter];
            if (Counter > 4)
            {
                break;
            }
            if (lstItem.Value.ConvertToLong() == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID ||
                lstItem.Value.ConvertToLong() == SystemCacheData.GetAllCAMCardHolderGroup().CustomerGroupID ||
                lstItem.Value.ConvertToLong() == SystemCacheData.GetNewCardHolderGroup().CustomerGroupID ||
                lstItem.Value.ConvertToLong() == SystemCacheData.GetAnyCardHolderGroup().CustomerGroupID)
            {
                lstItem.Attributes.Add("style", "color:brown;font-weight:bold;");
            }
        }
    }
    private void GetAllCustomerGroup()
    {
        bool IsAnyCustomerEnabled = false;

        //if (EngineID == 2)
        //{
        // // IsAnyCustomerEnabled = (SystemCacheData.GetSystemOption_CPE_ByOptionId(125) == "1" ? true : false);
        //  if (IsAnyCustomerEnabled)
        //    IsAnyCustomerEnabled = m_offer.IsAnyCustomerAllowedForOffer(OfferID);
        //}

        AllGroups = m_CustGroup.GetCustomerGroups();

        if (!IsAnyCustomerEnabled)
        {
            var CustGroup     = SystemCacheData.GetAnyCustomerGroup();
            var selectedgroup = AllGroups.Where(p => p.CustomerGroupID == CustGroup.CustomerGroupID).SingleOrDefault();
            AllGroups.Remove(selectedgroup);
        }
        //if CAM is Not installed, remove CAM specific groups - refer to AMS-14578
        if (EngineID != 6)
        {
            var camgroup = AllGroups.Where(p => p.CustomerGroupID == SystemCacheData.GetAllCAMCardHolderGroup().CustomerGroupID).SingleOrDefault();
            AllGroups.Remove(camgroup);
        }
        else
        {
            //do CMS engine specific things
        }
        List <CustomerGroup> lstCustomerGroupwithPhrases = AllGroups.Where(p => p.PhraseID != null).ToList();

        foreach (CustomerGroup cgroup in lstCustomerGroupwithPhrases)
        {
            cgroup.Name = PhraseLib.Lookup((Int32)cgroup.PhraseID, LanguageID).Replace("&#39;", "'");
        }
    }
    private void SetButtons()
    {
        if (lstSelected.Items.Count == 0)
        {
            select1.Enabled = true;
        }
        if (lstSelected.Items.Count > 0)
        {
            deselect1.Enabled = true;
            select2.Enabled   = true;
        }
        else
        {
            deselect1.Enabled = false;
            select2.Enabled   = false;
        }

        if (lstExcluded.Items.Count > 0)
        {
            deselect2.Enabled = true;
        }
        else
        {
            deselect2.Enabled = false;
        }

        if (lstSelected.Items.Count == 1 && (lstSelected.Items[0].Value.ConvertToLong() == SystemCacheData.GetAnyCardHolderGroup().CustomerGroupID || lstSelected.Items[0].Value.ConvertToLong() == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID))
        {
            select1.Enabled = false;
        }
    }
    private void HandleSelectedForSpecialGroup()
    {
        var group = IncludedGroup.Where(p => p.CustomerGroupID == SystemCacheData.GetAnyCardHolderGroup().CustomerGroupID || p.CustomerGroupID == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID).SingleOrDefault();

        if (group != null)
        {
            IncludedGroup.Clear();
            IncludedGroup.Add(group);
            select1.Enabled = false;
        }
        else
        {
            select1.Enabled = true;
        }
    }
    protected void select2_Click(object sender, EventArgs e)
    {
        if (lstAvailable.SelectedItem != null)
        {
            foreach (int i in lstAvailable.GetSelectedIndices())
            {
                if (AvailableFilteredCustomerGroup[i].CustomerGroupID == SystemCacheData.GetAnyCardHolderGroup().CustomerGroupID || AvailableFilteredCustomerGroup[i].CustomerGroupID == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID || AvailableFilteredCustomerGroup[i].CustomerGroupID == SystemCacheData.GetNewCardHolderGroup().CustomerGroupID)
                {
                    infobar.InnerText = AvailableFilteredCustomerGroup[i].Name + " " + PhraseLib.Lookup("offer-eligibility-validateexlgroup", LanguageID).Replace("&#39;", "'");
                    infobar.Visible   = true;
                    break;
                }
                ExcludedGroup.Add(AvailableFilteredCustomerGroup[i]);
            }

            SetAvailableData();
        }
        SetButtons();
    }
Exemplo n.º 6
0
    private void LoadPoints()
    {
        var pointPrograms = objOffer.CustomerGroupConditions.IncludeCondition[0].CustomerGroupID == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID ? m_PointsProgram.GetAllowAnyCustomerPointsPrograms(): m_PointsProgram.GetPointsPrograms();
        var data          = from point in pointPrograms select new { ProgramID = point.ProgramID, ProgramName = point.ProgramName };

        PointsJSON          = data.ToJSON();
        lbPoints.DataSource = data;
        lbPoints.DataBind();
    }
Exemplo n.º 7
0
    private void LoadSV()
    {
        var svPrograms = objOffer.CustomerGroupConditions.IncludeCondition[0].CustomerGroupID == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID ? m_SVProgram.GetStoredValueAllowAnyCustomerPrograms(false):m_SVProgram.GetStoredValuePrograms();
        var data       = from sv in svPrograms select new { SVProgramID = sv.SVProgramID, ProgramName = sv.ProgramName };

        StoredValueJSON = data.ToJSON();
        lbSV.DataSource = data;
        lbSV.DataBind();
    }
Exemplo n.º 8
0
 private void LoadPageData()
 {
     if (objOffer.CustomerGroupConditions != null && objOffer.CustomerGroupConditions.IncludeCondition[0].CustomerGroupID == SystemCacheData.GetAnyCustomerGroup().CustomerGroupID)
     {
         if (objOffer.EngineID != (int)Engines.UE || !m_SVProgram.IsAnyCustomerSVProgramExist())
         {
             hdDisableSV.Value = "1";
             var data = from sv in new List <SVProgram>() select new { SVProgramID = sv.SVProgramID, ProgramName = sv.ProgramName };
             StoredValueJSON = data.ToJSON();
             lbSV.DataSource = data;
             lbSV.DataBind();
         }
         else
         {
             LoadSV();
         }
         if (objOffer.EngineID != (int)Engines.UE || !m_PointsProgram.IsAnyCustomerPointProgramExist())
         {
             hdDisablePoint.Value = "1";
             var data2 = from point in new List <PointsProgram>() select new { ProgramID = point.ProgramID, ProgramName = point.ProgramName };
             PointsJSON          = data2.ToJSON();
             lbPoints.DataSource = data2;
             lbPoints.DataBind();
         }
         else
         {
             LoadPoints();
         }
     }
     else
     {
         LoadSV();
         LoadPoints();
     }
     LoadCode();
     SetPassThroughForLoad();
 }