Exemple #1
0
        public DateTime GetMinEnergyTime()
        {
            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Min_Energy_Time", null);

            if (result == null)
            {
                throw new SqlStorageException("Can not select time of min energy.");
            }

            return((DateTime)result);
        }
Exemple #2
0
        public double GetMinEnergy()
        {
            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Min_Energy", null);

            if (result == null)
            {
                throw new SqlStorageException("Can not select min Energy.");
            }

            return((double)result);
        }
Exemple #3
0
        public double GetMinEnergy(DateTime dateTime)
        {
            var parameters = new Dictionary <string, object>();

            parameters.Add("@Date", dateTime);

            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Min_Energy_By_Date", null);

            if (result == null)
            {
                throw new SqlStorageException("Can not select min Energy.");
            }

            return((double)result);
        }
Exemple #4
0
        public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
        {
            var parameters = new Dictionary <string, object>();

            parameters.Add("@StartFrom", startFrom);
            parameters.Add("@EndBy", endBy);

            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Average_Energy_Between_Dates", parameters);

            if (result == null)
            {
                throw new SqlStorageException("Can not select average Energy.");
            }

            return((double)result);
        }
Exemple #5
0
        public double GetMaxEnergy(Coordinates coordinates)
        {
            var parameters = new Dictionary <string, object>();

            parameters.Add("@X", coordinates);
            parameters.Add("@Y", coordinates);

            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Max_Energy_By_Coordinate", null);

            if (result == null)
            {
                throw new SqlStorageException("Can not select max Energy.");
            }

            return((double)result);
        }
Exemple #6
0
        public double GetAverageEnergy(Coordinates rectTopLeft, Coordinates rectBottomRight)
        {
            var parameters = new Dictionary <string, object>();

            parameters.Add("@TopLeftX", rectTopLeft.X);
            parameters.Add("@TopLeftY", rectTopLeft.Y);
            parameters.Add("@BottomRightX", rectBottomRight.X);
            parameters.Add("@BottomRightY", rectBottomRight.Y);

            object result = ADOUtils.ExecuteScalar(_connectionString, "Select_Average_Energy_Between_Coordinates", parameters);

            if (result == null)
            {
                throw new SqlStorageException("Can not select average Energy.");
            }

            return((double)result);
        }