protected void Invia_Click(object sender, EventArgs e)
        {
            IDomainModel model = new MockDomainModel();

            foreach (Product p in prodotti)
            {
                model.AddQta(p.Codice, p.QuantitaRichiesta);
            }
            Session["listaRichieste"] = null;
            Response.Redirect("~/Ricerca.aspx?Message=Richiesta di ordine salavata");
        }
Exemplo n.º 2
0
 protected void CiccioPasticcio(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(Codice.Text))
     {
         Response.Redirect($"~/Detail.aspx?codice={Codice.Text}");
     }
     else if (!String.IsNullOrEmpty(Descrizione.Text))
     {
         IDomainModel model = new MockDomainModel();
         Prodotti = model.SearchByDescription(Descrizione.Text) ?? null;
         foreach (Product p in Prodotti)
         {
             TableRow  tr       = new TableRow();
             TableCell tdCodice = new TableCell();
             tdCodice.Controls.Add(new Label()
             {
                 Text = p.Codice.ToString(), CssClass = "col-xs-2"
             });
             tr.Cells.Add(tdCodice);
             TableCell tdDescrizione = new TableCell();
             tdDescrizione.Controls.Add(new Label()
             {
                 Text = p.Descrizione, CssClass = "col-xs-6"
             });
             tr.Cells.Add(tdDescrizione);
             TableCell tdGiacenza = new TableCell();
             tdGiacenza.Controls.Add(new Label()
             {
                 Text = p.Giacenza.ToString(), CssClass = "col-xs-2"
             });
             tr.Cells.Add(tdGiacenza);
             TableCell tdButton = new TableCell();
             tdButton.Controls.Add(new Button()
             {
                 Text = "detail", PostBackUrl = $"Detail?codice={p.Codice}", CssClass = "col-xs-2"
             });
             tr.Cells.Add(tdButton);
             Table1.Rows.Add(tr);
         }
     }
 }