From e7d100e7d3d0ac14ba29ce0cfaf2b549f67bb0cb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 11 Jan 2023 09:38:05 +0100 Subject: [PATCH] Fix round tempi --- GPW.CORE.Comp/CalendarMonth.razor.css | 25 +------- GPW.CORE.Comp/CalendarMonth.razor.less | 24 ------- GPW.CORE.Comp/CircleGauge.razor.cs | 8 +-- GPW.CORE.Comp/compilerconfig.json | 8 --- GPW.CORE.Data/DTO/DailyDataDTO.cs | 16 ++--- GPW.CORE.SMART/Components/Calendario.razor | 4 +- GPW.CORE.SMART/Components/Calendario.razor.cs | 62 ++++++++----------- .../Components/Calendario.razor.css | 38 +----------- .../Components/Calendario.razor.less | 38 +----------- 9 files changed, 44 insertions(+), 179 deletions(-) diff --git a/GPW.CORE.Comp/CalendarMonth.razor.css b/GPW.CORE.Comp/CalendarMonth.razor.css index 3e01d6a..5c1fab3 100644 --- a/GPW.CORE.Comp/CalendarMonth.razor.css +++ b/GPW.CORE.Comp/CalendarMonth.razor.css @@ -28,27 +28,4 @@ .selDate { background-color: #E67E22; color: #000; -} -/*.statsContainer { - border: 0.3rem solid #E67E22; - border-radius: 0.8rem;*/ -/*border-radius: 0rem 0rem 0.8rem 0.8rem;*/ -/*margin: 0px 10px 20px 10px;*/ -/*padding-bottom: 10px; -} - -.baseBtn{ - height: 2.5rem; - border: none; - border-radius: 0.8rem; - color:#fff; -} - -.btnReset { - .baseBtn; - background-color: #1AB7EA; -} -.btnTemp { - .baseBtn; - background-color: #1ABC9C; -}*/ \ No newline at end of file +} \ No newline at end of file diff --git a/GPW.CORE.Comp/CalendarMonth.razor.less b/GPW.CORE.Comp/CalendarMonth.razor.less index bd74d26..b1fbb60 100644 --- a/GPW.CORE.Comp/CalendarMonth.razor.less +++ b/GPW.CORE.Comp/CalendarMonth.razor.less @@ -35,27 +35,3 @@ color: #000; } -/*.statsContainer { - border: 0.3rem solid #E67E22; - border-radius: 0.8rem;*/ - /*border-radius: 0rem 0rem 0.8rem 0.8rem;*/ - /*margin: 0px 10px 20px 10px;*/ - /*padding-bottom: 10px; -} - -.baseBtn{ - height: 2.5rem; - border: none; - border-radius: 0.8rem; - color:#fff; -} - -.btnReset { - .baseBtn; - background-color: #1AB7EA; -} -.btnTemp { - .baseBtn; - background-color: #1ABC9C; -}*/ - diff --git a/GPW.CORE.Comp/CircleGauge.razor.cs b/GPW.CORE.Comp/CircleGauge.razor.cs index b7a983a..4029f32 100644 --- a/GPW.CORE.Comp/CircleGauge.razor.cs +++ b/GPW.CORE.Comp/CircleGauge.razor.cs @@ -24,12 +24,12 @@ namespace GPW.CORE.Comp /// Valore da rappresentare /// [Parameter] - public double currVal { get; set; } = 0; + public int currVal { get; set; } = 0; /// /// Valore MASSIMO da rappresentare (=100%) /// [Parameter] - public double maxVal { get; set; } = 0; + public int maxVal { get; set; } = 0; /// @@ -56,11 +56,11 @@ namespace GPW.CORE.Comp get => currVal > maxVal; } - private double valInner + private int valInner { get => currVal < maxVal ? currVal : maxVal; } - private double valOuter + private int valOuter { get => currVal < maxVal ? 0 : currVal - maxVal; } diff --git a/GPW.CORE.Comp/compilerconfig.json b/GPW.CORE.Comp/compilerconfig.json index c6e3e84..c8e9dff 100644 --- a/GPW.CORE.Comp/compilerconfig.json +++ b/GPW.CORE.Comp/compilerconfig.json @@ -3,14 +3,6 @@ "outputFile": "CircleGauge.razor.css", "inputFile": "CircleGauge.razor.less" }, - { - "outputFile": "dtCard.razor.css", - "inputFile": "dtCard.razor.less" - }, - { - "outputFile": "BottoniEntrEsc.razor.css", - "inputFile": "BottoniEntrEsc.razor.less" - }, { "outputFile": "CmpTop.razor.css", "inputFile": "CmpTop.razor.less" diff --git a/GPW.CORE.Data/DTO/DailyDataDTO.cs b/GPW.CORE.Data/DTO/DailyDataDTO.cs index ea8fdc0..483ed59 100644 --- a/GPW.CORE.Data/DTO/DailyDataDTO.cs +++ b/GPW.CORE.Data/DTO/DailyDataDTO.cs @@ -64,15 +64,19 @@ namespace GPW.CORE.Data.DTO return answ; } } + public int MinComm + { + get => (int)Math.Round(OreComm * 60); + } + public int MinLav + { + get => (int)Math.Round(OreLav * 60); + } public string OreMinLav { get { - //int numOre = (int)OreLav; - //int numMin = (int)(60 * (OreLav - (int)OreLav)); - //string answ = $"{numOre}:{numMin:00}"; - //return answ; TimeSpan durTs = TimeSpan.FromHours(OreLav); return $"{durTs.Hours}:{durTs.Minutes:00}"; } @@ -81,10 +85,6 @@ namespace GPW.CORE.Data.DTO { get { - //int numOre = (int)OreComm; - //int numMin = (int)(60 * (OreComm - (int)OreComm)); - //string answ = $"{numOre}:{numMin:00}"; - //return answ; TimeSpan durTs = TimeSpan.FromHours(OreComm); return $"{durTs.Hours}:{durTs.Minutes:00}"; diff --git a/GPW.CORE.SMART/Components/Calendario.razor b/GPW.CORE.SMART/Components/Calendario.razor index 52787b9..212d003 100644 --- a/GPW.CORE.SMART/Components/Calendario.razor +++ b/GPW.CORE.SMART/Components/Calendario.razor @@ -64,10 +64,10 @@ else {
- +
- +
} diff --git a/GPW.CORE.SMART/Components/Calendario.razor.cs b/GPW.CORE.SMART/Components/Calendario.razor.cs index c645b31..5ee55d4 100644 --- a/GPW.CORE.SMART/Components/Calendario.razor.cs +++ b/GPW.CORE.SMART/Components/Calendario.razor.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using GPW.CORE.Smart; -using GPW.CORE.Data; -using GPW.CORE.Smart.Shared; -using GPW.CORE.Comp; using GPW.CORE.Data.DTO; -using GPW.CORE.Data.Controllers; using GPW.CORE.Smart.Data; +using Microsoft.AspNetCore.Components; namespace GPW.CORE.Smart.Components { public partial class Calendario { - [Inject] - protected CoreSmartDataService CSDataService { get; set; } = null!; + #region Public Properties [Parameter] public int IdxDipendente { get; set; } = -1; + #endregion Public Properties + + #region Protected Fields + + protected List? listRecords = null; + + protected DailyDataDTO? timbratureOggi = null; + + #endregion Protected Fields + + #region Protected Properties + + [Inject] + protected CoreSmartDataService CSDataService { get; set; } = null!; + + #endregion Protected Properties + #region Protected Methods protected override async Task OnParametersSetAsync() @@ -40,8 +39,6 @@ namespace GPW.CORE.Smart.Components listRecords = await CSDataService.DailyDetails(IdxDipendente, MeseStart, MeseEnd); - - DateCheck = new Dictionary(); Random rnd = new Random(); // random colorate... @@ -59,11 +56,6 @@ namespace GPW.CORE.Smart.Components } } - private bool showDetail { get; set; } = false; - - protected List? listRecords = null; - protected DailyDataDTO? timbratureOggi = null; - #endregion Protected Methods #region Private Fields @@ -75,7 +67,7 @@ namespace GPW.CORE.Smart.Components #region Private Properties private DateTime dtCurr { get; set; } = DateTime.Today; - + private bool showDetail { get; set; } = false; #endregion Private Properties @@ -88,6 +80,12 @@ namespace GPW.CORE.Smart.Components updateDetail(); } + private async Task resetCal() + { + showDetail = false; + await Task.Delay(1); + } + private void updateDetail() { if (listRecords != null) @@ -96,12 +94,6 @@ namespace GPW.CORE.Smart.Components } } - private async Task resetCal() - { - showDetail = false; - await Task.Delay(1); - } - #endregion Private Methods } -} +} \ No newline at end of file diff --git a/GPW.CORE.SMART/Components/Calendario.razor.css b/GPW.CORE.SMART/Components/Calendario.razor.css index eb5aa12..2cec78a 100644 --- a/GPW.CORE.SMART/Components/Calendario.razor.css +++ b/GPW.CORE.SMART/Components/Calendario.razor.css @@ -1,40 +1,4 @@ -/*.cssTable { - border-radius: 12px; - width: 100%; - height: 100%; - background-color: #34495E; -} - -.cssTable tr { - margin: 0 0.9rem 0 0.9rem; -} -.cssTable td { - padding: 0.4rem 0rem 0.25rem 0rem; - border: none; -} - -.cssTable thead tr { - margin-top: 0.625rem; -} - -.meseAnno{ - text-transform: capitalize; - color: #fff; -} - -.containerBtnTemp { - position: relative; - align-items: center; - display: flex; - justify-content: center;*/ -/*margin-bottom: 20px;*/ -/*} - -.selDate { - background-color: #E67E22; - color: #000; -}*/ -.statsContainer { +.statsContainer { border: 0.3rem solid #E67E22; border-radius: 0.8rem; /*border-radius: 0rem 0rem 0.8rem 0.8rem;*/ diff --git a/GPW.CORE.SMART/Components/Calendario.razor.less b/GPW.CORE.SMART/Components/Calendario.razor.less index 4b47c07..e097410 100644 --- a/GPW.CORE.SMART/Components/Calendario.razor.less +++ b/GPW.CORE.SMART/Components/Calendario.razor.less @@ -1,40 +1,4 @@ -/*.cssTable { - border-radius: 12px; - width: 100%; - height: 100%; - background-color: #34495E; -} - -.cssTable tr { - margin: 0 0.9rem 0 0.9rem; -} -.cssTable td { - padding: 0.4rem 0rem 0.25rem 0rem; - border: none; -} - -.cssTable thead tr { - margin-top: 0.625rem; -} - -.meseAnno{ - text-transform: capitalize; - color: #fff; -} - -.containerBtnTemp { - position: relative; - align-items: center; - display: flex; - justify-content: center;*/ - /*margin-bottom: 20px;*/ -/*} - -.selDate { - background-color: #E67E22; - color: #000; -}*/ - + .statsContainer { border: 0.3rem solid #E67E22; border-radius: 0.8rem;