update comportamento: se 0 --> anno corrente

This commit is contained in:
Samuele E. Locatelli
2020-01-02 17:41:36 +01:00
parent d46dcb1e52
commit 7fc956135d
+2 -8
View File
@@ -1,10 +1,6 @@
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace MP.Controllers
@@ -78,8 +74,6 @@ namespace MP.Controllers
public List<EventDetail> Get()
{
int anno = DateTime.Now.Year;
//string answ = JsonConvert.SerializeObject(elencoEventi(anno));
//return answ;
return elencoEventi(anno);
}
@@ -91,8 +85,8 @@ namespace MP.Controllers
[HttpGet]
public List<EventDetail> Get(int id)
{
//string answ = JsonConvert.SerializeObject(elencoEventi(id));
//return answ;
// se chiede 0 --> prende anno corrente!
id = id == 0 ? DateTime.Now.Year : id;
return elencoEventi(id);
}