コード例 #1
0
ファイル: NewSurveyPageVm.cs プロジェクト: yuqiqian/Copacescc
 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>();
 }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: yuqiqian/Copacescc
 private async Task editSurvyToTrashRoad(SegmentSurvey survey)
 {
     survey.PlaceId = "10086";
     survey.SequenceId = 1;
     survey.RoadId = "100869999999";
     await App.LocalSegmentSurveyTable.UpdateAsync(survey);
 }
コード例 #3
0
 public SurveyVM(SegmentSurvey survey)
 {
     this.survey = survey;
     this.Score = survey.IsWindshieldSurvey ? survey.WindshieldScore : survey.CopacesRating;
     this.IsWindshieldSurvey = survey.IsWindshieldSurvey ? "Yes" : "No";
 }
コード例 #4
0
ファイル: SyncHelper.cs プロジェクト: yuqiqian/Copacescc
 public static async Task UpdateLocalSegmentSurvey(SegmentSurvey survey)
 {
     await App.LocalSegmentSurveyTable.UpdateAsync(survey);
 }
コード例 #5
0
 private async Task SaveSurvey(SegmentSurvey survey){
     bool isExisted = await checkSurveyExisted(survey);
     if (isExisted)
     {
         await App.LocalSegmentSurveyTable.UpdateAsync(survey);
     }
     else
     {
         await App.LocalSegmentSurveyTable.InsertAsync(survey);
     }
 }
コード例 #6
0
 private async Task<bool> checkSurveyExisted(SegmentSurvey survey)
 {
     var result = await App.LocalSegmentSurveyTable.LookupAsync(survey.Id);
     return result != null;
 }
コード例 #7
0
ファイル: SegmentSurvey.cs プロジェクト: yuqiqian/Copacescc
        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;
        }
コード例 #8
0
ファイル: SegmentSurvey.cs プロジェクト: yuqiqian/Copacescc
 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;
 }