public void TestChangeStatusButton()
        {
            this.registrationIds.Clear();
            this.CreateEventAndRegistration();

            //C.Event evt = C.Event.Get(this.eventID);
            //E.TList<E.Registrations> regs = this.regService.GetByEventId(this.eventID);

            Event evt = new Event();
            List<Registration> regs = new List<Registration>();

            ClientDataContext db = new ClientDataContext();
            regs = (from r in db.Registrations where r.Event_Id == this.eventID orderby r.Register_Id descending select r).ToList();
            evt = (from e in db.Events where e.Id == this.eventID select e).Single();

            int FirstRegID = regs[0].Register_Id;
            int SecondRegID = regs[1].Register_Id;
            ReportMgr.SetRegistrationStatus(FirstRegID, 2, evt);
            ReportMgr.SetRegistrationStatus(SecondRegID, 2, evt);

            // set the reg status to some known value
            ReportMgr.SetRegistrationStatus(FirstRegID, 2, evt);

            // pull up the attendee report
            this.LoginAndGetSessionID();
            ManagerSiteMgr.OpenEventDashboardUrl(this.eventID, this.sessionID);
            ManagerSiteMgr.DashboardMgr.ChooseTab(Managers.Manager.Dashboard.DashboardManager.DashboardTab.EventDetails);
            ManagerSiteMgr.DashboardMgr.OpenAttendeeReportFromEventDashboard();

            // select an attendee
            ReportMgr.SelectAttendeeReportRecord(FirstRegID);

            // click the button
            ReportMgr.ClickChangeStatusButton();

            // select statuses dropdown values and click change
            ReportMgr.ChangeStatus(ReportManager.AttendeeStatus.Confirmed, ReportManager.AttendeeStatus.Approved);

            // click OK on the check in confirmation
            ReportMgr.ClickOKOnChangeStatusConfirmationPopup();
            ReportMgr.ClickOKOnChangeStatusConfirmationPopup();

            ReportMgr.SelectReportPopupWindow();

            // verify attendees are checked in
            ReportMgr.VerifyRegistrationStatusOnAttendeeReport(FirstRegID, ReportManager.AttendeeStatus.Approved);

            // cleanup
            ReportMgr.SetRegistrationStatus(FirstRegID, 2, evt);
            UIUtil.DefaultProvider.CloseWindow();
            UIUtil.DefaultProvider.SelectOriginalWindow();
            this.BackToEventList();
        }
        public void VerifyTransactionDataInDB(string[] TransactionAmount, string[] BillableAmount, string[] addAndModBy, string SharedFeePct, EventType type)
        {
            var db = new DataAccess.ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection);
            var transactions = (from t in db.Transactions where t.RegisterId == regId && t.TypeId == 2 select t).ToList();

            for (int i = 0; i < transactions.Count; i++)
            {
                VerifyTool.VerifyValue(2, transactions[i].TypeId, "Type Id = {0}");
                VerifyTool.VerifyValue(regId, transactions[i].RegisterId, "Register Id = {0}");
                VerifyTool.VerifyValue(TransactionAmount[i], transactions[i].TransAmount.ToString(), "Tansaction Amount = {0}");
                VerifyTool.VerifyValue(GetExchangeRate(eventId), transactions[i].ExchangeRate.ToString(), "Exchange Rate = {0}");

                Event evt = new Event();

                evt = (from e in db.Events where e.Id == eventId select e).Single();

                VerifyTool.VerifyValue(evt.CurrencyCode, transactions[i].CurrencyCode, "Currency Code = {0}");
                VerifyTool.VerifyValue("1", transactions[i].BaseExchangeRate.ToString(), "Base Exchange Rate = {0}");
                VerifyTool.VerifyValue("USD", transactions[i].BaseCurrencyCode, "Base Currency Code = {0}");

                if (i == 0)
                {
                    VerifyTool.VerifyValue(eventId + "-" + regId, transactions[i].TransDoc.ToString(), "Trans Doc = {0}");
                }
                else if (i > 0 && type == EventType.ProEventUpdate)
                {
                    VerifyTool.VerifyValue(eventId + "-" + regId + "-0" + (i), transactions[i].TransDoc.ToString(), "Trans Doc = {0}");
                }
                else
                {
                    VerifyTool.VerifyValue(eventId + "-" + regId + "-0" + i, transactions[i].TransDoc.ToString(), "Trans Doc = {0}");
                }

                // Comment this out: an decryption overflow error happened when trying to decrypt cc number
                ////VerifyTool.VerifyValue(
                ////    TxnIntegrityConstants.ccNumber,
                ////    U.EncryptionTools.ccDecrypt(transactions[i].encryptedccNumber, regId.ToString()),
                ////    "CCnumber = {0}");

                VerifyTool.VerifyValue(TxnIntegrityConstants.ccExpDate, transactions[i].ccExpDate.ToString(), "CC Exp date = {0}");
                VerifyTool.VerifyValue(TxnIntegrityConstants.ccName, transactions[i].ccName, "CC name = {0}");
                VerifyTool.VerifyValue(TxnIntegrityConstants.ccType, transactions[i].ccType, "CC type = {0}");
                VerifyTool.VerifyValue(TxnIntegrityConstants.MerchandId, transactions[i].MerchantId, "Merchant Id = {0}");
                VerifyTool.VerifyValue(addAndModBy[i], transactions[i].Add_By, "Add By = {0}");
                VerifyTool.VerifyValue(addAndModBy[i], transactions[i].Mod_By, "Mod By = {0}");
                VerifyTool.VerifyValue(TxnIntegrityConstants.LastFourCC, transactions[i].last4CCDigits.ToString(), "Last 4 CC digits {0}");
                VerifyTool.VerifyValue(true, transactions[i].authCode != null, "Auth code is not null = {0}");
                VerifyTool.VerifyValue(SharedFeePct, transactions[i].SharedFeePct.ToString(), "Shared Fee Percent = {0}");

                if (type != EventType.Endurance_USD)
                {
                    VerifyTool.VerifyValue(TxnIntegrityConstants.CustomerMerchantId, transactions[i].CustomerMerchantId.ToString(), "Customer Merchand Id = {0}");
                }
                else
                {
                    VerifyTool.VerifyValue(TxnIntegrityConstants.EnduranceCustomerMerchId, transactions[i].CustomerMerchantId.ToString(), "Customer Merchand Id = {0}");
                    VerifyTool.VerifyValue(TxnIntegrityConstants.EnduranceMerchAmount, transactions[i].MerchAmount.ToString(), "Merch Amount = {0}");
                    VerifyTool.VerifyValue(TxnIntegrityConstants.EnduranceNonMerchAmount, transactions[i].NonMerchAmount.ToString(), "Non-Merch Amount = {0}");
                }

                VerifyTool.VerifyValue(BillableAmount[i], transactions[i].BillableAmount.ToString(), "Billable Amount = {0}");
                VerifyTool.VerifyValue(true, transactions[i].GatewayTransactionId != null, "Gateway Transaction Id is not null = {0}");
            }
        }
 partial void DeleteEvent(Event instance);
 partial void UpdateEvent(Event instance);
 partial void InsertEvent(Event instance);
		private void detach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.Event1 = null;
		}
		private void attach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.Event1 = this;
		}
 public void SetRegistrationStatus(int RegisterId, int StatusId, Event evt)
 {
     ClientDataContext db = new ClientDataContext();
     Registration reg = (from r in db.Registrations where r.Event == evt && r.Register_Id == RegisterId select r).Single();
     reg.StatusId = StatusId;
     db.SubmitChanges();
     //C.Registration reg = C.Registration.GetByRegistrationIDEventID(RegisterId, evt);
     //reg.UpdateStatus(RegisterId, (C.RegistrationStatusType)StatusId);
 }