예제 #1
0
 protected void dlAothunu_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "Them")
     {
         ShoppingCart gio   = (ShoppingCart)Session["GioHang"];
         Label        masp  = (Label)e.Item.FindControl("lbMaSP");
         Label        tensp = (Label)e.Item.FindControl("lbTenSP");
         Label        gia   = (Label)e.Item.FindControl("lbGia");
         gio.ADD(masp.Text, tensp.Text, 1, long.Parse(gia.Text));
         Response.Redirect("GioHang.aspx");
     }
 }
예제 #2
0
 protected void dlCTSP_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "Them")
     {
         ShoppingCart gio   = (ShoppingCart)Session["GioHang"];
         Label        ma    = (Label)e.Item.FindControl("lblMaSP");
         Label        tensp = (Label)e.Item.FindControl("lblTenSP");
         Label        gia   = (Label)e.Item.FindControl("lblGia");
         TextBox      sl    = (TextBox)e.Item.FindControl("txtSL");
         gio.ADD(ma.Text, tensp.Text, int.Parse(sl.Text), long.Parse(gia.Text));
         Response.Redirect("GioHang.aspx");
     }
 }