Пример #1
0
        public static void EditSurvey(SegmentSurvey survey)
        {
            if (sqlConnection.State == ConnectionState.Closed) sqlConnection.Open();
            object sql_result;
            SqlCommand command_survey = new SqlCommand("UPDATE " + databaseName + ".segmentsurveys SET BleedLevel='" + survey.BleedLevel + "',BleedPercentage='" + survey.BleedPercentage + "',BlockLevel='" + survey.BlockLevel + "',BlockPercentage='" + survey.BlockPercentage + "',CopacesRating='" + survey.CopacesRating + "',CorrugLevel='" + survey.CorrugLevel
                + "',CorrugPercentage='" + survey.CorrugPercentage + "',CrossSlopeLeft='" + survey.CrossSlopeLeft + "',CrossSlopeRight='"
                + survey.CrossSlopeRight + "',EdgeLevel='" + survey.EdgeLevel + "',EdgePercentage='" + survey.EdgePercentage + "',IsWindshieldSurvey='"
                + survey.IsWindshieldSurvey + "',LaneDirection='" + survey.LaneDirection + "',LaneNum='" + survey.LaneNum + "',LoadLevel1='"
                + survey.LoadLevel1 + "',LoadLevel2='" + survey.LoadLevel2 + "',LoadLevel3='" + survey.LoadLevel3 + "',LoadLevel4='"
                + survey.LoadLevel4 + "',LossPavLevel='" + survey.LossPavLevel + "',LossPavPercentage='" + survey.LossPavPercentage + "',PatchPotholeNum='" + survey.PatchPotholeNum
                + "',Rater='" + survey.Rater + "',RavelLevel='" + survey.RavelLevel + "',RavelPercentage='" + survey.RavelPercentage + "',ReflectLength='" + survey.ReflectLength
                + "',ReflectLevel='" + survey.ReflectLevel + "',ReflectNum='" + survey.ReflectNum + "',Remarks='" + survey.Remarks + "',RutInWp='" + survey.RutInWp + "',RutOutWp='" + survey.RutOutWp
                + "',SampleLocation='" + survey.SampleLocation + "',SequenceId='" + survey.SequenceId + "',TreatmentMethod='" + survey.TreatmentMethod + "',TreatmentYear='" + survey.TreatmentYear + "',WindshieldScore='"
                + survey.WindshieldScore + "'", sqlConnection);

            try
            {
                sql_result = command_survey.ExecuteReaderAsync();
                sqlConnection.Close();
            }
            catch (Exception e)
            {
                e.ToString();
            }
        }
Пример #2
0
        public static void EditSegmentSurvey(SegmentSurvey survey)
        {
            try
            {
                DataTools.EditSurvey(survey);
            }
            catch (System.Net.WebException ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.ToString());
                Console.Read();
            }

        }
Пример #3
0
 public static async Task<List<SurveyPhoto>> GetSurveyPhotosBySurvey(SegmentSurvey segmentSurvey)
 {
     var url = String.Format("tables/surveyPhoto?$filter=segmentSurveyId eq '{0}'", segmentSurvey.Id);
     return JsonConvert.DeserializeObject<List<SurveyPhoto>>(await Client.GetAsyncWithCred(url));
 }
Пример #4
0
        public static async Task CreateSegmentSurvey(SegmentSurvey survey)
        {
            try
            {
                string theUri = BaseURL + "tables/segmentsurvey";
                //Create a Json Serializer for our type 
                String jsonSer = JsonConvert.SerializeObject(survey);
                HttpContent payload = new StringContent(jsonSer, System.Text.Encoding.UTF8, "application/json");


                //Post the data 
                var aResponse = await Client.PostAsync(theUri, payload);
            }
            catch (System.Net.WebException ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.ToString());
                Console.Read();
            }

        }