コード例 #1
0
ファイル: Adapting.cs プロジェクト: aviadbi1/RoadScholar
        public static MeasurementData getMeasurementAsData(Measurement measurement)
        {
            MeasurementData mData = new MeasurementData();
            mData.ActivityName = measurement.ActivityName;
            mData.expID = measurement.expID;
            mData.id = measurement.id;
            mData.isMainActivity = measurement.isMainActivity;
            mData.RoomId = measurement.RoomId;

            mData.NumOfMeasures = measurement.NumOfMeasures;
            mData.DifferenceBetweenMeasures = measurement.DifferenceBetweenMeasures;
            mData.NumOfParametersToMeasure = measurement.NumOfParametersToMeasure;
            mData.WindowOpenTimeSeconds = measurement.WindowOpenTimeSeconds;

            if (measurement.measurementInstructions != null)
            {
                foreach (MeasureInstruction mi in measurement.measurementInstructions)
                {
                    mData.measurementInstructions.Add(getMeasureInstructionAsData(mi));
                }
            }

            return mData;
        }
コード例 #2
0
 public ActionResult EditMeasurement(Measurement measurement)
 {
     ExperimentData experimentData = (ExperimentData)rsContext.getActivity(measurement.expID);
     MeasurementData measurementData = Adapting.getMeasurementAsData(measurement);
     measurementData.RoomId = 0;
     experimentData.addStep(measurementData);
     rsContext.SaveChanges();
     return RedirectToAction("AddInstructionsForMeasures", new { MeasurementID = measurementData.id, NumOfParametersToMeasure = measurementData.NumOfParametersToMeasure });
 }