public async Task Handle(string request) { //string sC = "data source=QHB-CRMDB001.centralservices.local;initial catalog=eInsightCRM_OceanProperties_QA;uid=eInsightCRM_eContact_OceanProperties;pwd=Tv3CxdZwA%9;MultipleActiveResultSets=True"; //string dC = "data source=localhost;initial catalog=eInsightCRM_AMResorts_QA;uid=sa;pwd=123456;MultipleActiveResultSets=True"; //string dT = "dbo.D_Customer"; //string sql = "SELECT TOP 20 CustomerID, FirstName, LastName, Email, PropertyCode, InsertDate, SourceID, AddressStatus, DedupeCheck, AllowEMail, Report_Flag, UNIFOCUS_SCORE FROM dbo.D_Customer with(Nolock);"; //string sql1 = "SELECT TOP 20 CustomerID, FirstName, LastName, Email, PropertyCode, InsertDate, SourceID, AddressStatus, DedupeCheck, AllowEMail, Report_Flag, UNIFOCUS_SCORE FROM dbo.D_Customer_03092017 with(Nolock);"; //List<Dictionary<string,string>> SQL_GetDataFromPMS_SpecialRequestsList = SQLHelper.GetDbValues(sC, "SQL_GetDataFromPMS_SpecialRequests", sql, null); //new DataFlowTask<D_Customer>().runTask(sC, dC, dT, sql, true, true, new List<string>() { "FirstName", "LastName" }, new List<string>() { "CustomerID", "FirstName", "LastName", "Email", "PropertyCode", "InsertDate", "SourceID", "AddressStatus", "DedupeCheck", "AllowEMail", "Report_Flag", "UNIFOCUS_SCORE" }); // new DataFlowTask<D_Customer>().runTask1<D_Customer, D_Customer, D_Customer>(sC, dC, dT, sql, sql1, true, true, new List<string>() { "FirstName"}, new List<string>() { "CustomerID", "FirstName", "LastName", "Email", "PropertyCode", "InsertDate", "SourceID", "AddressStatus", "DedupeCheck", "AllowEMail", "Report_Flag", "UNIFOCUS_SCORE" }); try { string eContactLogConnectionString = System.Configuration.ConfigurationManager.AppSettings["econtact-log-db-sql"]; ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString(eContactLogConnectionString)); CreateLogTablesTask.CreateLog(); StartLoadProcessTask.Start("Process 1", "Start Message 1", "ETL"); var settings = JsonConvert.DeserializeObject <Dictionary <string, object> >(request); ControlFlow.STAGE = "0"; eContactDBManager.GetCompanySetting(settings); ControlFlow.SetLoggingDatabase(new SqlConnectionManager(eContactLogConnectionString)); //Customer CustomerTask CT = new CustomerTask(); CT.Start(); } catch (Exception ex) { ControlFlow.STAGE = "0"; new LogTask() { Message = $"Exception({ex.Message}) Occurred. Task Stopped!", ActionType = "Stop" }.Info(); NLog.LogManager.GetCurrentClassLogger().Fatal(ex); } //Console.WriteLine("Starting ControlFlow example"); //ControlFlowTasks cft = new ControlFlowTasks(); //cft.Start(); //Console.WriteLine("ControlFlow finished..."); //Console.WriteLine("Start Logging example"); //Logging log = new Logging(); //log.Start(); //Console.WriteLine("Logging finished..."); //Console.WriteLine("Starting DataFlow example"); //DataFlowTasks dft = new DataFlowTasks(); //dft.Preparation(); //dft.Start(); //Console.WriteLine("Dafaflow finished..."); //Console.WriteLine("Press any key to continue..."); //Console.ReadLine(); }
public static void TestInit(TestContext testContext) { var cs = new ConnectionString(testContext?.Properties["connectionString"].ToString()); var masterConnection = new SqlConnectionManager(cs.GetMasterConnection()); ControlFlow.SetLoggingDatabase(masterConnection); SQLiteConnectionManager con = new SQLiteConnectionManager(new SQLiteConnectionString(testContext?.Properties["sqliteConnectionString"].ToString())); ControlFlow.CurrentDbConnection = con; }
internal static void RecreateDatabase(string dbName, string connectionString) { var cs = new ConnectionString(connectionString); var masterConnection = new SqlConnectionManager(cs.GetMasterConnection()); ControlFlow.SetLoggingDatabase(masterConnection); new DropDatabaseTask(dbName) { DisableLogging = true, ConnectionManager = masterConnection }.Execute(); new CreateDatabaseTask(dbName, RecoveryModel.Simple, "Latin1_General_CS_AS") { DisableLogging = true, ConnectionManager = masterConnection }.Execute(); ControlFlow.SetLoggingDatabase(new SqlConnectionManager(cs)); }
internal static void RecreateDatabase(TestContext testContext) { string dbName = testContext.Properties["dbName"].ToString(); var connectionString = new ConnectionString(testContext.Properties["connectionString"].ToString()); var masterConnection = new SqlConnectionManager(connectionString.GetMasterConnection()); ControlFlow.SetLoggingDatabase(masterConnection); new DropDatabaseTask(dbName) { DisableLogging = true, ConnectionManager = masterConnection }.Execute(); new CreateDatabaseTask(dbName, RecoveryModel.Simple, "Latin1_General_CS_AS") { DisableLogging = true, ConnectionManager = masterConnection }.Execute(); ControlFlow.SetLoggingDatabase(new SqlConnectionManager(connectionString)); }
public LoggingDatabaseFixture() { DatabaseHelper.RecreateSqlDatabase("Logging"); ControlFlow.SetLoggingDatabase(Config.SqlConnectionManager("Logging")); }
public OtherDBFixture() { DatabaseHelper.RecreateDatabase(Config.SqlConnectionString("NoLog").DBName, Config.SqlConnectionString("Logging")); ControlFlow.SetLoggingDatabase(Config.SqlConnectionManager("NoLog")); }