//IRecuperoPasswordController public ActionResult VerificaDomandaSicurezza() { Richiesta r = Deserialize <Richiesta>(); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(false))); } bool res = _recuperoPasswordController.VerificaDomandaSicurezza((String)r.Parametri[0], (String)r.Parametri[1]); return(Content(Serialize <bool>(res))); }
public ActionResult GetCarrello() { Richiesta r = Deserialize <Richiesta>(); Dictionary <ElementoCatalogo, int> res = null; if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <Dictionary <ElementoCatalogo, int> >(res))); } res = _carrelloController.GetElencoProdotti(); return(Content(Serialize <Dictionary <ElementoCatalogo, int> >(res))); }
public ActionResult RimuoviPRodotto() { Richiesta r = Deserialize <Richiesta>(); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(false))); } bool res = _carrelloController.RimuoviProdotto((ElementoCatalogo)r.Parametri[0]); return(Content(Serialize <bool>(res))); }
//IGestioneSpesaController public ActionResult GetSaldo() { Richiesta r = Deserialize <Richiesta>(); float res = -1; if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <float>(res))); } res = _gestioneSpesaController.GetSaldo((Carrello)r.Parametri[0]); return(Content(Serialize <float>(res))); }
public ActionResult GetUtente() { Richiesta r = Deserialize <Richiesta>(); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); Utente u = null; return(Content(Serialize <Utente>(u))); } Utente res = _gestioneProfiloController.GetUtente(); return(Content(Serialize <Utente>(res))); }
//ISelezioneMarket public ActionResult GetElencoSupermarker() { Richiesta r = Deserialize <Richiesta>(); List <Supermarket> res = null; if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <List <Supermarket> >(res))); } res = _selezioneMarketController.GetElencoSupermarket(); _utente = (Utente)r.Parametri[0]; return(Content(Serialize <List <Supermarket> >(res))); }
//IGestionePofiloController public ActionResult ModificaDati() { Richiesta r = Deserialize <Richiesta>(); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(false))); } bool res = _gestioneProfiloController.ModificaDati((String)r.Parametri[0], (String)r.Parametri[1], (DateTime)r.Parametri[2], (Indirizzo)r.Parametri[3], (String)r.Parametri[4], (String)r.Parametri[5], (String)r.Parametri[6], (String)r.Parametri[7]); return(Content(Serialize <bool>(res))); }
//IStroicoController public ActionResult ElencoOrdini() { Richiesta r = Deserialize <Richiesta>(); _storicoController = new StoricoController(_utente, _session); List <ShoppyHomeServer.Models.Model.Profilo.Spesa> res = null; if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <List <ShoppyHomeServer.Models.Model.Profilo.Spesa> >(res))); } res = _storicoController.ElencoOrdini(); return(Content(Serialize <List <ShoppyHomeServer.Models.Model.Profilo.Spesa> >(res))); }
//IVerificaConferma public ActionResult TerminaSpesa() { Richiesta r = Deserialize <Richiesta>(); _verificaConfermaController = new VerificaConfermaController(_carrello, _utente, _session); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(false))); } bool res = _verificaConfermaController.TerminaSpesa((Indirizzo)r.Parametri[0]); GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(res))); }
//IRegistrazioneController public ActionResult RegistraUtente() { Richiesta r = Deserialize <Richiesta>(); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <bool>(false))); } bool res = _registrazioneController.RegistraUtente((String)r.Parametri[0], (String)r.Parametri[1], (DateTime)r.Parametri[2], (Indirizzo)r.Parametri[3], (String)r.Parametri[4], (String)r.Parametri[5], (String)r.Parametri[6], (String)r.Parametri[7], (String)r.Parametri[8], (String)r.Parametri[9]); return(Content(Serialize <bool>(res))); }
public ActionResult GetCatalogo() { Richiesta r = Deserialize <Richiesta>(); _carrello = new Carrello(); _carrelloController = new CarrelloController(_carrello, _session); _catalogoController = new CatalogoController(_carrello, _session); Catalogo res = null; if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); return(Content(Serialize <Catalogo>(res))); } res = _catalogoController.GetCatalogo((Supermarket)r.Parametri[0]); return(Content(Serialize <Catalogo>(res))); }
//ILogin public ActionResult VerificaCredenziali() { Richiesta r = Deserialize <Richiesta>(); Utente res = _loginController.VerificaCredenziali((String)r.Parametri[0], (String)r.Parametri[1]); if (!GestoreSessione.GetGestoreSessione().VerificaSessione(r.Mittente)) { DateTime scadenza = DateTime.Now; scadenza.AddHours(5); Sessione s = new Sessione("Cliente", DateTime.Now, scadenza, r.Mittente); GestoreSessione.GetGestoreSessione().CreaSessione(s); } else { DateTime scadenza = DateTime.Now; scadenza.AddHours(5); Sessione s = new Sessione("Cliente", DateTime.Now, scadenza, r.Mittente); GestoreSessione.GetGestoreSessione().EliminaSessione(r.Mittente); GestoreSessione.GetGestoreSessione().CreaSessione(s); } _utente = res; _gestioneProfiloController = new GestioneProfiloController(_utente, _session); return(Content(Serialize <Utente>(res))); }