private void SaveSettings(object sender, RoutedEventArgs e) { KegConfig config = new KegConfig(); config.MaxEventDurationMinutes = (int)cBox5.SelectedItem; config.MaxUserOuncesPerHour = (int)cBox6.SelectedItem; config.CoreHours = GetCoreHours(cBox1.SelectedItem.ToString() + cBox2.SelectedItem.ToString() + ";" + cBox3.SelectedItem.ToString() + cBox4.SelectedItem.ToString()); SaveKegConfigAsync(config); }
private static async void SaveKegConfigAsync(KegConfig config) { var client = new System.Net.Http.HttpClient(); string url = $"https://kegocnizerdemofunctions.azurewebsites.net/api/kegconfig"; var data = JsonConvert.SerializeObject(config); StringContent content = new StringContent(data, System.Text.Encoding.UTF8, "application/json"); KegLogger.KegLogTrace($"Save Keg Config MaxEventDuration : {config.MaxEventDurationMinutes} MaxUserOuncesPerHour: {config.MaxUserOuncesPerHour} CoreHours: {config.CoreHours}", "App6:SaveSettings", Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Information, null); var result = await client.PostAsync(url, content); }
public static async Task GetKegSettings() { if (Keg.DAL.Constants.KEGSETTINGSGUID.Trim().Length > 0) { Common.KegSettings = await GlobalSettings.GetKegSetting(Keg.DAL.Constants.KEGSETTINGSGUID); if (Common.KegSettings == null) { throw new Exception("Incorrect KegSettingsGuid, please correct Keg.DAL.Constants.KEGSETTINGSGUID."); } } }