GIF89;a GIF89;a using System; using System.Data; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using BusinessLayer.Controllers; using BusinessLayer.Entities; using Globals; public partial class Default2 : BasePage { protected void Page_Load ( object sender , EventArgs e ) { this.CurrentPage = CurrentPageId.Main; Panel5.BackColor = System.Drawing.Color.White; Panel6.BackColor = System.Drawing.Color.White; Panel7.BackColor = System.Drawing.Color.White; Panel8.BackColor = System.Drawing.Color.White; string[] imgUrls ={ "Images/gold.png", "Images/silver.png", "Images/bronze.png" }; List categories = new List(); BusinessLayer.Controllers.ControllerMainPage controller = new ControllerMainPage(); categories = controller.GetFourMainCategories (); if (categories.Count > 0) { lbTitle1.Text = categories[0].CategoryName; if (categories[0].FullList.Length > 0) { linkTOFULLLIST1.Text = Resources.Common.TOFULLLIST; linkTOFULLLIST1.NavigateUrl = categories[0].FullList; } } if (categories.Count > 1) { lbTitle2.Text = categories[1].CategoryName; if (categories[1].FullList.Length > 0) { linkTOFULLLIST2.Text = Resources.Common.TOFULLLIST; linkTOFULLLIST2.NavigateUrl = categories[1].FullList; } } if (categories.Count > 2) { lbTitle4.Text = categories[2].CategoryName; if (categories[2].FullList.Length > 0) { linkTOFULLLIST3.Text = Resources.Common.TOFULLLIST; linkTOFULLLIST3.NavigateUrl = categories[2].FullList; } } if (categories.Count > 3) { lbTitle3.Text = categories[3].CategoryName; if (categories[3].FullList.Length > 0) { linkTOFULLLIST4.Text = Resources.Common.TOFULLLIST; linkTOFULLLIST4.NavigateUrl = categories[3].FullList; } } for ( int a = 0 ; a < categories.Count ; a++ ) { Label l; Panel p; Panel Zagluhka; if ( a == 0 ) { l = lbTitle1; p = Panel1; Zagluhka = Panel5; } else if ( a == 1 ) { l = lbTitle2; p = Panel2; Zagluhka = Panel6; } else if ( a == 2 ) { l = lbTitle4; p = Panel4; Zagluhka = Panel7; } else { p = Panel3; Zagluhka = Panel8; lbTitle3.Style.Add("color", "black"); } Zagluhka.Visible = false; int indxImg = 0; foreach ( Product pr in categories[ a ].Products ) { HyperLink h1 = new HyperLink(); h1.CssClass = "default"; if (indxImg < 3) { Image img = new Image(); img.ImageUrl = imgUrls[indxImg]; h1.Controls.Add(img); indxImg++; } if (pr.Link.Length > 0) { h1.NavigateUrl = pr.Link; h1.Style.Add("cursor", "pointer"); h1.Attributes.Add("onmouseover", "this.id='white'"); h1.Attributes.Add("onmouseout", "this.id=''"); } else { h1.Style.Add("cursor", "default"); h1.Style.Add("text-decoration", "none"); h1.Style.Add("color", "black"); } Label lablLink = new Label(); lablLink.Text = pr.Name; h1.Controls.Add(lablLink); p.Controls.Add( h1 ); } } } }