public void ChangeAllRegsToTestAndDelete(int eventId) { var db = new ClientDataContext(); int rowsAffected; string command = string.Format("UPDATE Registrations SET Test = 1 WHERE Event_Id = {0}", eventId); rowsAffected = db.ExecuteCommand(command); command = string.Format("DELETE FROM Registrations WHERE Event_Id={0}", eventId); db.ExecuteCommand(command); }
public void DeleteRegistrationSession(List<string> registrationSessionIds) { var db = new ClientDataContext(); // Step #1: delete those registrations' sessions from clientDB foreach (string sessionId in registrationSessionIds) { string command = string.Format("delete Sessions where Id ='{0}'", sessionId); db.ExecuteCommand(command); } // Step #2: execute stored procedure 'IncompleteRegistrationsCleanup' string cleanupCommand = "Exec IncompleteRegistrationsCleanup"; db.ExecuteCommand(cleanupCommand); }
public static void ApprovedXAuthRoleForCustomer(int customerId, bool isApproved) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); string command = string.Format( "update XAuthConfiguration set approved='{0}' where CustomerId={1}", isApproved, customerId); db.ExecuteCommand(command); }
public static void SetLiveRegToTest(List<int> eventIds) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); StringBuilder command = new StringBuilder("update Registrations set Test = 1 where Event_Id in ("); foreach (int id in eventIds) { command.Append(string.Format("{0},", id.ToString())); } command.Replace(',', ')', command.Length - 1, 1); db.ExecuteCommand(command.ToString()); }
public void ClearPreviousInvoiceData() { var db = new DataAccess.ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ROMasterConnection); int rowsAffected; string Command = string.Format( "DELETE FROM ct FROM dbo.CustomerTransactions ct INNER JOIN dbo.CustomerInvoices ci ON ci.EndDate = ct.TransDate AND ci.EndDate BETWEEN '{0}' AND '{1}'", new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(-1), DateTimeTool.LastDayOfMonth(DateTime.Now)); rowsAffected = db.ExecuteCommand(Command); Command = string.Format( "DELETE FROM ci FROM dbo.CustomerInvoiceItems cii INNER JOIN dbo.CustomerInvoices ci ON ci.Id = cii.InvoiceId WHERE ci.InvoiceDate BETWEEN '{0}' AND '{1}'", new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(-1), DateTimeTool.LastDayOfMonth(DateTime.Now)); rowsAffected = db.ExecuteCommand(Command); Command = string.Format( "DELETE FROM dbo.CustomerInvoices WHERE InvoiceDate BETWEEN '{0}' AND '{1}'", new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(-1), DateTimeTool.LastDayOfMonth(DateTime.Now)); rowsAffected = db.ExecuteCommand(Command); Command = string.Format( @"UPDATE [VSQL2.RegOnline.com\vsql2].ROWarehouse.dbo.ALLDATES SET BUILDSTATUS = 0 WHERE DAYNOW <= '{0}' AND DAYNOW >= '{1}'", DateTime.Now, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(-1)); rowsAffected = db.ExecuteCommand(Command); }
public void RemoveLiveXAuthEventForCustomer() { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("update EventRegTypes set xauthenabled=0 where xauthenabled=1 and eventid in (select id from events where customer_id=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + ")"); }
public void ApprovedXAuthRoleForCustomer(bool isApproved) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("update XAuthConfiguration set approved='" + isApproved + "' where CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id); }
public void RemoveXAuthTestRegisterAndAttendeeForCustomer() { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("UPDATE Registrations Set GroupId=Register_Id,ResourceGroupId=Register_Id WHERE GroupId in (SELECT Registrations.Register_Id FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE IsXAuth=1 AND CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + ")) OR ResourceGroupId in (SELECT Registrations.Register_Id FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE IsXAuth=1 AND CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + "))"); db.ExecuteCommand("DELETE FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE IsXAuth=1 AND CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + ")"); db.ExecuteCommand("DELETE FROM Attendees WHERE IsXAuth=1 AND CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id); }
public void RemoveXAuthRoleForCustomer() { RemoveLiveXAuthEventForCustomer(); var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("update Attendees set IsXAuth=0 where IsXAuth=1 and CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id); db.ExecuteCommand("delete from XAuthConfiguration where CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id); }
public void RemoveTestRegisterAndAttendeeByCustomerIdEmail(string email) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("UPDATE Registrations Set GroupId=Register_Id,ResourceGroupId=Register_Id WHERE GroupId in (SELECT Registrations.Register_Id FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + " AND Email_Address='" + email + "')) OR ResourceGroupId in (SELECT Registrations.Register_Id FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + " AND Email_Address='" + email + "'))"); db.ExecuteCommand("UPDATE Registrations SET GroupId = 0 WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + " AND Email_Address='" + email + "')"); db.ExecuteCommand("DELETE FROM Registrations WHERE Attendee_Id IN (SELECT id FROM Attendees WHERE CustomerId= " + ConfigReader.DefaultProvider.AccountConfiguration.Id + " AND Email_Address='" + email + "')"); db.ExecuteCommand("DELETE FROM Attendees WHERE CustomerId=" + ConfigReader.DefaultProvider.AccountConfiguration.Id + " AND Email_Address='" + email + "'"); }
/// <summary> /// Make the transactions for this registrant, the start of yesterday, so the Void button goes away /// </summary> /// <param name="registrationId"></param> public void PullBackTransaction(int registrationId) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand(string.Format("update Transactions set transdate='{0}' where RegisterId={1}", DateTime.Today.AddDays(-1).ToString("MM/dd/yyyy"), registrationId)); }
private void PrepareEventForPublishing() { ManagerSiteMgr.OpenLogin(); ManagerSiteMgr.Login(); ManagerSiteMgr.SelectFolder(); ManagerSiteMgr.DeleteEventByName(EventNameForPublishing); // Create event ManagerSiteMgr.ClickAddEvent(Managers.Manager.ManagerSiteManager.EventType.ProEvent); this.eventId = BuilderMgr.GetEventId(); BuilderMgr.SetEventNameAndShortcut(EventNameForPublishing); DateTime newStartDate = DateTime.Now.AddDays(60); DateTime newEndDate = DateTime.Now.AddDays(70); BuilderMgr.SetStartDate(newStartDate); BuilderMgr.SetEndDate(newEndDate); BuilderMgr.SaveAndClose(); // Activate event ManagerSiteMgr.OpenEventDashboard(this.eventId); ManagerSiteMgr.DashboardMgr.ClickManagerActivateEventButton(); ManagerSiteMgr.DashboardMgr.SelectActivateEventFrame(); ManagerSiteMgr.DashboardMgr.ActivateEventMgr.ActivateEvent(); ManagerSiteMgr.DashboardMgr.ChooseTab(DashboardManager.DashboardTab.EventDetails); // Return to event list, so that browser will not go to dashboard(after login) directly when running other tests next ManagerSiteMgr.DashboardMgr.ReturnToList(); // Publish event ClientDataContext db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); string command = "Exec SAV_EventPublicizeData " + "{0}," + //@eventId int, "{1}," + //@Title nvarchar(510), "{2}," + //@StartDate datetime, "{3}," + //@EndDate datetime = null, "{4}," + //@Description nvarchar(max), "{5}," + //@Keywords nvarchar(50), "{6}," + //@Price money = null, "{7}," + //@EventfulCategory1 nvarchar(20), "{8}," + //@EventfulCategory2 nvarchar(20), "{9}," + //@UpcomingCategory nvarchar(20), "{10}," + //@VenueName nvarchar(100), "{11}," + //@VenueDescription nvarchar(500), "{12}," + //@Country varchar(10), "{13}," + //@Address nvarchar(200), "{14}," + //@City nvarchar(200), "{15}," + //@State nvarchar(100), "{16}," + //@Zip varchar(20), "{17}," + //@VenueURL nvarchar(255), "{18}," + //@VenueImage nvarchar(50) = null, "{19}," + //@EventfulVenueId varchar(50), "{20}," + //@UpcomingVenueId varchar(50), "{21}," + //@MediaTypeID int = 0, "{22}"; //@ChannelID int = 0 object[] parameters = new object[] { this.eventId, //@eventId int, "ParkRunning", //@Title nvarchar(510), newStartDate, //@StartDate datetime, newEndDate, //@EndDate datetime = null, "PublishTesting", //@Description nvarchar(max), "Running", //@Keywords nvarchar(50), EventFee, //@Price money = null, "outdoors_recreation", //@EventfulCategory1 nvarchar(20), "clubs_associations", //@EventfulCategory2 nvarchar(20), "8", //@UpcomingCategory nvarchar(20), "Scott Carpenter Park",//@VenueName nvarchar(100), "Scott Carpenter Park is located on the southwest corner of 30th St & Arapahoe. Onsite parking is first come first serve.",//@VenueDescription nvarchar(500), "US", //@Country varchar(10), "30th and Arapahoe", //@Address nvarchar(200), FormDetailManager.StartPageDefaultInfo.City,//@City nvarchar(200), FormDetailManager.StartPageDefaultInfo.State,//@State nvarchar(100), FormDetailManager.StartPageDefaultInfo.ZipCode,//@Zip varchar(20), ConfigReader.DefaultProvider.AccountConfiguration.BaseUrl, //@VenueURL nvarchar(255), "", //@VenueImage nvarchar(50) = null, "V0-001-000268888-3", //@EventfulVenueId varchar(50), "21662", //@UpcomingVenueId varchar(50), 0, //@MediaTypeID int = 0, 0 //@ChannelID int = 0 }; db.ExecuteCommand(command, parameters); }
public static void SetLiveRegToTest(int eventId) { var db = new ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection); db.ExecuteCommand("update Registrations set Test = 1 where Event_Id = " + eventId); }
public void RemoveXAuthLiveRegistration(int accountId) { var db = new ClientDataContext(); int rowsAffected; string command = string.Format("update Registrations set Test=1 " +"from Registrations r " +"inner join Events e on r.Event_Id=e.Id " +"inner join event_statuses es on e.StatusId=es.Id " +"inner join EventRegTypes ert on ert.Id=r.RegTypeId and r.Event_Id=ert.EventId " +"where e.Customer_Id={0} and r.Test=0", accountId); rowsAffected = db.ExecuteCommand(command); }
public int HideEventsInDeletedFolder(int customerId) { var db = new ClientDataContext(); string command = string.Format( "DELETE NodesCustom WHERE (CustomerID={0} AND ParentNodeCustomID=-3) OR (EventID IN (SELECT Id FROM Events WHERE Customer_Id={0} AND Deleted=1))", customerId); return db.ExecuteCommand(command); }