public void AddLatePrice(LatePrice latePrice, FormData.Location location)
        {
            switch (location)
            {
                case FormData.Location.RegType:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddLatePrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePriceTime_Type(latePrice.LatePriceTime);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePriceDate_Type(latePrice.LatePriceDate);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePrice.Type(latePrice.latePrice);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.StandardPrice.Click();
                    break;
                case FormData.Location.Agenda:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddLatePrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePriceTime_Type(latePrice.LatePriceTime);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePriceDate_Type(latePrice.LatePriceDate);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePrice.Type(latePrice.latePrice);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.StandardPrice.Click();
                    break;
                default:
                    break;
            }

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.WaitForAJAX();
            Utility.ThreadSleep(2);
        }
        public void RegistrationMiddlePriceDate()
        {
            Event eventMiddlePrice = new Event("RI-EventMiddlePrice");
            RegType regType = new RegType("First");
            EarlyPrice earlyPrice = new EarlyPrice();
            earlyPrice.earlyPrice = 40;
            earlyPrice.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice.EarlyPriceDate = System.DateTime.Today.AddDays(-2);
            earlyPrice.EarlyPriceTime = System.DateTime.Now;
            LatePrice latePrice = new LatePrice();
            latePrice.latePrice = 60;
            latePrice.LatePriceDate = System.DateTime.Today.AddDays(2);
            latePrice.LatePriceTime = System.DateTime.Now;
            regType.EarlyPrice = earlyPrice;
            regType.LatePrice = latePrice;
            regType.Price = 50;
            eventMiddlePrice.StartPage.RegTypes.Add(regType);
            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            eventMiddlePrice.CheckoutPage.PaymentMethods.Add(paymentMethod);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, eventMiddlePrice);

            Registrant registrant = new Registrant(eventMiddlePrice);
            registrant.EventFee_Response = new EventFeeResponse(eventMiddlePrice.StartPage.RegTypes[0]);
            registrant.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.Checkin(registrant);
            KeywordProvider.RegistrationCreation.PersonalInfo(registrant);

            Assert.True(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation) == regType.Price.Value);

            KeywordProvider.RegistrationCreation.Checkout(registrant);
        }
        public void RegTypeWithFee()
        {
            Event evt = new Event("RI-RegTypeWithFee");

            RegType regType1 = new RegType("EarlyRegistrantsLateDate");
            EarlyPrice earlyPrice1 = new EarlyPrice();
            earlyPrice1.earlyPrice = 40;
            earlyPrice1.EarlyPriceType = FormData.EarlyPriceType.Registrants;
            earlyPrice1.FirstNRegistrants = 1;
            LatePrice latePrice1 = new LatePrice();
            latePrice1.latePrice = 60;
            latePrice1.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice1.LatePriceTime = DateTime.Now;
            regType1.Price = 50;
            regType1.EarlyPrice = earlyPrice1;
            regType1.LatePrice = latePrice1;

            RegType regType2 = new RegType("EarlyLateFeeDCDollar");
            EarlyPrice earlyPrice2 = new EarlyPrice();
            earlyPrice2.earlyPrice = 40;
            earlyPrice2.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice2.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice2.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice2 = new LatePrice();
            latePrice2.latePrice = 60;
            latePrice2.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice2.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode2 = new CustomFieldCode("code2");
            discountCode2.Amount = 5;
            discountCode2.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discountCode2.CodeKind = FormData.ChangeType.FixedAmount;
            discountCode2.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            regType2.Price = 50;
            regType2.EarlyPrice = earlyPrice2;
            regType2.LatePrice = latePrice2;
            regType2.AllCustomCodes.Add(discountCode2);

            RegType regType3 = new RegType("EarlyLateFeeDCPercent");
            EarlyPrice earlyPrice3 = new EarlyPrice();
            earlyPrice3.earlyPrice = 40;
            earlyPrice3.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice3.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice3.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice3 = new LatePrice();
            latePrice3.latePrice = 60;
            latePrice3.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice3.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode3 = new CustomFieldCode("code3");
            discountCode3.Amount = 10;
            discountCode3.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discountCode3.CodeKind = FormData.ChangeType.Percent;
            discountCode3.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            regType3.Price = 50;
            regType3.EarlyPrice = earlyPrice3;
            regType3.LatePrice = latePrice3;
            regType3.AllCustomCodes.Add(discountCode3);

            RegType regType4 = new RegType("EarlyLateFeeDCPositiveDollar");
            EarlyPrice earlyPrice4 = new EarlyPrice();
            earlyPrice4.earlyPrice = 40;
            earlyPrice4.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice4.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice4.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice4 = new LatePrice();
            latePrice4.latePrice = 60;
            latePrice4.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice4.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode4 = new CustomFieldCode("code4");
            discountCode4.Amount = -5;
            discountCode4.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discountCode4.CodeKind = FormData.ChangeType.FixedAmount;
            discountCode4.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            regType4.Price = 50;
            regType4.EarlyPrice = earlyPrice4;
            regType4.LatePrice = latePrice4;
            regType4.AllCustomCodes.Add(discountCode4);

            RegType regType5 = new RegType("EarlyLateFeeDCRequired");
            EarlyPrice earlyPrice5 = new EarlyPrice();
            earlyPrice5.earlyPrice = 40;
            earlyPrice5.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice5.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice5.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice5 = new LatePrice();
            latePrice5.latePrice = 60;
            latePrice5.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice5.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode5 = new CustomFieldCode("code5");
            discountCode5.Amount = 5;
            discountCode5.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discountCode5.CodeKind = FormData.ChangeType.FixedAmount;
            discountCode5.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            regType5.Price = 50;
            regType5.EarlyPrice = earlyPrice5;
            regType5.LatePrice = latePrice5;
            regType5.AllCustomCodes.Add(discountCode5);
            regType5.RequireDC = true;

            RegType regType6 = new RegType("EarlyLateFeeAC");
            EarlyPrice earlyPrice6 = new EarlyPrice();
            earlyPrice6.earlyPrice = 40;
            earlyPrice6.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice6.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice6.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice6 = new LatePrice();
            latePrice6.latePrice = 60;
            latePrice6.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice6.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode6 = new CustomFieldCode("code6");
            discountCode6.CodeType = FormData.CustomFieldCodeType.AccessCode;
            regType6.Price = 50;
            regType6.EarlyPrice = earlyPrice6;
            regType6.LatePrice = latePrice6;
            regType6.AllCustomCodes.Add(discountCode6);

            EarlyPrice earlyPrice7 = new EarlyPrice();
            earlyPrice7.earlyPrice = 40;
            earlyPrice7.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice7.EarlyPriceDate = DateTime.Today.AddDays(-2);
            earlyPrice7.EarlyPriceTime = DateTime.Now;
            LatePrice latePrice7 = new LatePrice();
            latePrice7.latePrice = 60;
            latePrice7.LatePriceDate = DateTime.Today.AddDays(2);
            latePrice7.LatePriceTime = DateTime.Now;
            CustomFieldCode discountCode7 = new CustomFieldCode("code7");
            discountCode7.Amount = 5;
            discountCode7.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discountCode7.CodeKind = FormData.ChangeType.FixedAmount;
            discountCode7.CodeType = FormData.CustomFieldCodeType.DiscountCode;

            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);

            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);
            evt.StartPage.RegTypes.Add(regType3);
            evt.StartPage.RegTypes.Add(regType4);
            evt.StartPage.RegTypes.Add(regType5);
            evt.StartPage.RegTypes.Add(regType6);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);

            Registrant reg1 = new Registrant(evt);
            reg1.EventFee_Response = new EventFeeResponse(regType1);
            reg1.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            Assert.True(reg1.EventFee_Response.RegType.EarlyPrice.earlyPrice.Equals(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation)));

            Registrant reg2 = new Registrant(evt);
            reg2.EventFee_Response = new EventFeeResponse(regType1);
            reg2.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
            Assert.True(reg2.EventFee_Response.RegType.Price.Value.Equals(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation)));

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg2);
            PageObject.PageObjectProvider.Register.RegistationSite.Login.StartNewRegistration_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType2);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType3);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType4);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType5);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.IsPresent);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.DiscountCodeRequired.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType6);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.IsPresent);
        }