PTMagic/Monitor/Pages/_get/DashboardTop.cshtml.cs

28 lines
862 B
C#
Raw Normal View History

2018-05-22 10:11:50 +02:00
using System;
using Core.Main;
using Core.Main.DataObjects;
using Core.Main.DataObjects.PTMagicData;
2018-05-22 10:11:50 +02:00
namespace Monitor.Pages {
public class DashboardTopModel : _Internal.BasePageModelSecureAJAX {
public ProfitTrailerData PTData = null;
public MiscData MiscData = null;
2018-05-22 10:11:50 +02:00
public DateTimeOffset DateTimeNow = Constants.confMinDate;
public void OnGet() {
// Initialize Config
base.Init();
BindData();
}
2019-10-15 15:05:53 +02:00
public double TotalBagCost = 0;
public double TotalBagValue = 0;
2020-07-26 16:28:37 +02:00
public double TotalBagGain = 0;
2018-05-22 10:11:50 +02:00
private void BindData() {
PTData = this.PtDataObject;
MiscData = this.PTData.Misc;
2018-05-22 10:11:50 +02:00
// Convert local offset time to UTC
TimeSpan offsetTimeSpan = TimeSpan.Parse(MiscData.TimeZoneOffset.Replace("+", ""));
2018-05-22 10:11:50 +02:00
DateTimeNow = DateTimeOffset.UtcNow.ToOffset(offsetTimeSpan);
}
}
}