protected void CreaUtente_Click(object sender, EventArgs e)
 {
     using (AzioniUtente azioni = new AzioniUtente())
     {
         azioni.AggiungiUtente(Nome.Text, Cognome.Text, SessoScelta.Text, DataNascita.Text, CittàNascitaScelta.Text, Email.Text, Password.Text);
         Response.Redirect("~/ListaProdotti.aspx");
     }
 }
Ejemplo n.º 2
0
 protected void LogIn_Authenticate(object sender, EventArgs e)
 {
     using (AzioniUtente azioni = new AzioniUtente())
     {
         var utente = azioni.ControllaCredenziali(LogIn.UserName, LogIn.Password);
         if (utente == null)
         {
             LogIn.FailureText = "Nome utente e/o Password errati!";
         }
         else
         {
             FormsAuthentication.RedirectFromLoginPage(LogIn.UserName, LogIn.RememberMeSet);
         }
     }
 }
Ejemplo n.º 3
0
 public void CreaOrdine()
 {
     using (ContestoProdotto _db = new ContestoProdotto())
     {
         using (AzioniCarrello azioni = new AzioniCarrello())
         {
             var ordine = new Ordine
             {
                 Utente_Email     = HttpContext.Current.User.Identity.Name,
                 ProdottiOrdinati = _db.ProdottiCarrello.Where(p => p.CarrelloID == HttpContext.Current.User.Identity.Name).Select(p => p.Prodotto.ProdottoID).ToList(),
                 OrdineID         = Guid.NewGuid().ToString(),
                 DataOrdine       = DateTime.Now,
                 PrezzoOrdine     = Convert.ToDouble(Totale.Text.Split(' ')[0])
             };
             using (AzioniUtente azioniUtente = new AzioniUtente())
             {
                 azioniUtente.AggiungiOrdine(ordine);
             }
         }
     }
 }