Пример #1
0
        //true <=, false >=
        private List<int> CheckDate(List<string> dateArray, DateTime periodDate, bool reverseDirection)
        {
            List<int> returnArray = new List<int>();
            DateTime dateTime = new DateTime();
            DDDClass.TimeReal timeReal;
            int index = 0;

            foreach (string record in dateArray)
            {
                timeReal = new DDDClass.TimeReal(record);
                dateTime = timeReal.getTimeRealDate();

                if (reverseDirection == false)
                {
                    if (dateTime.Date >= periodDate.Date)
                        returnArray.Add(index);
                }
                else
                {
                    if (dateTime.Date <= periodDate.Date)
                        returnArray.Add(index);
                }
                index++;
            }
            return returnArray;
        }
Пример #2
0
        public DDDClass.TimeReal Get_VehicleOverview_CurrentDateTime(int dataBlockId)
        {
            SQLDB_Records sqldbRecords = new SQLDB_Records(connectionString, sqlDB.GETMYSQLCONNECTION());
            long timeRealSeconds = sqldbRecords.Get_VOverview_CurrentDateTime(dataBlockId);
            DDDClass.TimeReal CurrentDateTime = new DDDClass.TimeReal(timeRealSeconds);

            return CurrentDateTime;
        }
Пример #3
0
        //Это не вся информация. Есть еще, смотреть CardUnit.CardUnitClass - нет информации в картах для отладки.
        public List<DateTime> Get_StartEndPeriod(int dataBlockId)
        {
            SQLDB_Records sqldbRecords = new SQLDB_Records(connectionString, sqlDB.GETMYSQLCONNECTION());
            string paramName = "ef_driver_activity_data.activityDailyRecords";
            string currentParamName;
            List<DateTime> returnPeriod = new List<DateTime>();
            List<string> activityRecordDate = new List<string>();

            currentParamName = paramName + ".activityRecordDate";
            activityRecordDate = sqldbRecords.Get_AllParamsArray(dataBlockId, currentParamName);
            DateTime date;
            if (activityRecordDate.Count > 0)
            {
                date = new DateTime();
                date = new DDDClass.TimeReal(activityRecordDate[0]).getTimeRealDate();
                returnPeriod.Add(date);
                date = new DDDClass.TimeReal(activityRecordDate[activityRecordDate.Count - 1]).getTimeRealDate();
                returnPeriod.Add(date);
            }
            else
            {
                date = new DateTime();
                returnPeriod.Add(date);
                date = new DateTime();
                returnPeriod.Add(date);
            }
            return returnPeriod;
        }
Пример #4
0
        //Vehicle_Activities
        public List<DDDClass.TimeReal> Get_VehicleActivities_DownloadedDayDate(int dataBlockId)
        {
            SQLDB_Records sqldbRecords = new SQLDB_Records(connectionString, sqlDB.GETMYSQLCONNECTION());
            string paramName;
            DDDClass.TimeReal downloadedDayDate = new DDDClass.TimeReal();
            List<DDDClass.TimeReal> downloadedDayDateList = new List<DDDClass.TimeReal>();
            List<string> downloadedDayDateStringList = new List<string>();

            paramName = "vehicleActivities.downloadedDayDate";
            downloadedDayDateStringList = sqldbRecords.Get_AllParamsArray(dataBlockId, paramName);

            for (int i = 0; i < downloadedDayDateStringList.Count; i++)
            {
                downloadedDayDate = new DDDClass.TimeReal(Convert.ToInt64(downloadedDayDateStringList[i]));
                downloadedDayDateList.Add(downloadedDayDate);
            }

            return downloadedDayDateList;
        }