示例#1
0
        protected override UnitConversion DataRowToEntity(System.Data.DataRow row)
        {
            var entity = new UnitConversion
            {
                Id               = Convert.ToInt64(row["ConversionID"]),
                FromUnit         = _unitsRepository.GetByKey(row["FromUnitsID"]),
                ToUnit           = _unitsRepository.GetByKey(row["ToUnitsID"]),
                ConversionFactor = Convert.ToDouble(row["ConversionFactor"]),
                Offset           = Convert.ToDouble(row["Offset"]),
            };

            return(entity);
        }
示例#2
0
        protected override OffsetType DataRowToEntity(DataRow row)
        {
            var entity = new OffsetType
            {
                Id          = Convert.ToInt64(row["OffsetTypeID"]),
                Description = Convert.ToString(row["OffsetDescription"]),
                Unit        = _unitsRepository.GetByKey(Convert.ToInt64(row["OffsetUnitsID"]))
            };

            return(entity);
        }
示例#3
0
        /// <summary>
        /// This function gets the variable information.
        /// </summary>
        private Variable getVariablesParameters(int variableID)
        {
            Variable variable = new Variable();

            variable.Code          = "CrwrAggregation:" + OutputResultName.Text;
            variable.Name          = VariableList.Text;
            variable.Speciation    = "Unknown";
            variable.SampleMedium  = "Not Relevant";
            variable.ValueType     = "Derived Value";
            variable.IsRegular     = false;
            variable.IsCategorical = false;
            //variable.TimeSupport = 0.0;
            variable.DataType        = "Average";
            variable.GeneralCategory = "Unknown";
            variable.NoDataValue     = -9999;
            int timesUnitsID = getTimeUnitsID(variableID);

            variable.TimeUnit = UnitsRepository.GetByKey(timesUnitsID);
            int variableUnitsID = getVariableUnitsID(variableID);

            variable.VariableUnit = UnitsRepository.GetByKey(variableUnitsID);

            return(variable);
        }