56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GWMS.UI.Data
|
|
{
|
|
public class SelectData
|
|
{
|
|
#region Public Properties
|
|
|
|
public DateTime DateEnd { get; set; } = DateTime.Now.AddMinutes(1);
|
|
public DateTime DateStart { get; set; } = DateTime.Now.AddDays(-7);
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Inizializzazione con periodo e arrotondamento
|
|
/// </summary>
|
|
/// <param name="minRound"></param>
|
|
/// <param name="numDayPrev"></param>
|
|
/// <returns></returns>
|
|
public static SelectData Init(int minRound, int numDayPrev)
|
|
{
|
|
DateTime endRounded = DateTime.Today.AddDays(1);
|
|
SelectData answ = new SelectData()
|
|
{
|
|
DateEnd = endRounded,
|
|
DateStart = endRounded.AddDays(-numDayPrev)
|
|
};
|
|
return answ;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (!(obj is SelectData item))
|
|
return false;
|
|
|
|
if (DateEnd != item.DateEnd)
|
|
return false;
|
|
if (DateStart != item.DateStart)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |