Ejemplo n.º 1
0
        public SaleCustomerController()
        {
            string connectionString = "Server=tcp:lasmargaritas.database.windows.net,1433;Initial Catalog=LasMargaritasDBDev;Persist Security Info=False;User ID=LasMargaritasDbUser;Password=LasMargaritasPassw0rd!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;";

            if (ConfigurationManager.ConnectionStrings["LasMargaritasDb"] != null)
            {
                connectionString = ConfigurationManager.ConnectionStrings["LasMargaritasDb"].ConnectionString;
            }
            saleCustomerBL = new SaleCustomerBL(connectionString);
        }
Ejemplo n.º 2
0
        private static void MigrateSaleCustomers()
        {
            List <string>       exceptions = new List <string>();
            List <SaleCustomer> customers  = SaleCustomerOld.GetSaleCustomer();
            SaleCustomerBL      customerBL = new SaleCustomerBL(connectionString);

            foreach (SaleCustomer customer in customers)
            {
                try
                {
                    customerBL.InsertSaleCustomer(customer);
                }
                catch (Exception ex)
                {
                    exceptions.Add(customer.Name + ". Error " + ex.Message);
                }
            }
            foreach (string ex in exceptions)
            {
                Console.WriteLine(ex);
            }
            Console.ReadLine();
        }