예제 #1
0
 protected void select1_Click(object sender, EventArgs e)
 {
     if (lstAvailable.SelectedItem != null)
     {
         foreach (int i in lstAvailable.GetSelectedIndices())
         {
             IncludedPointProgram.Add(AvailableFilteredPointProgram[i]);
         }
         SetAvailableData();
     }
     SetButtons();
 }
예제 #2
0
    protected void btnCreate_Click(object sender, EventArgs e)
    {
        string Name = string.Empty;

        if (MyCommon.Parse_Quotes(Logix.TrimAll(functioninput.Text)) != null)
        {
            Name = Convert.ToString(MyCommon.Parse_Quotes(Logix.TrimAll(functioninput.Text)));
        }
        if (!String.IsNullOrEmpty(Name))
        {
            int AvailableListCount = AvailableFilteredPointProgram.Where(p => p.ProgramName.Equals(functioninput.Text, StringComparison.OrdinalIgnoreCase)).ToList().Count;
            int IncludedGroupCount = IncludedPointProgram.Where(p => p.ProgramName.Equals(functioninput.Text, StringComparison.OrdinalIgnoreCase)).ToList().Count;

            if (IncludedGroupCount > 0)
            {
                string alertMessage = Copient.PhraseLib.Lookup("term.pointsprogram", LanguageID) + ": " + Name + " " + Copient.PhraseLib.Lookup("term.is", LanguageID).ToLower() + " " + Copient.PhraseLib.Lookup("term.already", LanguageID).ToLower() + " " + Copient.PhraseLib.Lookup("term.selected", LanguageID).ToLower();
                ScriptManager.RegisterStartupScript(UpdatePanelMain, UpdatePanelMain.GetType(), "AlertMessage", " AlertMessage('" + alertMessage + "');", true);
            }
            else if (AvailableListCount > 0)
            {
                string alertMessage = Copient.PhraseLib.Lookup("term.existing", LanguageID) + " " + Copient.PhraseLib.Lookup("term.pointsprogram", LanguageID).ToLower() + ": " + Name + " " + Copient.PhraseLib.Lookup("offer.message", LanguageID).ToLower();
                ScriptManager.RegisterStartupScript(UpdatePanelMain, UpdatePanelMain.GetType(), "AlertMessage", " AlertMessage('" + alertMessage + "');", true);

                //First remove the selected point if exist any

                IncludedPointProgram.Clear();

                IncludedPointProgram.Add(AvailableFilteredPointProgram.Where(p => p.ProgramName.Equals(functioninput.Text, StringComparison.OrdinalIgnoreCase)).FirstOrDefault());
                SetAvailableData();
                SetButtons();
            }
            else
            {
                IncludedPointProgram.Clear();

                //Then add newly created points program to the selected list
                IncludedPointProgram.Add(CreatePointsProgram());
                SetAvailableData();

                SetButtons();
            }
        }
        else
        {
            string alertMessage = Copient.PhraseLib.Lookup("term.enter", LanguageID) + " " + Copient.PhraseLib.Lookup("term.valid", LanguageID).ToLower() + " " + Copient.PhraseLib.Lookup("term.pointsprogram", LanguageID).ToLower() + " " + Copient.PhraseLib.Lookup("term.name", LanguageID).ToLower();
            ScriptManager.RegisterStartupScript(UpdatePanelMain, UpdatePanelMain.GetType(), "AlertMessage", " AlertMessage('" + alertMessage + "');", true);
        }
    }
예제 #3
0
    private void GetOfferEligiblePointsCondition()
    {
        if (ConditionID > 0)
        {
            OfferEligibilePointsCondition = m_PointsCondition.GetConditionByID(ConditionID);
        }
        if (IncludedPointProgram == null)
        {
            IncludedPointProgram = new List <CMS.AMS.Models.PointsProgram>();
        }
        if (OfferEligibilePointsCondition == null)
        {
            OfferEligibilePointsCondition = new CMS.AMS.Models.PointsCondition();
        }
        else
        {
            CMS.AMS.Models.PointsProgram objPointsProgram = new CMS.AMS.Models.PointsProgram();
            objPointsProgram.ProgramID = OfferEligibilePointsCondition.ProgramID;

            IncludedPointProgram.Add(OfferEligibilePointsCondition.PointsProgram);
            SetValues(OfferEligibilePointsCondition);
        }
    }