private void GasManagementDataMappingToEntity(IDivePlanSetupViewModel divePlanViewModel) { _divePlanEntityModel.CylinderPressure = divePlanViewModel.GasManagement.CylinderPressure; _divePlanEntityModel.CylinderVolume = divePlanViewModel.GasManagement.CylinderVolume; _divePlanEntityModel.GasRemaining = divePlanViewModel.GasManagement.GasRemaining; _divePlanEntityModel.GasUsedForStep = divePlanViewModel.GasManagement.GasUsedForStep; _divePlanEntityModel.InitialCylinderTotalVolume = divePlanViewModel.GasManagement.InitialCylinderTotalVolume; _divePlanEntityModel.SacRate = divePlanViewModel.GasManagement.SacRate; }
public DivePlanEntityModel ModelToEntity(IDivePlanSetupViewModel divePlanViewModel) { DiveModelSelectorDataMappingToEntity(divePlanViewModel); DiveStepDataMappingToEntity(divePlanViewModel); GasManagementDataMappingToEntity(divePlanViewModel); GasMixtureDataMappingToEntity(divePlanViewModel); return(_divePlanEntityModel); }
private void GasMixtureDataMappingToEntity(IDivePlanSetupViewModel divePlanViewModel) { _divePlanEntityModel.MaximumOperatingDepth = divePlanViewModel.GasMixture.MaximumOperatingDepth; _divePlanEntityModel.NewGasMixtureGasName = divePlanViewModel.GasMixture.NewGasMixture.GasName; _divePlanEntityModel.NewGasMixtureHelium = divePlanViewModel.GasMixture.NewGasMixture.Helium; _divePlanEntityModel.NewGasMixtureNitrogen = divePlanViewModel.GasMixture.NewGasMixture.Nitrogen; _divePlanEntityModel.NewGasMixtureOxygen = divePlanViewModel.GasMixture.NewGasMixture.Oxygen; _divePlanEntityModel.SelectedGasMixtureGasName = divePlanViewModel.GasMixture.SelectedGasMixture.GasName; _divePlanEntityModel.SelectedGasMixtureHelium = divePlanViewModel.GasMixture.SelectedGasMixture.Helium; _divePlanEntityModel.SelectedGasMixtureNitrogen = divePlanViewModel.GasMixture.SelectedGasMixture.Nitrogen; _divePlanEntityModel.SelectedGasMixtureOxygen = divePlanViewModel.GasMixture.SelectedGasMixture.Oxygen; //TODO AH may have to do a linq statement to get each gas mix index based on each name or redesign this! foreach (var gasMixture in divePlanViewModel.GasMixture.GasMixtures) { _divePlanEntityModel.GasName.Add(gasMixture.GasName); _divePlanEntityModel.Helium.Add(gasMixture.Helium); _divePlanEntityModel.Nitrogen.Add(gasMixture.Nitrogen); _divePlanEntityModel.Oxygen.Add(gasMixture.Oxygen); } }
private void DiveStepDataMappingToEntity(IDivePlanSetupViewModel divePlanViewModel) { _divePlanEntityModel.Depth = divePlanViewModel.DiveStep.Depth; _divePlanEntityModel.Time = divePlanViewModel.DiveStep.Time; }
private void DiveModelSelectorDataMappingToEntity(IDivePlanSetupViewModel divePlanViewModel) { _divePlanEntityModel.SelectedDiveModel = divePlanViewModel.DiveModelSelector.SelectedDiveModel; }