diff --git a/GPW.CORE.Comp/CalendarWeek.razor b/GPW.CORE.Comp/CalendarWeek.razor index 7cccc8f..e486c40 100644 --- a/GPW.CORE.Comp/CalendarWeek.razor +++ b/GPW.CORE.Comp/CalendarWeek.razor @@ -7,10 +7,10 @@ else - + @foreach (var item in DateList) { -
-- +
@($"{item:ddd}".Substring(0, 1).ToUpper())
diff --git a/GPW.CORE.Comp/CalendarWeek.razor.cs b/GPW.CORE.Comp/CalendarWeek.razor.cs index 790281c..f81e32d 100644 --- a/GPW.CORE.Comp/CalendarWeek.razor.cs +++ b/GPW.CORE.Comp/CalendarWeek.razor.cs @@ -179,7 +179,7 @@ namespace GPW.CORE.Comp List answ = new List(); if (EventList != null) { - answ = EventList.Where(x => x.Inizio.Date == DtReq).ToList(); + answ = EventList.Where(x =>DateList.Contains(x.Inizio.Date)).ToList(); } return answ; } diff --git a/GPW.CORE.SMART/Components/TestWeekCal.razor b/GPW.CORE.SMART/Components/TestWeekCal.razor index 1d89366..6244727 100644 --- a/GPW.CORE.SMART/Components/TestWeekCal.razor +++ b/GPW.CORE.SMART/Components/TestWeekCal.razor @@ -1,4 +1,4 @@  - + diff --git a/GPW.CORE.SMART/Components/TestWeekCal.razor.cs b/GPW.CORE.SMART/Components/TestWeekCal.razor.cs index cd6993d..6e33957 100644 --- a/GPW.CORE.SMART/Components/TestWeekCal.razor.cs +++ b/GPW.CORE.SMART/Components/TestWeekCal.razor.cs @@ -19,7 +19,10 @@ namespace GPW.CORE.Smart.Components protected List ListDate = new List(); - public List simEventList { get; set; } = new List(); + [Parameter] + public List eventList { get; set; } = new List(); + + protected List eventListPerWeek { get; set; } = new List(); #endregion Protected Fields @@ -63,35 +66,39 @@ namespace GPW.CORE.Smart.Components ListDate.Add(DtReq.AddDays(i - nWeek)); } - // aggiongo eventi simulati x ogni giorno - int idxEv = 0; - simEventList = new List(); - int hStart = 0; - int minDur = 0; - DateTime dtInizio = DateTime.MinValue; - DateTime dtFine = DateTime.MinValue; - int numEv = 0; - foreach (var giorno in ListDate) - { - // per prima cosa devo decidere quanti eventi... - numEv = rnd.Next(0, 4); - for (int i = 0; i < numEv; i++) - { - hStart = rnd.Next(8, 14); - minDur = rnd.Next(6, 36) * 10; - dtInizio = giorno.AddHours(hStart); - dtFine = dtInizio.AddMinutes(minDur); - simEventList.Add(new CalendarEvent() - { - id = idxEv++, - Inizio = dtInizio, - Fine = dtFine, - CssClass = "text-light", - Title = $"Sim EV {idxEv}", - Description = $"Nuovo evento simulato, {dtInizio:HH:mm} --> {dtFine:HH:mm}" - }); - } - } + //// aggiongo eventi simulati x ogni giorno + //int idxEv = 0; + //simEventList = new List(); + //int hStart = 0; + //int minDur = 0; + //DateTime dtInizio = DateTime.MinValue; + //DateTime dtFine = DateTime.MinValue; + //int numEv = 0; + //foreach (var giorno in ListDate) + //{ + // // per prima cosa devo decidere quanti eventi... + // numEv = rnd.Next(0, 4); + // for (int i = 0; i < numEv; i++) + // { + // hStart = rnd.Next(8, 14); + // minDur = rnd.Next(6, 36) * 10; + // dtInizio = giorno.AddHours(hStart); + // dtFine = dtInizio.AddMinutes(minDur); + // simEventList.Add(new CalendarEvent() + // { + // id = idxEv++, + // Inizio = dtInizio, + // Fine = dtFine, + // CssClass = "text-light", + // Title = $"Sim EV {idxEv}", + // Description = $"Nuovo evento simulato, {dtInizio:HH:mm} --> {dtFine:HH:mm}" + // }); + // } + //} + + eventListPerWeek = eventList.Where(x => ListDate.Contains(x.Inizio)).ToList(); + + await Task.Delay(1); } diff --git a/GPW.CORE.SMART/Data/CalendarModeEnum.cs b/GPW.CORE.SMART/Data/CalendarModeEnum.cs index dcfc2d8..18ea64e 100644 --- a/GPW.CORE.SMART/Data/CalendarModeEnum.cs +++ b/GPW.CORE.SMART/Data/CalendarModeEnum.cs @@ -7,10 +7,12 @@ /// public enum modoControllo { - showCalendar = 0, + nd=0, + showCalendar, showGauge, showProj, - showTimbr + showTimbr, + showWeek } } } diff --git a/GPW.CORE.SMART/Pages/DayOff.razor b/GPW.CORE.SMART/Pages/DayOff.razor index 4508456..c5e1985 100644 --- a/GPW.CORE.SMART/Pages/DayOff.razor +++ b/GPW.CORE.SMART/Pages/DayOff.razor @@ -33,8 +33,16 @@
@if (!isLoading) { - + @if (!showDetail) + { + + } + else + { + + } } +
diff --git a/GPW.CORE.SMART/Pages/DayOff.razor.cs b/GPW.CORE.SMART/Pages/DayOff.razor.cs index 8e7ea72..6420ed6 100644 --- a/GPW.CORE.SMART/Pages/DayOff.razor.cs +++ b/GPW.CORE.SMART/Pages/DayOff.razor.cs @@ -33,6 +33,9 @@ namespace GPW.CORE.Smart.Pages protected DateTime dtMin = DateTime.Today; protected int numMesi = 6; + protected int numDays = 5; + + protected DateTime DtReq { get; set; } = DateTime.Today; #endregion Protected Fields