コード例 #1
0
        public void AddAgendaItem(AgendaItemManager.AgendaItemType type, string name)
        {
            this.ClickAddAgendaItem();
            this.AGMgr.SetName(name);
            this.AGMgr.SetTypeWithDefaults(type);

            // Enter dates
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                AGMgr.SetStartEndDateTime(AgendaItemStartDateTime_Default, AgendaItemEndDateTime_Default);
            }

            // Enter amount
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.FileUpload ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                AGMgr.FeeMgr.SetStandardPrice(Math.Round(new Random((int)DateTime.Now.Ticks).NextDouble() * 1000 + 1, 2));
            }

            AGMgr.ClickSaveItem();
            UIUtil.DefaultProvider.SwitchToMainContent();
            UIUtil.DefaultProvider.WaitForPageToLoad();
        }
コード例 #2
0
        public void AddActivity(AgendaItemManager.AgendaItemType type, string name, double? price)
        {
            this.ClickAddActivities();
            this.AGMgr.SetName(name);
            this.AGMgr.SetTypeWithDefaults(type);

            // Enter dates
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                AGMgr.SetStartEndDateTime(AgendaItemStartDateTime_Default, AgendaItemEndDateTime_Default);
            }

            // Enter amount
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.FileUpload ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected &&
                price != null)
            {
                AGMgr.FeeMgr.SetStandardPrice(price);
            }

            AGMgr.ClickSaveItem();
            UIUtil.DefaultProvider.SwitchToMainContent();
            UIUtil.DefaultProvider.WaitForPageToLoad();
        }
コード例 #3
0
 private void AgendaItem(AgendaItemManager.AgendaItemType type, string name, bool prePopulate, bool groupEdit)
 {
     BuilderMgr.ClickAddAgendaItem();
     BuilderMgr.AGMgr.SetName(name);
     BuilderMgr.AGMgr.SetType(type);
     if (type == AgendaItemManager.AgendaItemType.Dropdown || type == AgendaItemManager.AgendaItemType.RadioButton)
     {
         BuilderMgr.AGMgr.AddPredefinedMultiChoiceItem(PredifinedMultiChoiceItemManagerBase.PredefinedItemType.Agreement);
     }
     if (type == AgendaItemManager.AgendaItemType.Number || type == AgendaItemManager.AgendaItemType.OneLineText)
     {
         BuilderMgr.AGMgr.SetOneLineLength(25);
     }
     if (type == AgendaItemManager.AgendaItemType.Paragraph)
     {
         BuilderMgr.AGMgr.SetParagraphCharacterLimit(10000);
     }
     BuilderMgr.AGMgr.PrePopulateAgendaGroupSelections(prePopulate);
     if (groupEdit)
     {
         BuilderMgr.AGMgr.AllowAgendaGroupSelectionEditing(groupEdit);
     }
     BuilderMgr.AGMgr.ClickSaveItem();
 }
コード例 #4
0
 private void AddAndVerifyAgendaItem(AgendaItemManager.AgendaItemType type, string name)
 {
     BuilderMgr.AddAgendaItem(type, name);
     BuilderMgr.VerifyAgendaItemInDatabase(type, name);
 }
コード例 #5
0
        private void AddAgendaItemWithConditionalLogic(
            CustomField name, 
            CustomField conditionalParent,
            AgendaItemManager.AgendaItemType type, 
            double? standardPrice)
        {
            BuilderMgr.ClickAddAgendaItem();
            BuilderMgr.AGMgr.SetName(StringEnum.GetStringValue(name));
            BuilderMgr.AGMgr.SetTypeWithDefaults(type);
            BuilderMgr.AGMgr.SetConditionalLogic(true, StringEnum.GetStringValue(conditionalParent));

            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.FileUpload ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                BuilderMgr.AGMgr.FeeMgr.SetStandardPrice(standardPrice);
            }

            BuilderMgr.AGMgr.ClickSaveItem();
            this.cfIDs.Add(name, BuilderMgr.AGMgr.GetAgendaItemID(StringEnum.GetStringValue(name)));
        }
コード例 #6
0
        public void AddAgendaItemWithWaitlist(
            AgendaItemManager.AgendaItemType type, 
            string name, 
            int limit, 
            double price)
        {
            BuilderMgr.ClickAddAgendaItem();
            BuilderMgr.AGMgr.SetName(name);
            BuilderMgr.AGMgr.SetTypeWithDefaults(type);
            BuilderMgr.AGMgr.FeeMgr.SetStandardPrice(price);

            // sets waitlist if one of the types below(waitlist only available on these)
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected ||
                type == AgendaItemManager.AgendaItemType.FileUpload)
            {
                BuilderMgr.AGMgr.SetWaitlist(limit);
            }

            BuilderMgr.AGMgr.ClickSaveItem();
        }
コード例 #7
0
        public void VerifyAgendaItemInDatabase(AgendaItemManager.AgendaItemType type, string name)
        {
            //int typeInNetTiersEntity = AgendaItemManager.AgendaItemTypeInNetTiersEntityAttribute.GetTypeInNetTiersEntity(type);
            ////ReloadEvent();

            List<Custom_Field> ai = null;

            ClientDataContext db = new ClientDataContext();
            ai = (from a in db.Custom_Fields where a.LocationId == 0 && a.Description == name && a.TypeId == (int)type orderby a.Id ascending select a).ToList();

            //E.CustomFields ai = Event.CustomFieldsCollection.Find(
            //    delegate(E.CustomFields aiInner)
            //    {
            //        return aiInner.Description == name &&
            //            aiInner.ReportDescription == aiInner.Description &&
            //            aiInner.BadgeCaption == aiInner.Description &&
            //            aiInner.Fieldname == aiInner.Description &&
            //            aiInner.LocationId == (int)E.CustomFieldLocationsList.Agenda &&
            //            aiInner.TypeId == (int)type;
            //    }
            //);

            Assert.That(ai.Count != 0);

            switch (type)
            {
                case AgendaItemManager.AgendaItemType.RadioButton:
                case AgendaItemManager.AgendaItemType.Dropdown:
                    Assert.That(ai.Last().Custom_Field_List_Items != null);
                    break;
                case AgendaItemManager.AgendaItemType.Number:
                case AgendaItemManager.AgendaItemType.OneLineText:
                    Assert.That(ai.Last().Length == ((int)type == 2 ? 50 : 5));
                    break;
                case AgendaItemManager.AgendaItemType.Contribution:
                    Assert.That(ai.Last().MinVarAmount > 0);
                    Assert.That(ai.Last().MaxVarAmount > 0);
                    break;
            }

            // check dates
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                Assert.AreEqual(AgendaItemStartDateTime_Default, ai.Last().SessionDate);
                Assert.AreEqual(AgendaItemEndDateTime_Default, ai.Last().SessionEndDate);
            }

            // check amount
            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.FileUpload ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                Assert.That(ai.Last().Amount > 0);
            }
        }
コード例 #8
0
        public void AddAgendaItemWithPriceAndNoDate(
            AgendaItemManager.AgendaItemType type, 
            string name, 
            double? standardPrice = null)
        {
            ClickAddAgendaItem();
            AGMgr.SetName(name);
            AGMgr.SetTypeWithDefaults(type);

            if (type == AgendaItemManager.AgendaItemType.CheckBox ||
                type == AgendaItemManager.AgendaItemType.RadioButton ||
                type == AgendaItemManager.AgendaItemType.Dropdown ||
                type == AgendaItemManager.AgendaItemType.FileUpload ||
                type == AgendaItemManager.AgendaItemType.AlwaysSelected)
            {
                AGMgr.FeeMgr.SetStandardPrice(standardPrice);
            }

            AGMgr.ClickSaveItem();
            UIUtility.UIUtil.DefaultProvider.WaitForPageToLoad();
        }
コード例 #9
0
 public void AddAgendaItemWithNoPriceNoDate(AgendaItemManager.AgendaItemType type, string name)
 {
     ClickAddAgendaItem();
     AGMgr.SetName(name);
     AGMgr.SetTypeWithDefaults(type);
     AGMgr.ClickSaveItem();
 }