Move vecchia soluzione NET5
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BlaServApp.UI.Data
|
||||
{
|
||||
public class SelectData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodArticolo { get; set; } = "*";
|
||||
public DateTime DateEnd { get; set; } = DateTime.Now.AddMinutes(1);
|
||||
public DateTime DateStart { get; set; } = DateTime.Now.AddDays(-7);
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
public int IdxOdl { get; set; } = -999;
|
||||
public string KeyRichiesta { get; set; } = "*";
|
||||
|
||||
#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)
|
||||
{
|
||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
||||
int minDay = (int)(DayElapsed.TotalMinutes / minRound) * minRound;
|
||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
||||
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 (CodArticolo != item.CodArticolo)
|
||||
return false;
|
||||
if (DateEnd != item.DateEnd)
|
||||
return false;
|
||||
if (DateStart != item.DateStart)
|
||||
return false;
|
||||
if (IdxMacchina != item.IdxMacchina)
|
||||
return false;
|
||||
if (IdxOdl != item.IdxOdl)
|
||||
return false;
|
||||
if (KeyRichiesta != item.KeyRichiesta)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user