Exemplo n.º 1
0
        private async void TransferCommandExecute()
        {
            TimeSpan totalReport = ReportUtils.ToTimeSpan(ReportSummary).Duration();
            var      a           = DateTime.Now;

            var answer = await DialogService.DisplayAlertAsync("Transferir Minutos",
                                                               $"Deseja mesmo transferir {totalReport.Minutes} minutos para o mês atual?",
                                                               "Sim", "Não");

            if (answer)
            {
                var now = DateTime.Now;
                ReportItemDatabase.Save(new ReportItem(DateControl.Month, ReportUtils.DaysInMonth(DateControl), DateControl.Year, totalReport.Minutes * -1));
                ReportItemDatabase.Save(new ReportItem(now.Month, now.Day, now.Year, totalReport.Minutes));
                DateControl = now;
                HandleDateControlChange();
            }
        }