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); }
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); }
/// <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); }