PTMagic/Monitor/Pages/PresetFiles.cshtml.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2018-05-22 10:11:50 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Core.Main;
using Core.Helper;
using Core.Main.DataObjects.PTMagicData;
using System.Globalization;
namespace Monitor.Pages
{
public class PresetFilesModel : _Internal.BasePageModelSecure
{
2018-05-22 10:11:50 +02:00
public List<GlobalSetting> GlobalSettingsWithPresets = new List<GlobalSetting>();
public void OnGet()
{
2018-05-22 10:11:50 +02:00
base.Init();
BindData();
}
public void BindData()
{
2018-05-22 10:11:50 +02:00
string notification = GetStringParameter("n", "");
if (notification.Equals("PresetFileSaved"))
{
2018-05-22 10:11:50 +02:00
NotifyHeadline = "Preset File Saved!";
NotifyMessage = "The preset file was saved and will be applied during the next interval.";
NotifyType = "success";
}
foreach (GlobalSetting globalSetting in PTMagicConfiguration.AnalyzerSettings.GlobalSettings)
{
if (globalSetting.PairsProperties.ContainsKey("File") || globalSetting.DCAProperties.ContainsKey("File") || globalSetting.IndicatorsProperties.ContainsKey("File"))
{
2018-05-22 10:11:50 +02:00
GlobalSettingsWithPresets.Add(globalSetting);
}
}
}
}
}