-
Notifications
You must be signed in to change notification settings - Fork 0
/
produkter.aspx.cs
94 lines (84 loc) · 3.54 KB
/
produkter.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class produkter : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<product> prods = product.getProducts();
int prod = Convert.ToInt32(Request.QueryString["prod"]);
if (Request.QueryString["prod"] != null)
{
litBreadcrumb.Text = "<bread-crumb type='first'><a href='/default.aspx'>Hjem</a></bread-crumb><bread-crumb><a href='/produkter.aspx'>Produkter</a></bread-crumb><bread-crumb type='last'><a href='/produkter.aspx?prod=" + prod + "'>" + prods[prod]._header + "</a></bread-crumb>";
litTop.Text = "<p tabindex='0' class='selected'>Funktioner</p><p tabindex='0'>Specifikationer</p><p tabindex='0'>Konfiguration</p><p tabindex='0'>Tekniske Tegninger</p><p tabindex='0'>Tilbehør</p>";
S.Attributes.Add("style", "background-color: transparent");
S1.Attributes.Add("style", "display: block; padding: 0");
litProductDescription.Text = prods[prod].displayProdDescription(prod);
litContent.Text = prods[prod].displayProdContent();
getNav(prods, prods[prod]);
}
else if (Request.QueryString["tilbehør"] != null)
{
S1.Attributes.Add("style", "flex-direction: column;align-items: baseline");
tilbehor.Attributes.Add("class", "selected");
litContent.Text = "<h2 style='width:73%; margin: .7em 100px'>Tilbehør</h2>" + accessroie.displayAccessories(accessroie.getAccessories());
getNav(prods);
}
else
{
litBreadcrumb.Text = "<bread-crumb type='first'><a href='/default.aspx'>Hjem</a></bread-crumb><bread-crumb type='last'><a href='/produkter.aspx'>Produkter</a></bread-crumb>";
litContent.Text = prods[0].displayProds(prods);
getNav(prods);
}
}
public void getNav(List<product> prods)
{
int i = 0;
foreach (product prod in prods)
{
if (!prod._dome)
{
litStd.Text += "<li><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
else
{
litDome.Text += "<li><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
i++;
}
}
public void getNav(List<product> prods, product self)
{
int i = 0;
foreach (product prod in prods)
{
if (prod == self)
{
if (!prod._dome)
{
litStd.Text += "<li class='selected'><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
else
{
litDome.Text += "<li class='selected'><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
}
else
{
if (!prod._dome)
{
litStd.Text += "<li><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
else
{
litDome.Text += "<li><a href='/produkter.aspx?prod=" + i + "'>" + prod._header + "</a></li>";
}
}
i++;
}
}
}