Beispiel #1
0
        private bool insertToDatabase(string filename) {
            ExcelSheet sheet = new ExcelSheet();
            sheet.open(filename);

            if (!sheet.isOpen()) return false;
            DataSet dsCountry = CountriesDataAccess.getAsDataset();
            DataSet dsRates = sheet.getDataSet();
            DateTime startDate = getDateFromName(sheet.getName());
            DateTime endDate = new DateTime(3015,1,1);//FIXME hardcoded end date
            DateTime capDate = startDate.AddSeconds(-1);
            
            Hashtable hCountry = CreateIndexHashtable(dsCountry.Tables[0]);


            ServicesDataAccess.capEndDate(capDate);

            for (int i = 0; i < sheet.getTabCount(); i++)
            {
                int st = Environment.TickCount;
                insertSheet(dsRates, hCountry, i, startDate, endDate);
                Debug.WriteLine("insertSheet took:{0}ms", Environment.TickCount - st);
            }

            return true;
        }
Beispiel #2
0
        private bool insertToDatabase(string filename)
        {
            ExcelSheet sheet = new ExcelSheet();
            sheet.open(filename);

            if (!sheet.isOpen()) return false;

            DataRowCollection CallsData = sheet.getDataSet().Tables[0].Rows;
            try
            {
                DateTime.FromOADate((double)CallsData[0][5]);
                return FillToDataBaseOA(CallsData);
            }
            catch { return FillToDataBase(CallsData); }
     
        }