public SingleSegmentNewSurveyVm(Segment segment, RoadSurvey roadSurvey) { Survey = new SegmentSurvey(roadSurvey, segment); if (Windows.Storage.ApplicationData.Current.LocalSettings.Values.ContainsKey("DefaultRater")) Survey.Rater = Windows.Storage.ApplicationData.Current.LocalSettings.Values["DefaultRater"] as String; Segment = segment; EnableSaveButton = true; SurveyPhotoWrappers = new ObservableCollection<SurveyPhotoWrapper>(); }
private async Task editSurvyToTrashRoad(SegmentSurvey survey) { survey.PlaceId = "10086"; survey.SequenceId = 1; survey.RoadId = "100869999999"; await App.LocalSegmentSurveyTable.UpdateAsync(survey); }
public SurveyVM(SegmentSurvey survey) { this.survey = survey; this.Score = survey.IsWindshieldSurvey ? survey.WindshieldScore : survey.CopacesRating; this.IsWindshieldSurvey = survey.IsWindshieldSurvey ? "Yes" : "No"; }
public static async Task UpdateLocalSegmentSurvey(SegmentSurvey survey) { await App.LocalSegmentSurveyTable.UpdateAsync(survey); }
private async Task SaveSurvey(SegmentSurvey survey){ bool isExisted = await checkSurveyExisted(survey); if (isExisted) { await App.LocalSegmentSurveyTable.UpdateAsync(survey); } else { await App.LocalSegmentSurveyTable.InsertAsync(survey); } }
private async Task<bool> checkSurveyExisted(SegmentSurvey survey) { var result = await App.LocalSegmentSurveyTable.LookupAsync(survey.Id); return result != null; }
private bool checkIsValid(SegmentSurvey survey) { try { if ((survey.LoadLevel1 + survey.LoadLevel2 + survey.LoadLevel3 + survey.LoadLevel4) > 100) { return false; } // Check combos of percentage and severity Func<object, object, bool> IsOnlyOneGiven = (obj1, obj2) => (obj1 != null && obj2 == null) || (obj1 == null && obj2 != null); if (IsOnlyOneGiven(survey.BlockLevel, survey.BlockPercentage) || IsOnlyOneGiven(survey.RavelLevel, survey.RavelPercentage) || IsOnlyOneGiven(survey.EdgeLevel, survey.EdgePercentage) || IsOnlyOneGiven(survey.BleedLevel, survey.BleedPercentage) || IsOnlyOneGiven(survey.LossPavLevel, survey.LossPavPercentage) || IsOnlyOneGiven(survey.CorrugLevel, survey.CorrugPercentage)) { return false; } if (survey.LoadLevel1 + survey.LoadLevel2 + survey.LoadLevel3 + survey.LoadLevel3 + survey.LoadLevel4 > 100) { return false; } } catch (Exception exception) { NotificationHelper.ShowErrorMessage(exception.Message); return false; } return true; }
public void Clone(SegmentSurvey source) { this.CopacesRating = source.CopacesRating; this.IsWindshieldSurvey = source.IsWindshieldSurvey; this.BleedLevel = source.BleedLevel; this.BleedPercentage = source.BleedPercentage; this.BlockLevel = source.BlockLevel; this.BlockPercentage = source.BlockPercentage; this.CopacesRating = source.CopacesRating; this.CorrugLevel = source.CorrugLevel; this.CorrugPercentage = source.CorrugPercentage; this.CrossSlopeLeft = source.CrossSlopeLeft; this.CrossSlopeRight = source.CrossSlopeRight; this.EdgeLevel = source.EdgeLevel; this.EdgePercentage = source.EdgePercentage; this.IsWindshieldSurvey = source.IsWindshieldSurvey; this.LaneDirection = source.LaneDirection; this.LaneNum = source.LaneNum; this.LoadLevel1 = source.LoadLevel1; this.LoadLevel2 = source.LoadLevel2; this.LoadLevel3 = source.LoadLevel3; this.LoadLevel4 = source.LoadLevel4; this.LossPavLevel = source.LossPavLevel; this.LossPavPercentage = source.LossPavPercentage; this.Rater = source.Rater; this.RavelLevel = source.RavelLevel; this.RavelPercentage = source.RavelPercentage; this.ReflectLength = source.ReflectLength; this.ReflectLevel = source.ReflectLevel; this.ReflectNum = source.ReflectNum; this.Remarks = source.Remarks; this.RutInWp = source.RutInWp; this.RutOutWp = source.RutOutWp; this.SampleLocation = source.SampleLocation; this.TreatmentMethod = source.TreatmentMethod; this.TreatmentYear = source.TreatmentYear; this.WindshieldScore = source.WindshieldScore; }