//Проверить функции //////////////////////Statistics//////////////////////////// public double Statistics_GetYearStatistics(DateTime date, int datablockId) { double stat = 0; int minutesInDay = 1440; int dayInYear = GetDaysInAYear(date.Year); VehichleUnit.VehicleUnitClass vehicleUnitClass = new VehichleUnit.VehicleUnitClass(); vehicleUnitClass.vehicleActivities = Get_VehicleActivities_AllInOne(datablockId, new DateTime(date.Year, 1, 1), new DateTime(date.Year, 12, DateTime.DaysInMonth(date.Year, 12))); stat = (vehicleUnitClass.GetTotalVehicleActivitiesTime().TotalMinutes / (minutesInDay * dayInYear)) * 100; return stat; }
//Проверить функции activities.GetTotalTime() - писалась давно, может не точно подсчитывать! public double Statistics_GetMonthStatistics(DateTime date, int datablockId) { SQLDB_Records sqldbRecords = new SQLDB_Records(connectionString, sqlDB.GETMYSQLCONNECTION()); double stat = 0; int minutesInDay = 1440; int dayInMonth = DateTime.DaysInMonth(date.Year, date.Month); VehichleUnit.VehicleUnitClass vehicleUnitClass = new VehichleUnit.VehicleUnitClass(); vehicleUnitClass.vehicleActivities = Get_VehicleActivities_AllInOne(datablockId, new DateTime(date.Year, date.Month, 1), new DateTime(date.Year, date.Month, dayInMonth)); stat = (vehicleUnitClass.GetTotalVehicleActivitiesTime().TotalMinutes / (minutesInDay * dayInMonth)) * 100; return stat; }