コード例 #1
0
        public void AddGoCompare(string fileLocationHome, string fileLocationQuote)
        {
            //declare classes
            FileCorrect cm     = new FileCorrect();
            OpenExcelDB openDB = new OpenExcelDB();

            ExcelUnprotect eu = new ExcelUnprotect();

            eu.UnprotectExcelFile(fileLocationHome);
            eu.UnprotectExcelFile(fileLocationQuote);

            cm.FileDateCorrect(fileLocationHome);
            cm.FileDateCorrect(fileLocationQuote);


            var ConnectionString    = openDB.ConnectionString(fileLocationHome);
            var ConnectionStringTwo = openDB.ConnectionString(fileLocationQuote);

            DailyPerformanceReportDbEntities1 db = new DailyPerformanceReportDbEntities1();

            var quoteSource  = "Go Compare";
            var days         = db.GetEntryDates(quoteSource).FirstOrDefault().Value;
            var daysToGoBack = Convert.ToInt32(days);

            do
            //var daysPast = DateTime.Now.AddDays(-i).ToString();

            {
                var      daysPast    = Convert.ToString(DateTime.Now.AddDays(-days).Date.ToOADate());
                var      daysPastAlt = DateTime.Now.AddDays(-days).ToString("ddd, dd MMM yyyy");
                DateTime daysPastdb  = DateTime.Now.AddDays(-days).Date;
                --days;
                AddGoCompareToDb(ConnectionString, ConnectionStringTwo, daysPast, daysPastAlt, daysPastdb);
            }while (days > 0);
        }
コード例 #2
0
        public void AddMoneySupermarket(string fileLocation)
        {
            //declare classes
            FileCorrect cm     = new FileCorrect();
            OpenExcelDB openDB = new OpenExcelDB();

            cm.FileDateCorrect(fileLocation);
            var ConnectionString = openDB.ConnectionString(fileLocation);

            DailyPerformanceReportDbEntities1 db = new DailyPerformanceReportDbEntities1();

            var quoteSource = "Money Supermarket";

            var days = db.GetEntryDates(quoteSource).FirstOrDefault().Value;

            var daysToGoBack = Convert.ToInt32(days);

            do
            //var daysPast = DateTime.Now.AddDays(-i).ToString("ddd, dd MMM yyyy");

            {
                var      daysPast   = DateTime.Now.AddDays(-daysToGoBack).ToString("yyyy.MM.dd");
                DateTime daysPastdb = DateTime.Now.AddDays(-daysToGoBack).Date;
                --daysToGoBack;
                AddMSToDb(daysPast, daysPastdb, ConnectionString);
            }while (daysToGoBack > 1);
        }