I have two dates: DataAcesso
and DataAtual
of type DateTime
. I have one more field called TempoAtualizacaoAutomatica
of typo byte
.
I need to subtract these dates and compare the result with TempoAtualizacaoAutomatica
.
The condition is: If "dates" is less than TempoAtualizacaoAutomatica
"On", otherwise "Off".
How do I do this?
I've tried the first part of this rule like this:
TimeSpan final = Convert.ToDateTime("19/03/2007 12:30").Subtract(Convert.ToDateTime("19/03/2007 12:00"));
But it did not come to what I wanted.
As I'm doing this in MVC, this part evidently must be in Controllers , right?
Thank you!
To the models.
Dashboard
public string Descricao { get; set; }
public bool FlagEstacaoI { get; set; }
public bool FlagEstacaoT { get; set; }
public bool FlagEstacaoD { get; set; }
public byte QtdeChamadasListadas { get; set; }
public byte QtdeChamadasFornecedor { get; set; }
public bool FlagExibirDesenhos { get; set; }
public string UrlChamadaAlerta { get; set; }
public byte TempoAtualizacaoAutomatica { get; set; }
public byte QtdeAcessosSimultaneos { get; set; }
public System.Guid Guid { get; set; }
public bool FlagBloqueioPainel { get; set; }
Panel Call Log Access
public int IdEmpresa { get; set; }
public int IdPainelChamada { get; set; }
public long Id { get; set; }
public System.DateTime DataAcesso { get; set; }
public string Ip { get; set; }
public string CabecalhoHttp { get; set; }
public virtual PainelChamada PAINEL_CHAMADA { get; set; }
ON means: panel is working.
Off: Panel is disabled.
There are two classes. Note that I will need to set items from one and the other for this method to work.