hi
I used below code for session that compare data from session and according that data it will
PLLink.Visible = false;
PLBuy.Visible = true;
below is code:
if (Session["Order"] != null)
{
DataTable dt = Session["Order"] as DataTable;
if (dt.Rows.Count > 0)
{
if (dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("download") && dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("buy"))
{
PLLink.Visible = false;
PLBuy.Visible = true;
}
else if (dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("download") && !dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("buy"))
{
PLLink.Visible = true;
PLBuy.Visible = false;
}
else if (!dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("download") && dt.AsEnumerable().Select(x => x["show"].ToString().ToLower()).Contains("buy"))
{
PLLink.Visible = false;
PLBuy.Visible = true;
}
}
}
else {
PLLink.Visible = false;
PLBuy.Visible = true;
}
now I want exactly write above code for below table:
Id
|
Show
|
name
|
code
|
1
|
Buy
|
Waterfall
|
1111
|
2
|
Download
|
Waterfall
|
1111
|
3
|
buy
|
Green
|
2222
|
I want write above code for table (show column)
how I can do it?
Best regards
neda