コード例 #1
0
        public static void update(Configuration config)
        {
            RestClient client = new RestClient(System.Configuration.ConfigurationManager.AppSettings["endpoint"]);
            RestRequest request = new RestRequest("configuration", Method.POST);

            request.AddParameter("application/json", config.Threshold, ParameterType.RequestBody);
            request.RequestFormat = DataFormat.Json;

            var response = client.Execute(request);

            if (response.StatusCode.Equals(HttpStatusCode.OK))
            {
                try
                {
                    LogBookController.register("Configuracion cambiada");
                }
                catch
                {
                    throw;
                }

            }
        }
コード例 #2
0
ファイル: configuration.aspx.cs プロジェクト: TicoSource/Eval
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     Configuration config = new Configuration();
     config.Threshold = Convert.ToInt32(threshold.Text);
     ConfigurationService.update(config);
 }