0% found this document useful (0 votes)
3 views3 pages

Session

Uploaded by

pesmobilebaovn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Session

Uploaded by

pesmobilebaovn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Session[variable] = obj

Obj = Session[variable]
public static DataTable tbGioHang =
new DataTable();
//Tao moi gio hang trong - tao cau truc
DataClass.tbGioHang.Rows.Clear();
DataClass.tbGioHang.Columns.Clear();
DataClass.tbGioHang.Columns.Add("idSP", typeof(int));
DataClass.tbGioHang.Columns.Add("TenSP",
typeof(string));
DataClass.tbGioHang.Columns.Add("Gia",
typeof(decimal));
DataClass.tbGioHang.Columns.Add("SoLuong",
typeof(int));
DataClass.tbGioHang.Columns.Add("TongTien",
typeof(decimal), "SoLuong * Gia");
DataClass.tbGioHang = Session["GioHang"] as DataTable;
Session["GioHang"] = DataClass.tbGioHang;
SL = 1;
if (Session["GioHang"] != null)
{
DataClass.tbGioHang = Session["GioHang"] as DataTable;
}
bool Daco = false;
foreach (DataRow row in DataClass.tbGioHang.Rows)
{
if ((int)row["idSP"] == SP_ID)
{
row["SoLuong"] = (int)row["SoLuong"] + SL;
Daco = true;
break;
}
}
if(!Daco)
DataClass.tbGioHang.Rows.Add(SP_ID, strTenSP, Gia, SL);
Session["GioHang"] = DataClass.tbGioHang;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy