Fix date
This commit is contained in:
@@ -179,9 +179,9 @@ public class ManageDataService(
|
|||||||
|
|
||||||
activities = await localDb.Get<StbActivity>(x =>
|
activities = await localDb.Get<StbActivity>(x =>
|
||||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveDate == null &&
|
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||||
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
|
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
|
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
|
||||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -223,9 +223,9 @@ public class ManageDataService(
|
|||||||
{
|
{
|
||||||
activities = await localDb.Get<StbActivity>(x =>
|
activities = await localDb.Get<StbActivity>(x =>
|
||||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveDate == null &&
|
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||||
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
|
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
|
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
|
||||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,7 +278,7 @@
|
|||||||
|
|
||||||
// Raggruppa le attività per data
|
// Raggruppa le attività per data
|
||||||
var activitiesByDate = MonthActivities
|
var activitiesByDate = MonthActivities
|
||||||
.GroupBy(x => (x.EffectiveDate ?? x.EstimatedDate!).Value.Date)
|
.GroupBy(x => (x.EffectiveTime ?? x.EstimatedTime!).Value.Date)
|
||||||
.ToDictionary(g => g.Key, g => g.ToList());
|
.ToDictionary(g => g.Key, g => g.ToList());
|
||||||
|
|
||||||
foreach (var (date, activities) in activitiesByDate)
|
foreach (var (date, activities) in activitiesByDate)
|
||||||
@@ -482,7 +482,7 @@
|
|||||||
var start = CurrentMonth;
|
var start = CurrentMonth;
|
||||||
var end = start.AddDays(DaysInMonth - 1);
|
var end = start.AddDays(DaysInMonth - 1);
|
||||||
var activities = await ManageData.GetActivity(new WhereCondActivity{Start = start, End = end});
|
var activities = await ManageData.GetActivity(new WhereCondActivity{Start = start, End = end});
|
||||||
MonthActivities = activities.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate).ToList();
|
MonthActivities = activities.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime).ToList();
|
||||||
|
|
||||||
PrepareRenderingData();
|
PrepareRenderingData();
|
||||||
IsLoading = false;
|
IsLoading = false;
|
||||||
@@ -574,7 +574,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var date = activity.EffectiveDate ?? activity.EstimatedDate;
|
var date = activity.EffectiveTime ?? activity.EstimatedTime;
|
||||||
|
|
||||||
if (CurrentMonth.Month != date!.Value.Month)
|
if (CurrentMonth.Month != date!.Value.Month)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class ActivityDTO : StbActivity
|
|||||||
MinuteBefore == other.MinuteBefore &&
|
MinuteBefore == other.MinuteBefore &&
|
||||||
NotificationDate == other.NotificationDate &&
|
NotificationDate == other.NotificationDate &&
|
||||||
Category == other.Category &&
|
Category == other.Category &&
|
||||||
Complete == other.Complete && ActivityId == other.ActivityId && ActivityResultId == other.ActivityResultId && ActivityTypeId == other.ActivityTypeId && DataInsAct.Equals(other.DataInsAct) && ActivityDescription == other.ActivityDescription && ParentActivityId == other.ParentActivityId && TipoAnag == other.TipoAnag && CodAnag == other.CodAnag && CodJcom == other.CodJcom && CodJfas == other.CodJfas && Nullable.Equals(EstimatedDate, other.EstimatedDate) && Nullable.Equals(EstimatedTime, other.EstimatedTime) && Nullable.Equals(AlarmDate, other.AlarmDate) && Nullable.Equals(AlarmTime, other.AlarmTime) && Nullable.Equals(EffectiveDate, other.EffectiveDate) && Nullable.Equals(EffectiveTime, other.EffectiveTime) && ResultDescription == other.ResultDescription && Nullable.Equals(EstimatedEnddate, other.EstimatedEnddate) && Nullable.Equals(EstimatedEndtime, other.EstimatedEndtime) && Nullable.Equals(EffectiveEnddate, other.EffectiveEnddate) && Nullable.Equals(EffectiveEndtime, other.EffectiveEndtime) && UserCreator == other.UserCreator && UserName == other.UserName && Nullable.Equals(PercComp, other.PercComp) && Nullable.Equals(EstimatedHours, other.EstimatedHours) && CodMart == other.CodMart && PartitaMag == other.PartitaMag && Matricola == other.Matricola && Priorita == other.Priorita && Nullable.Equals(ActivityPlayCounter, other.ActivityPlayCounter) && ActivityEvent == other.ActivityEvent && Guarantee == other.Guarantee && Note == other.Note && Rfid == other.Rfid && IdLotto == other.IdLotto && PersonaRif == other.PersonaRif && HrNum == other.HrNum && Gestione == other.Gestione && Nullable.Equals(DataOrd, other.DataOrd) && NumOrd == other.NumOrd && IdStep == other.IdStep && IdRiga == other.IdRiga && Nullable.Equals(OraInsAct, other.OraInsAct) && IndiceGradimento == other.IndiceGradimento && NoteGradimento == other.NoteGradimento && FlagRisolto == other.FlagRisolto && FlagTipologia == other.FlagTipologia && OreRapportino == other.OreRapportino && UserModifier == other.UserModifier && Nullable.Equals(OraModAct, other.OraModAct) && Nullable.Equals(OraViewAct, other.OraViewAct) && CodVdes == other.CodVdes && CodCmac == other.CodCmac && WrikeId == other.WrikeId && CodMgrp == other.CodMgrp && PlanId == other.PlanId;
|
Complete == other.Complete && ActivityId == other.ActivityId && ActivityResultId == other.ActivityResultId && ActivityTypeId == other.ActivityTypeId && DataInsAct.Equals(other.DataInsAct) && ActivityDescription == other.ActivityDescription && ParentActivityId == other.ParentActivityId && TipoAnag == other.TipoAnag && CodAnag == other.CodAnag && CodJcom == other.CodJcom && CodJfas == other.CodJfas && Nullable.Equals(EstimatedTime, other.EstimatedTime) && Nullable.Equals(AlarmDate, other.AlarmDate) && Nullable.Equals(AlarmTime, other.AlarmTime) && Nullable.Equals(EffectiveTime, other.EffectiveTime) && ResultDescription == other.ResultDescription && Nullable.Equals(EstimatedEndtime, other.EstimatedEndtime) && Nullable.Equals(EffectiveEndtime, other.EffectiveEndtime) && UserCreator == other.UserCreator && UserName == other.UserName && Nullable.Equals(PercComp, other.PercComp) && Nullable.Equals(EstimatedHours, other.EstimatedHours) && CodMart == other.CodMart && PartitaMag == other.PartitaMag && Matricola == other.Matricola && Priorita == other.Priorita && Nullable.Equals(ActivityPlayCounter, other.ActivityPlayCounter) && ActivityEvent == other.ActivityEvent && Guarantee == other.Guarantee && Note == other.Note && Rfid == other.Rfid && IdLotto == other.IdLotto && PersonaRif == other.PersonaRif && HrNum == other.HrNum && Gestione == other.Gestione && Nullable.Equals(DataOrd, other.DataOrd) && NumOrd == other.NumOrd && IdStep == other.IdStep && IdRiga == other.IdRiga && Nullable.Equals(OraInsAct, other.OraInsAct) && IndiceGradimento == other.IndiceGradimento && NoteGradimento == other.NoteGradimento && FlagRisolto == other.FlagRisolto && FlagTipologia == other.FlagTipologia && OreRapportino == other.OreRapportino && UserModifier == other.UserModifier && Nullable.Equals(OraModAct, other.OraModAct) && Nullable.Equals(OraViewAct, other.OraViewAct) && CodVdes == other.CodVdes && CodCmac == other.CodCmac && WrikeId == other.WrikeId && CodMgrp == other.CodMgrp && PlanId == other.PlanId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object? obj)
|
public override bool Equals(object? obj)
|
||||||
@@ -57,16 +57,12 @@ public class ActivityDTO : StbActivity
|
|||||||
hashCode.Add(CodAnag);
|
hashCode.Add(CodAnag);
|
||||||
hashCode.Add(CodJcom);
|
hashCode.Add(CodJcom);
|
||||||
hashCode.Add(CodJfas);
|
hashCode.Add(CodJfas);
|
||||||
hashCode.Add(EstimatedDate);
|
|
||||||
hashCode.Add(EstimatedTime);
|
hashCode.Add(EstimatedTime);
|
||||||
hashCode.Add(AlarmDate);
|
hashCode.Add(AlarmDate);
|
||||||
hashCode.Add(AlarmTime);
|
hashCode.Add(AlarmTime);
|
||||||
hashCode.Add(EffectiveDate);
|
|
||||||
hashCode.Add(EffectiveTime);
|
hashCode.Add(EffectiveTime);
|
||||||
hashCode.Add(ResultDescription);
|
hashCode.Add(ResultDescription);
|
||||||
hashCode.Add(EstimatedEnddate);
|
|
||||||
hashCode.Add(EstimatedEndtime);
|
hashCode.Add(EstimatedEndtime);
|
||||||
hashCode.Add(EffectiveEnddate);
|
|
||||||
hashCode.Add(EffectiveEndtime);
|
hashCode.Add(EffectiveEndtime);
|
||||||
hashCode.Add(UserCreator);
|
hashCode.Add(UserCreator);
|
||||||
hashCode.Add(UserName);
|
hashCode.Add(UserName);
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ public class StbActivity
|
|||||||
[Column("cod_jfas"), JsonPropertyName("codJfas")]
|
[Column("cod_jfas"), JsonPropertyName("codJfas")]
|
||||||
public string? CodJfas { get; set; }
|
public string? CodJfas { get; set; }
|
||||||
|
|
||||||
[Column("estimated_date"), JsonPropertyName("estimatedDate")]
|
|
||||||
public DateTime? EstimatedDate { get; set; }
|
|
||||||
|
|
||||||
[Column("estimated_time"), JsonPropertyName("estimatedTime")]
|
[Column("estimated_time"), JsonPropertyName("estimatedTime")]
|
||||||
public DateTime? EstimatedTime { get; set; }
|
public DateTime? EstimatedTime { get; set; }
|
||||||
|
|
||||||
@@ -48,24 +45,15 @@ public class StbActivity
|
|||||||
[Column("alarm_time"), JsonPropertyName("alarmTime")]
|
[Column("alarm_time"), JsonPropertyName("alarmTime")]
|
||||||
public DateTime? AlarmTime { get; set; }
|
public DateTime? AlarmTime { get; set; }
|
||||||
|
|
||||||
[Column("effective_date"), JsonPropertyName("effectiveDate")]
|
|
||||||
public DateTime? EffectiveDate { get; set; }
|
|
||||||
|
|
||||||
[Column("effective_time"), JsonPropertyName("effectiveTime")]
|
[Column("effective_time"), JsonPropertyName("effectiveTime")]
|
||||||
public DateTime? EffectiveTime { get; set; }
|
public DateTime? EffectiveTime { get; set; }
|
||||||
|
|
||||||
[Column("result_description"), JsonPropertyName("resultDescription")]
|
[Column("result_description"), JsonPropertyName("resultDescription")]
|
||||||
public string? ResultDescription { get; set; }
|
public string? ResultDescription { get; set; }
|
||||||
|
|
||||||
[Column("estimated_enddate"), JsonPropertyName("estimatedEnddate")]
|
|
||||||
public DateTime? EstimatedEnddate { get; set; }
|
|
||||||
|
|
||||||
[Column("estimated_endtime"), JsonPropertyName("estimatedEndtime")]
|
[Column("estimated_endtime"), JsonPropertyName("estimatedEndtime")]
|
||||||
public DateTime? EstimatedEndtime { get; set; }
|
public DateTime? EstimatedEndtime { get; set; }
|
||||||
|
|
||||||
[Column("effective_enddate"), JsonPropertyName("effectiveEnddate")]
|
|
||||||
public DateTime? EffectiveEnddate { get; set; }
|
|
||||||
|
|
||||||
[Column("effective_endtime"), JsonPropertyName("effectiveEndtime")]
|
[Column("effective_endtime"), JsonPropertyName("effectiveEndtime")]
|
||||||
public DateTime? EffectiveEndtime { get; set; }
|
public DateTime? EffectiveEndtime { get; set; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user