Пример #1
0
        public bool CreateDate(IDateOrder dateorder)
        {
            try
            {
                //get date column name from settings
                string dateColName = Settings.Default.TimeStampName;

                //create object to build date list
                IProcessDateTime process    = new ProcessDate(_data);
                List <DateTime>  newdateCol = process.BuildDateTimeList(dateorder);
                //add
                if (Utils.AddColtoDataTable <DateTime>(dateColName, newdateCol, _data))
                {
                    DataColumn dc = _data.Columns[dateColName];
                    _dateIndex = dc.Ordinal;
                    _columns.Add(new SessionColumn(dc.Ordinal, dc.ColumnName));
                    this[dateColName].ColumnType = SessionColumnType.DateTime;
                    _dateStatus = DataSetDateStatus.Found;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        private void ProcessDate()
        {
            IProcessDateTime process = new ProcessDate(_data);

            _dateStatus = process.FindDateTimeColumn(out _dateIndex);

            //overwrite date col name
            _data.Columns[_dateIndex].ColumnName = Settings.Default.TimeStampName;
            _columns[_dateIndex].ColName         = Settings.Default.TimeStampName;

            IDateTimeSequence sequence = new DateTimeSequence(_data, _dateIndex);

            if (_dateStatus == DataSetDateStatus.Found)
            {
                List <DateTime> datesequence = sequence.GetExistingSequence();
                DataSetStart = datesequence.Min();
                DataSetEnd   = datesequence.Max();
                //MessageBox.Show(DataSetStart + " " + DataSetEnd );
                try
                {
                    DataPrep prep = new DataPrep(_data, _dateIndex);
                    prep.FillMissingdates(sequence.GetMissingTimeStamps());
                }
                catch (OutOfMemoryException)
                {
                    MessageBox.Show("ran out of memory processing dates. the file is too large.");
                }
            }
        }
Пример #3
0
        private void ProcessDate()
        {
            IProcessDateTime process = new ProcessDate(_data);

            _dateStatus = process.FindDateTimeColumn(out _dateIndex);

            //overwrite date col name
            _data.Columns[_dateIndex].ColumnName = Settings.Default.TimeStampName;
            _columns[_dateIndex].ColName         = Settings.Default.TimeStampName;
            IDateTimeSequence sequence = new DateTimeSequence(_data, _dateIndex);

            if (_dateStatus == DataSetDateStatus.Found)
            {
                List <DateTime> datesequence = sequence.GetExistingSequence();
                DataSetStart = datesequence.Min();
                DataSetEnd   = datesequence.Max();
            }
        }